EtherMega and other SPI devices

Combining the power of the ATmega2560 MCU with onboard Ethernet, a microSD card slot, an efficient switchmode power supply, and a small prototyping area. [Product page]
Post Reply
dBc
Posts: 7
Joined: Sun May 20, 2012 10:46 pm

EtherMega and other SPI devices

Post by dBc » Mon Nov 12, 2012 12:21 am

I've found several references claiming that the W5100 can share the SPI with other devices, particularly on Freetronics Ether products, because they obey SS better than the stock ether shields. That sounds good on the h/w side.

But having a poke around in the standard Ethernet/W5100 library code, I'm having trouble understanding how it works on the s/w side. I can't currently find anywhere that they configure all the SPI details (clock divider, data mode, MSB/LSB-first etc). Perhaps the W5100 works fine with the AVR defaults?

Meanwhile, if I have another SPI device that has specific requirements for those various settings, I don't see how I can set them, without messing up the W5100. All the SPI routines, like setDataMode() for example, appear to bang directly on the AVR h/w registers.

Do I need to set them up before each transfer to my device, and then return them to their previous settings when I'm done, so the Ethernet stuff keeps working?

Post Reply