 So let's see if we can get the SD card working and then we can call this finished So over here, I have the machine running emutos with the lid off as is fairly obvious I have a card in each slot This one has got the palm of card in it and this one has the emutos card in it over here I have a logic probe which will light up a LED depending whether it sees a logic zero a logic one or If there's any activity so We've got here a pinout for the SD card So we should be able to see this one is chip select and It's currently at logic one, which means it's not asserted. This is active low Here we've got mozi which is data no activity as we expect Ground is logic zero is ground Vcc power is three point three volts, which is logic one clock no activity ground again Miso mastering slave out and no activity and the last one is not used in SPI mode so what we're going to do is to poke the card and See what if there's any activity on the lines What's almost certainly happened is that palm us has set up the hardware in a weird state Which my initialization code is failing to correct so it's likely to be something as simple as the clock's wrong or the pins aren't wired up to the GPIOs properly or and stuff like that So what we're going to do is just poke the card by doing dirs While looking at the various data lines and seeing what happens now first thing to test is whether the card is powered on so We've got chip select which is here. We expect that to be Unasserted logic one that means unasserted. So that's correct mozi no activity Ground is at zero that is ground Vcc is at one good. This means the card is powered on and Clock no activity a Ground again these ground and Miso no activity So that's pretty good for a start. It means the card is actually powered on so the next thing I suppose is Let's see what chip select does so Touch this to the chip select line dir And return Okay The blinking means that chip select is going high and low So we know that chip select is being strobed, which is correct right Mozi for activity master out slave in this is the Board talking to the card. Is it sending it commands? Yes, it is good Or rather not so good because I was kind of hoping that one of these things would be wrong. That'd be an easy fix Clock is 765 this one so logic zero We see activity clock is being strobed ground Miso Master in slave out. This is the card talking to the board. The card is not responding Okay, so either it's not wired up or We're sending some kind of incorrect data and the card is not recognizing it So I think I figured out what's going on now Here it is and you notice the card is not working And I've discovered that if I unplug the parmos card, it all works So let's take a look at these lines so we have Power on pin 4 This card is powered up this card is also powered up Chip selects on pin 1 D asserted Asserted hmm So let me see Mozi is on pin 2 So that's this one so we do a dir And You get activity do a dir you get activity Right what is happening is that both cards are being selected at the same time Which means that when we send commands to the first card The both cards respond at the same time and we get garbage So this ought to be a relatively easy fix we Just need to make sure that Firstly that both cards are powered down and I forgot to Make a note of what pins these were on Put B Right, we're gonna have to figure out what pins card zero are on Card one is on the other thing is that we want to make sure that The chip select line for card one this one is D asserted it is asserted more or less by accident In fact, we could have this card powered up, but the asserted and everything we find But let's just keep them powered off. Okay, I'm gonna have to fire up Gidra Okay, here it is So we want SPI power SPI power reset. What's this read? request Set here we go So let's just make things a bit more visible So you thunk here is the code Um Bus awake should be actually doing. Yeah, here we go. Here it is fiddling with the bits pins No, it's not this is the The ST microcontroller Stuff Yeah, all right. Let's try this the other way. We know that the power line is on port B So go let's go look for PB sell Where is this used by? It apparently is used by this routine. Yes, I had misread this So the last thing it does is it powers up the card using PB and It is bit five So let's assume that for the other device. It's the same This is on port K and it is bit five So five SD card one power So, so this is all exactly the same PK you and I'm assuming that the other card is set up the same way with the same Transistor controlling the power All right power on card zero only that's fine So assertion We know that This is on PJ Bit three Did we remember to write that down we did not SD card zero Chip select So over here, this should be touching Port J which is here it is setting Not the bit. Oh, yeah, that is the right bit and oh This is the same chip select line that the SPI interface actually wants to be connected to they're using that GP IO For chip select, which presumably makes the wiring easier or something So the same code here is in pin port F bit to So port F bit to for the value for is SD card one chip select So this is actually Power off both cards Set up CS GPIOs and D assert both cards So this is conf this is concerned Only with this bit so That will be F F F F Three okay This will leave the other pins Unaffected so So we're going to do it in two passes so that this code Configures the chip select line sets it this code configures the SPI lines so this is going to now going to be port F and It's this is going to be One zero one one which is a D Yes Now the this code is also fiddling with some stuff in port D that I reckon Oh, yeah port D is the interrupt Port so Value of two is this so that's going to be SD cars zero interrupt And the same thing here is The next bit up SD card one IQ, but we're not using those Alright, so assuming I haven't cocked something up here. I think this ought to work. We don't have definition for PKP you and for to for for to or PF dear for two eight Okay, I'll just fix that warning invalid operands the binary star have int and What is wrong with that? Oh this one We go See sometimes uses really ridiculous error messages. Okay Let's give this a try and see if it works and unfortunately this will require turning the board upside down again Okay, here we go Dana run just start up the serial terminal Go bingo, it works and here we are at Atari toss I haven't calibrated the The touch screen so Now where did I put the stylus? I appear to have slightly lost it. It'll be on my desk somewhere So let's just use the stylus from my very expensive work issue pixel book 3, which is terrible. Okay How's this behaving? poorly Anyway That seems to be working now and it seems to be noticeably snappier Than than it was previously Alright, so let's I've got here a Benchmark program And you have run me this is core mark that is fairly well respected There's a lookup table of Atari ST values It takes a little while to run, but I will either fast-forward keep talking or jump-cut I Believe this is now running at Twice the clock speed. There we go Recline twice the clock speed that it was 5.5 iterations per second I Remember that was what it was doing last time. Let me just go look this up So a value of 5.5 is in fact the same value. I was getting before this puts this machine on a par with a 16 megahertz Vulcan or a whatever that is In terms of modern processors it comes in between a an Aptimal 80 mega and an MSP 430 which are both system on a chip ultra cheap tiny little processors running at 8 megahertz so clearly this this 68,000 is not that quick Interestingly, this is the same speed as it was before it just feels snappier when I'm using it so hmm It's possible parmos has configured some stuff. I don't know how to that makes things like the graphics better I'm not sure Also because I fiddled with these numbers The sd card is now running twice as fast as it was previously that will make anything No, wait, that that's wrong. That's running half as fast as it was previously So I think I actually want to put these back to where they were which is for actual data transfer as fast as possible, which isn't very fast, but the The clock rate used for identifying the sd card does need to be at about 250 kilohertz or else it won't work so let just Build and deploy that and make sure it still works and A interesting little quirk, which is that after resetting the Dana has now come up with its calibration screen. This is because Parmos is expecting the RAM to be preserved between boots and Of course every time I run parmos, it scribbles over the RAM. So you're going to calibrate this time No, it's not Hit the reset button. Hopefully it should skip the calibration So clearly when I ran core mark it Overwrote some of the magic numbers that let parmos know whether the RAM is consistent So it went through the full reset procedure Currently, I actually have this set to only use four megabytes of RAM because my reset script only seems to produce that much available I think I could probably Here we go. I think I could probably bump that to 8 meg if we're running from parmos because parmos has Configured it and of course now that it's reset. I don't have Dana run anymore So we have to re-sync it via USB like so and it's shown up So serial terminal go and Yep, the SD card now works good It's done I Mean there's a million bugs to fix well some bugs to fix and And tracing I need to remove But let's just turn the SD card tracing off Actually, let's just Okay Push done So here I have the Dana on the workbench so you can get a better look at it because now I can use like a real camera So here we are parmos if I run it by running the Dana run program it Boots the kernel and We get splash screen and we end up. We're at the gem desktop I now need to run the calibration tool and the easiest way to do that is via the command line So I'll do control Z Dana cowl This is still the oops. I touched twice. This is still the version with all the Debug messages in it. So I have to run that again Okay So exit back to gem and see whether the mouse pointer is even slightly accurate. Well, that's okay over there You can see it drifts way right over there and Going up and down makes it move diagonally and over here It's doing the horrible backwards motion thing But in the middle, it's all right and I can Should be able to open menus. It's not very Effective there we go. So it does actually kind of work And menu opening the closing is good and snapping as you can see It's uh No, I don't want to do anything there Cancel okay It's For a for a quasi Atari ST it is perfectly acceptable performance wise discs a bit slow if I Go hunting for software. I actually installed a bunch of Atari ST software on this including things like Cubase and various drawing packages Anlisp and Nearly all of them don't work The issue is that either They expect a bigger screen because this is only 560 by 160 which is shorter than a Atari ST screen And it's shorter than an Atari ST low res screen and narrower than Atari ST 80 column screen And the stuff that does accept the screen size Tends not to work because it talks directly to the hardware like Cubase But I did find first word plus here that runs So let's go and find that Can I run it by double-clicking now there's too much noise in the motion of the The mouse so we can at least select it and I can do control o to open it First word plus is a basic word processor that I believe got bundled with a lot of Atari STs It's actually not bad. I did a lot of writing in the And the Archimedes port of it. It's a character cell word processor, and I like these. I actually wrote my own Character cell word processor because I like these so much, but it's decent. It's nice Nice and nippy the cursor movement is a bit slow sometimes. I believe that's a bug in the Keyboard driver it also double presses a lot of times which is annoying, but Speed isn't bad Yeah, now you may notice that the window here is bigger than the screen size because this has been sized for a Probably 640 by 200 Atari monochrome display Unfortunately This has put the resize buttons over here somewhere where I can't get at them I can with a great deal of difficulty. Come on Drag the window around Go Except it won't let me drag it off the left-hand side of the screen. So I can't get at the controls which is somewhat irritating So I just have to live with it being the wrong size That did not work. Okay Well, it's not it's nearly on the left-hand side of the screen No, that was what I wanted There we go. So you can actually put the cursor off the bottom But Redraw speed is all right It it keeps up with my typing most of the time They it feels a bit laggy to use because of the keyboard issue. I mean you can see the The way the cursor is moving I'm just holding down the cursor key and One interesting aspect is if I use the keyboard mouse, which is done with the alt key to do outright see the Mouse pointer is moving in jerks, but the cursor is also moving Which means that sometimes it's Misinterpreting keys because it doesn't think that alt is down That is solely a bug in my code, which is like annoying. Oh Yeah, just to demonstrate that it will work. I installed a desktop accessory, which is this calculator These are terminating stay resident programs that get loaded at boot time and you can use them to provide Little utilities that they live in this left-hand menu here Which is how apparently has an Atari icon on it when it's in first word plus in the desktop It's just labeled desk and it's a you know, perfectly ordinary basic calculator. Ah, which apparently does not Okay, that works Yeah, it's a perfectly ordinary calculator You notice the menu of the title bar is slightly off the top of the screen Again, that is a issue with the screen size. You see how the window doesn't quite fit Now if I can manage to drag this come on There we go See it has truncated the title bar because it's it's moved to the window by just Blitting it around and the video memory and hasn't redrawn that bit You can trigger it to redraw and it will show up again. It's just Cosmetically annoying. Oh, yeah, another small issue is that while the menus work See how fast they open and close the The contents of the screen underneath the menu is cached in memory, which is nice Ah, I can't get it help never mind help overflows the right-hand side of the screen and Wraps around to the left-hand side of the screen, which is not brilliant Again on a machine with a bigger screen. This shouldn't be an issue Because first word plus thinks the screen is the wrong size Which is annoying Yeah, first word plus the stuff like graphics in it. It's reasonably well Well provisioned as word processors go If the other bugs were fixed then I could see myself actually using this thing With first word plus. It's a decent enough little word processor but As it is I'm afraid after playing with it for a while It's too buggy to be of much use things like the keyboard the biggest issue is there is no power control and This machine doesn't have an on-off switch. It's always powered up. I have this thing plugged in via USB And there's no battery in it plug it in it turns on Because of course it was intended to run palm ask which keeps all its data in RAM Which means if it powers down you lose all your data hence on all the time what it's got instead is power down modes and The power controller and the battery management is just nothing there. I haven't bothered with any of that Battery management is a little bit tricky because if you get it wrong you can do bad things like you know set fire to stuff so If there's interest I shall just wait for somebody else to be interested enough to work on that I think Anyway, let's quit out of this. Oh, yeah the IQ no The keyboard shortcuts aren't listed in the menus, which is annoying. I Don't know what they are in that of the manual Come on all the way to quit. There we go and Quit all and No, I don't care about that document and that takes us back to Gem the command line environment is Perfectly usable and pretty snappy. It understands the screen size so Command line tools will probably work fine on this if I managed to get all the memory working This machine has I believe 16 megabytes of RAM. So that's a pretty well-spec to tari ST And there's a whole suite of command line tools available including mint which is basically a series of massive Toss extensions that turn your Atari ST into a basic Unix machine with multi-tasking sockets and You know the born shell and so on and mint does a run on it on emu toss So it'd be quite possible to do a mint port to the Dana again gooey applications are still like intended for ordinary Atari toss gem and you still have the same screen problems But the command line environment will be perfectly usable Anyway, I am going to call this project finished. I think this has been rather too many episodes and Besides I'm going away on holiday soon won't be able to work on it So I'm going to do some tidying upload it all to github and send off a pool request to the emu toss people and Leave it at that. I Know there's been people who actually been watching these For some reason. I hope you all enjoyed it I'm going to work on other programming stuff in the future, but I'm going to take a good long break first So there should be some more workbench stuff Anyway, I hope you enjoyed this video and all the rest in the series. Please let me know what you think in the comments