Recommended Posts

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:



There is also a Duo bit file:



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.



  • Like 1
Link to comment
Share on other sites



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?



Link to comment
Share on other sites

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.




Link to comment
Share on other sites

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.





Link to comment
Share on other sites

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.   

Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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?



Link to comment
Share on other sites


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).



Link to comment
Share on other sites

Hi Alvie,


Thanks for that info.


The code that AtomMMC uses to initialize the SD Card is here:



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:


It was a 512MB transcend in this case.


Edit: there is more here:



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.



Link to comment
Share on other sites


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.






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.





Link to comment
Share on other sites



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.



Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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.





Link to comment
Share on other sites



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.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.