I am trying to change the SS pin for the ethernet library as I have a Wiznet 5100 module which aligns correctly with the other three pins (MISO, MOSI & SCLK) but connects its SS pin to theArduino digital pin 4 on a custom board.
I have seen other posts such as, http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227719581 however they refer to changes the pins within the same port.
I need to change the SS pin from digital pin 10 to digital pin 4. This involves changing the port from port B to port D.
I gather I would change this code (in Spi.h) from:
#define SPI0_SS_BIT BIT2
#define SPI0_SS_DDR DDRB
#define SPI0_SS_PORT PORTB
to
#define SPI0_SS_BIT BIT4
#define SPI0_SS_DDR DDRD
#define SPI0_SS_PORT PORTD
If I change these do I also have to change the CS entry which shares the same definition?
#define IINCHIP_CS_BIT BIT2
#define IINCHIP_CS_DDR DDRB
#define IINCHIP_CS_PORT PORTB
do I have to change any of the following as it seems to refer to SS:
#define SPI0_Init() DDRB |=SPI0_SS_BIT|SPI0_SCLK_BIT|SPI0_MOSI_BIT;\
PORTB |= SPI0_SS_BIT; PORTB &= (SPI0_SCLK_BIT|SPI0_MOSI_BIT);\
SPCR = 0x50