Post by rhyssman on Apr 6, 2016 13:00:02 GMT
Hi Everyone
I'd am pleased to report that I have successfully implemented version 2.4 of the gateway node using a Mega 2560 board (Inhaos type) for 3.3V compatibility. I wanted to be able to add more devices to the gateway including onewire temperature devices. As memory usage is very tight on the UNO I needed more!
A couple of notes on the modifications needed to get this working.
Mega uses different pinouts for SPI. as per standard arduino documentation. So the RFM69 will need to be connected to the following pins
MOSI = 51
MISO = 50
SCK = 52
SS (Slave Select) I Chose Pin 49 as it was close however it could remain at pin 10 per the example. I did try 53 like the Arduino documentation and couldnt get it to work but in hindsight it may have been due to other reasons. I will have to try that.
Make sure you also update your Slave pin in the Gateway code.
Interrupt remains at Pin 2. It could be moved to get it clear of th
The w5100.h modification of for interrupts also needs to be expanded to cover the Mega
sample from w5100.h
If anyone has any questions on the setup feel free to ask.
Thankyou to all the people who continue to contribute to this community.
Rhyssman
I'd am pleased to report that I have successfully implemented version 2.4 of the gateway node using a Mega 2560 board (Inhaos type) for 3.3V compatibility. I wanted to be able to add more devices to the gateway including onewire temperature devices. As memory usage is very tight on the UNO I needed more!
A couple of notes on the modifications needed to get this working.
Mega uses different pinouts for SPI. as per standard arduino documentation. So the RFM69 will need to be connected to the following pins
MOSI = 51
MISO = 50
SCK = 52
SS (Slave Select) I Chose Pin 49 as it was close however it could remain at pin 10 per the example. I did try 53 like the Arduino documentation and couldnt get it to work but in hindsight it may have been due to other reasons. I will have to try that.
Make sure you also update your Slave pin in the Gateway code.
#define RFM_SS 49 // Slave Select RFM69 is connected to pin 49
Interrupt remains at Pin 2. It could be moved to get it clear of th
The w5100.h modification of for interrupts also needs to be expanded to cover the Mega
sample from w5100.h
#if defined(ARDUINO_ARCH_AVR)
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
inline static void initSS() { DDRB |= _BV(4); };
inline static void setSS() { cli(); PORTB &= ~_BV(4); }; //modified from http://harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip
inline static void resetSS() { PORTB |= _BV(4); sei(); }; //modified from http://harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip
#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() { cli(); PORTB &= ~_BV(2); }; //modified from http://harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip
inline static void resetSS() { PORTB |= _BV(2); sei(); }; //modified from http://harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip
#endif
If anyone has any questions on the setup feel free to ask.
Thankyou to all the people who continue to contribute to this community.
Rhyssman