Arduino Forum

Using Arduino => Programming Questions => Topic started by: LuisSoares on Dec 17, 2012, 05:06 pm

Title: Ethernet Standard CS modification
Post by: LuisSoares on Dec 17, 2012, 05:06 pm
Hi,

I am using a Mega2560 with a board redesign and i wanted to change the standard chip select pin 10 to another pin.

Where on the Ethernet library can i do this?

Thanks
Title: Re: Ethernet Standard CS modification
Post by: MarkT on Dec 17, 2012, 06:32 pm
Which library, which ethernet shield?
Title: Re: Ethernet Standard CS modification
Post by: LuisSoares on Dec 17, 2012, 07:20 pm
Hi,

The Arduino Ethernet Shield and respective library (Ethernet.h).
Title: Re: Ethernet Standard CS modification
Post by: LuisSoares on Dec 18, 2012, 11:40 am
Hi,

In the case of Arduino UNO the SShardware pin is used for selecting the W5100 chip to comunicate.

In the case of the Arduino Mega the PB4 (pin 10) pin is used to select the W5100 chip to comunicate.

In the Mega case i cannot find the reference in the core Ethernet library to the PB4 (pin10). I need to find this or the way they do this so i can modify this port and use the one in my specific design.

Does anyone know?
Title: Re: Ethernet Standard CS modification
Post by: MarkT on Dec 18, 2012, 11:01 pm
<your install>/libararies/Ethernet/utililty/ws100.h has the relevant code I think, the macros
initSS, setSS and resetSS use direct port manipulation.

Create a copy of the Ethernet library, rename the class and alter those macros?  Doesn't look as simple
to do as it ought to be alas.
Title: Re: Ethernet Standard CS modification
Post by: LuisSoares on Dec 20, 2012, 12:14 pm
Perfect.

Thanks MarkT

I tested it and it worked.

I tried to find it myself, but seems like lacked the persistence :)