1284P and SD Cards

Just what is it with the Arduino people – they seem to have it in for the 1284p – one of the best chips out there. WHY is it a good chip? Well, it runs all Arduino projects – but you get 128K of FLASH and 16K of RAM – is that a good enough reason? AND they do a DIP version so it’s a doddle to do prototyping with it – and its’ cheap – and has lots of pins etc.

BUT – some of the libraries pretend the chip doesn’t exist.. SD is one of them –  I just updated the SD library and I happened to try a little test program to put something in SD on the normal Ethernet card… Nothing… I made sure I specified the select line (I chose output 27 – the Ethernet select line is output 4 on these chips normally)…. nothing.. then I remembered I’d updated the library – went on a search and found THIS. See code below – but I suggest ALSO adding for the 1284 – so see latter of the two updates.. this might apply to other libraries if you have any hassle…

Go into this file: C:\Program Files (x86)\arduino-1.0.1\libraries\SD\utility\Sd2PinMap.h
Change this line: #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
to: #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284P__)

Go into this file: C:\Program Files (x86)\arduino-1.0.1\libraries\SD\utility\Sd2PinMap.h
Change this line: #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
to: #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s