Hello All, I'm currently using a nokia 6100 lcd screen, its built for 168/328 duemilanove size boards and uses spi I've made some little 'wing' boards to break out the pins LCD spi pins onto my arduino megas SPI pins, no problems there, everything is running nicely.
Now I want to add an SDcard via spi and later on some other SPI stuff like eeprom/flash ram, am I right in thinking that I just need to make sure the LCD and SD card have different SS(Salve select) pins defined so that they can be individually selected and won't interfere with each others operation?
am I right in thinking that I just need to make sure the LCD and SD card have different SS(Salve select) pins defined so that they can be individually selected and won't interfere with each others operation?
Yes, that is how multiple devices can share the SPI clock and data lines. Not sure all devices that use SPI have a SS pin, but I'm sure that is something their data sheets would explain.
Thanks Lefty, that's brilliant, I'm still getting to grips with the arduino, its my first MCU with very little electronics components experience but I do have some coding experience about 10yrs ago, so there are gaps, forgot a lot of it, remembering it as I go, hehe.
So armed with that information I can use the 'just in case i need em for something' pins I added on my wing board to tap the SPI lines, if anyone is interested in seeing how I broke out the sheild SPI pins to an arduino mega I'll take a picture, it still leaves aref, gnd, 8,9 passed through to arduino mega. Very simple design, quick to make on vero board and damn useful for all those boards that aren't stackable with decent access to all pins on the outside. Youd do lose pins pins 10,11,12,13 on the mega but I'm working on that, just need a longer bit of veroboard to accomodate breaking out those pins on the mega.
All of the SPI stuff I've looked at so far has a SS/CS pin that needs bringing high or low before data IO can start, this seems fairly common among a few protocols 12c, spi, 1wire and standard amongst low pin count ICs from what I've seen, as you say I can't vouch for every device.
Next on the upward slope of the learning curve I have to tackle clock sources, speeds and fuses, then interrupts and vectors.... [smiley=shocked.gif]
Looking at the mmc.cpp file which has the only definition of the SPI pins (going to need to change those for the mega) the SS pin can be set to anything in an independent slave configuration which I believe is the same as nolkia lcd library that I am using.