hoglet Posted April 19, 2015 Report Share Posted April 19, 2015 Hi all, I received my Duo last week, and this weekend I've been porting the Acorn Atom FPGA design to run on it. Here's the end result: You can get more details from the thread over at stardot.org.uk. This design currently uses an AVR Soft Processor to run the AtomMMC software stack for the SDCard interface. My next step is to try switching to the ATmega32U4, which will free up quite a lot of FPGA resources. All of the VHDL code is on github:https://github.com/hoglet67/AtomFpga There is also a Duo bit file:https://github.com/hoglet67/AtomFpga/blob/master/Atomic_top_duo.bit If you want to try this out, you'll need the Atom Software Archive. Download AtomSoftwareArchive_20140817_V7.zip from the above thread, unzip it onto a blank FAT32 format MicroSD card, pop in into the Duo and hit Shift-F10 (F10 is mapped to the Atom Break key). Here's a screenshot of the Menu system help page:Search (S) is the single most useful way of finding a specific program, once you know what it's called. GALAXIAN (Bug Byte) is a good program to try first! Please let me know if you manage to get this working, either here, or over on the stardot.org.uk forums. Dave 1 Quote Link to comment Share on other sites More sharing options...
hoglet Posted April 19, 2015 Author Report Share Posted April 19, 2015 Jack, I have a quick question about the Classic Computing Shield / ATmega32U4 wiring. It looks like the MicroSD card is connected to the wrong pins on the ATmega32U4. According to the ATmega32U4 datasheet, the SPI interface uses pins B0, B1, B2 and B3. But on the the classic computing shield, the MicroSD card is wired to pins B5, B6, C6, C7. Why the difference? I guess I can used the FPGA to re-route these, but only if I then disable B5, B6, C6, C7 in the ATmega32U4, which loses me valuable I/Os. Also, why's ATmega32U4 PD5 not connected? It would have been nice to be able to use Port D as a byte wide data bus. Is this correct, or am I mis-reading something? Dave Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 20, 2015 Report Share Posted April 20, 2015 Hello Dave, It's hard to anticipate every possible use of the AVR/FPGA/Shields. Wanting to drive the SD card from the ATmega32U4 was not really something I was thinking about when I designed the Classic Computing Shield. I was actually thinking the AVR wouldn't come into play in most FPGA designs to recreate classic computing platforms... Sorry about that. But, thank you for porting the Acorn system to the Papilio DUO! Sorry I made it harder by not connecting the AVR to the SPI pins... I'm putting this on my task list of things to try out and post on the blog. Thanks!Jack. Quote Link to comment Share on other sites More sharing options...
hoglet Posted April 20, 2015 Author Report Share Posted April 20, 2015 Jack, Thanks for the reply. I'll post here if I get any further with using the ATmega32U4. Dave Quote Link to comment Share on other sites More sharing options...
lak Posted April 28, 2015 Report Share Posted April 28, 2015 Hi,Using the supplied bit file for papilio duo and sd card with the unzipped archive (fat32),the Atom fpga did not load the menu despite pressing shift F10.CTRL F10 gives the prompt for Basic. Quote Link to comment Share on other sites More sharing options...
hoglet Posted April 28, 2015 Author Report Share Posted April 28, 2015 Hi Lak, Can you post a photo of what you are seeing (a picture is worth 1000 words!) Does the behaviour change if you remove the SD Card? Dave Quote Link to comment Share on other sites More sharing options...
hoglet Posted April 28, 2015 Author Report Share Posted April 28, 2015 Lak, I think I know what happened - I had added the wrong .bit file into git - one without the Soft AVR8 firmware included. Can you try the one I've just pushed? Dave Quote Link to comment Share on other sites More sharing options...
lak Posted April 29, 2015 Report Share Posted April 29, 2015 Hi Dave, Yes it works now. thanks Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 2, 2015 Report Share Posted May 2, 2015 Hi Hoglet, I tried the acorn atom duo bit file. When I load it to SPI-Flash it won't show up on the monitor, but when I save it to FPGA it shows up. When i switch the power then I can't see it anymore. I have a Papillio-Duo with a computing shield. Also the SDcard isn't working. Great program by the way. I tried a couple off Atom programs and it all worked. I havo to typed them in because there is no way i can save them. Greatings, Goos Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 2, 2015 Author Report Share Posted May 2, 2015 Hi Goos, OK, lets tackle these one at a time.... When you say the SDCard isn't working, can you be a bit more specific? What actually happens. Photos always help! Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 2, 2015 Report Share Posted May 2, 2015 I tried to send a picture of my acorn atom screen, but I can't. It somehow didn't work. But I can say that I used a scandisk 4 Gb sdcard. It can be seen by the Computing Shield testprogram in Designlab. So I think it's a good card. I used format on this card to Ensure that is a Fat32 card and I put the programs from th atomsoftwarecatalog on it. The Menu program is on the root of the card. I insert the card. Then I reset the Computer by "shift F10". The atom then says >*MENU ERROR - NOT READY >. I tried *CAT but this gave me the same error. Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 3, 2015 Author Report Share Posted May 3, 2015 Hi Goos, Try pressing just F10 for about a second, then releasing it, then *CAT. If this still gives ERROR - NOT READY, wait a few seconds and try again a couple more times. If this doesn't work, try doing the same but with the Reset button on the classic computing shield. Occasionally we have come across newer SD Cards that can't be put into SPI Mode (which is what AtoMMC uses). You said the brand was Scandisk - did you mean SanDisk? They are normally very good. Regarding your other problem - not being able program the design to FLASH. Are you able to successfully program other designs? I can't think of any reason this design would be different, especially as you have verified the bitstream is good by programming it into RAM. I wonder if anyone else has any suggestions on the programming issue. Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 3, 2015 Report Share Posted May 3, 2015 Hi Dave, Yes your right it's a SanDisk. I tried all off the above. Nothing works. About programming the design to flash. I think it's a problem of the .bit file, because any other program I wrote to the flash works. Greetings, Goos Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 3, 2015 Author Report Share Posted May 3, 2015 I'm not sure what the problem with the bit file could be, as it works when written to FPGA RAM. I've been able to program it, as has one other person. Very strange. I think it would help to have a couple more data points. Would anyone else be able to test this out? Dave Quote Link to comment Share on other sites More sharing options...
alvieboy Posted May 3, 2015 Report Share Posted May 3, 2015 Occasionally we have come across newer SD Cards that can't be put into SPI Mode Are you sure ? Note that there's a strict procedure to put SD cards in SPI mode (and AFAIK it's a mandatory mode), but returning to SD mode will require a power cycle. From SD Physical Layer spec:7.2.1 Mode Selection and InitializationThe SD Card is powered up in the SD mode. It will enter SPI mode if the CS signal is asserted(negative) during the reception of the reset command (CMD0). If the card recognizes that the SD modeis required it will not respond to the command and remain in the SD mode. If SPI mode is required, thecard will switch to SPI and respond with the SPI mode R1 response.The only way to return to the SD mode is by entering the power cycle. In SPI mode, the SD Cardprotocol state machine in SD mode is not observed. All the SD Card commands supported in SPI modeare always available.I don't make a sense of "if SD mode is required". I assume it's a CMD0 argument. Also, make sure that before using card, you send at least 74 clock cycles with data=1 and card de-selected (CS=1). Alvie Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 3, 2015 Author Report Share Posted May 3, 2015 Hi Alvie, Thanks for that info. The code that AtomMMC uses to initialize the SD Card is here:https://github.com/hoglet67/AtomFpga/blob/master/atommc2fw/mmcio.c This is not my code, and I have not really delved into it at this level before, but I believe that mmc_initialize sends 88 clocks with data=1 and CS=1: for (n = 11; n; --n) XFER_SPI(0xff); /* Dummy clocks */ There was some evidence in a stardot thread that not all cards support SPI mode:http://stardot.org.uk/forums/viewtopic.php?f=3&t=9467It was a 512MB transcend in this case. Edit: there is more here:http://stackoverflow.com/questions/955587/initialization-of-a-microsd-card-using-an-spi-interface It would be great if one or two more people can try out this design, and see if the problems that Goos is having can be replicated. Dave Quote Link to comment Share on other sites More sharing options...
mpcour Posted May 3, 2015 Report Share Posted May 3, 2015 It would be great if one or two more people can try out this design, and see if the problems that Goos is having can be replicated. Dave Hi, I'm trying this and get an "ACORN ATOM + ATOMMC2" line then a prompt line ">" .Keyboard is not doing anything (Numlock not active also ==> no led flash).At power on/reset leds 1&2 lights then 3& 4 are steady dimm lighted. Regards Pascal Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 3, 2015 Author Report Share Posted May 3, 2015 Pascal, Gosh, this is proving tricky! Make sure the keyboard is plugged into PS/2 A not PS/2 B. I've just tried 4 different keyboards with my hardware and they all worked fine. One some of the keyboards, I did see all 3 LEDs flash once on power up. But I don't expect numlock/caplock to do anything, as this is not implemented in the keyboard interface on the FPGA. In fact, no commands are sent from the FPGA to the Keyboard. Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 3, 2015 Report Share Posted May 3, 2015 I have no keyboard problems. I use it on PS/2 port A. All my problems excist of no working Acorn Atom of SPI Flash, only direct from FPGA and no working SD card. Greetings, Goos Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 3, 2015 Author Report Share Posted May 3, 2015 I've had one more thought (a bit of a long shot...) The AVR processor on the Duo shares lines with both the PS/2 A keyboard and SD card. It's possible that a design previously loaded in there is interfering with their operation. Could you try moving the slider switch on the Duo board is pointing towards the edge of the board. This should disable the AVR. Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 3, 2015 Report Share Posted May 3, 2015 Hi Dave, I tried to flip the switch as described above but nothing changed. Both the SD card and also the spi-flash didn't work. Goos Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 4, 2015 Author Report Share Posted May 4, 2015 Goos, I'm starting to run out of ideas. Maybe Jack could give this a try if he has a moment. Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 4, 2015 Report Share Posted May 4, 2015 Hi Hoglet,, I have found the problem with running from SPI-Flash. I used the Papillio Loader 2.7. This didn't work. Then I used Papillio Loader 2.6. This worked fine. I can now power cycle my board with the Acorn Atom up and working. All I have to do is get the SDcard working. Greetings Goos. Quote Link to comment Share on other sites More sharing options...
hoglet Posted May 4, 2015 Author Report Share Posted May 4, 2015 Goos, I wonder why the Papilio Loader 2.7 was just failing to FLASH my bitfile, but was OK with others ??? What do LEDs 1 and 2 do on power up? They should both flash briefly, then go out. LED1 indicates an access to the SD Card. LED2 indicates an error with the SD Card. It might be worth trying a different brand of SD Card if you have one. Dave Quote Link to comment Share on other sites More sharing options...
Goos_E Posted May 4, 2015 Report Share Posted May 4, 2015 Hi Hoglet, It was failing with 2.7 but it was ok with 2.7. Why I don't know. I ordered just 2 new SDcards with. A Kingston and a Transcend both class 10. I probably get them tomorow or the day after. I wait and see. Greetings, Goos Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.