Did you have any luck with this in the end?
I have just received the prototype boards back from the printer and have populated them, and am now just attempting to get some test code working for the Wiznet module.
I dont have the exact computer setup I had when I did my first test, so I have started again with IDE 22.
I have downloaded the arduino-extras zip file that Mark S produced on his website (www.avr-developers.com) as that has the core files for the 644P.
I compared them against the Sanguino files and there are decrepencies. I couldnt even get the Sanguino core files to compile the Ethernet library.
I then looked in the pins_arduino.h (and .c) files, and found there was no reference to the MISO, MOSI, CSK, SS for the 644P configuration, as it looks like the SPI library uses these variable declarations.
here are some examples:
In the SPI library, it has the following code:
void SPIClass::begin() {
// Set direction register for SCK and MOSI pin.
// MISO pin automatically overrides to INPUT.
// When the SS pin is set as OUTPUT, it can be used as
// a general purpose output port (it doesn't influence
// SPI operations).
pinMode(SCK, OUTPUT);
pinMode(MOSI, OUTPUT);
pinMode(SS, OUTPUT);
digitalWrite(SCK, LOW);
digitalWrite(MOSI, LOW);
digitalWrite(SS, HIGH);
It refers to the SCK, MOSI and SS variables.
I then looked in the pins_arduino files in the modified core files from Mark S, and found this entry in the pins_arduino.h file:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
const static uint8_t SS = 53;
const static uint8_t MOSI = 51;
const static uint8_t MISO = 50;
const static uint8_t SCK = 52;
#else
const static uint8_t SS = 10;
const static uint8_t MOSI = 11;
const static uint8_t MISO = 12;
const static uint8_t SCK = 13;
#endif
It didn't have any listing for the 644P.
I added in this part, however still no joy:
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__)
const static uint8_t SS = 30;
const static uint8_t MOSI = 5;
const static uint8_t MISO = 6;
const static uint8_t SCK = 7;
SS = 30 above is how I have the Ethernet Board wired in my setup. Very crude way to do it, as all SPI devices would therefore use this, however I dont see the SPI library as being very accomidating for this anyway, as the SS is hardcoded inside the library. I am not experienced enough to know the best method to make the SPI library suitable for using multiple SPI devices at once.
Either way, I have hard coded my SS to be 30 at the moment, so I am guessing that the SPI library will therefore use this value of 30.
But as mentioned, still no joy yet.
I really cannot recall how I got it working when I did my first testing, and am now actually starting to doubt if I did infact carry out this testing on the 644P...
My memory is quite poor.
If anyone has any input I would love to hear.
I have already emailed Mark to see if he can assist.
Thanks