Latest update! Added FRAM and the SD card sheet.
Now, some questions I have (besides the usual "is everything correct" one):
- I want to hook up a 7-button keypad, preferably on 1-B. How would I go about doing that?
- Should I add RS-232 capability, and if so, can I use a Maxim 3111E on the SPI bus?
- This web page about using SD in SPI mode says that initialization requires 74 clock pulses to the SD card's CLK pin at between 100 and 400 kHz. How would I go about setting this up?
- What RTC should I probably be looking at?
errata: SW102 is meant to have the label "NMI"
You have 7 pins free on VIA1 - Port B, so that's easily a 2 x 4 matrix to give up to 8 buttons leaving one IO free...
So - draw 4 lines vertically, and 2 horizontally and at the intersections put a switch - then to read you turn each of the 2 row pin on in turn and sample the 4 row pins and decode the result... You'll need to take care of debounce, but that's fairly easy in software so no need to bother with extra hardware for that.
For the SD card - well, when in doubt, use brute force[1], so a software loop to toggle the clock pin the right number of times with a delay (poke a value onto T1 and wait until it reaches zero). then carry on. My '816 board also uses SD, but it's all done from the ATmega side, however the principle is the same for the setup - I simply set the speed slow, then send 10 bytes of 0xFF, so 80 bits rather than the 74, but the 74 is a minimum, so it works well.
As for the "should serial" question - only you can really answer that. I'd say 'yes' then it gives you the ability to use e.g. xmodem to get data to/from the SD card without going through the cycle of power off, move SD card, read/write, power up, etc. ...
RTC - Use the one that's easiest to write code for.... And if you have a working SPI bus then maybe one with an SPI interface would be a good start?
-Gordon
[1] Ken Thompson