Go Down

Topic: 1284 and 644 (Read 858 times) previous topic - next topic

scargill

Can someone confirm I have this right...

In the 1.05 AND the new 1.57 Arduino packages - the Ethernet card still appears to have reference to the Atmega644 and 1284/1284p devices missing.   

In my version of the Ethernet library I have made the following changes... if you look at the utility/w5100.h file you will see this..

private:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  inline static void initSS()    { DDRB  |=  _BV(4); };
  inline static void setSS()     { PORTB &= ~_BV(4); };
  inline static void resetSS()   { PORTB |=  _BV(4); };
#elif defined(__AVR_ATmega32U4__)
  inline static void initSS()    { DDRB  |=  _BV(6); };
  inline static void setSS()     { PORTB &= ~_BV(6); };
  inline static void resetSS()   { PORTB |=  _BV(6); };
#elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB162__)
  inline static void initSS()    { DDRB  |=  _BV(0); };
  inline static void setSS()     { PORTB &= ~_BV(0); };
  inline static void resetSS()   { PORTB |=  _BV(0); };
#else
  inline static void initSS()    { DDRB  |=  _BV(2); };
  inline static void setSS()     { PORTB &= ~_BV(2); };
  inline static void resetSS()   { PORTB |=  _BV(2); };
#endif

Note the top line - refers to the 1280 and 2560 as using Port B4 for SS - well, so does the 1284 and I'm reasonably sure the 644 does as well.  So surely that top line should say this.

private:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284P__)  || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega644P__)  || defined(__AVR_ATmega644__)

Certainly I do many projects using Ethernet and the 1284p chip and I can't remember when but some time ago I added this to the 1.05 library and I've now just updated the 1.57 version (as well as adding "Mighty 1284p using Optiboot" support).

Is anyone aware of other libraries or other parts of the Ethernet library that should also have similar upates?
Regards

Peter Scargill
http://tech.scargill.net

Go Up