Ok, thanks
MorganS, what is the basis of the special SPI SS pins support (how does it work) ?
It seems that it possible to use more than 3 SPI devices because I have now started to test my new Due with a multifont display (NHD-2.7-12864UMY3) and a WIZ820io module, and I got a display working with HW SPi using:
pin 31 as SS for display (not pin 4, 10 or 52).
pin 45 as SS for Multifont (not pin 4, 10 or 52).
pin 10 as SS for WIZ820io.
But I found a problem when I using the Multifont functionality, the WIZ820io stops working. But normal ascii character still works. Maybe someone can help me with this?
I looking with a oscilloscope I see that the SS (pin10) for the WIZ820io never goes high, always low.
That is weird, I see that the pin 31 goes low and allow print characters on the display but the WIZ still is low, and the Ethernet communication seems to work (maybe it is just to short time to interfere with the Ethernet).
I think this it is just a coincidence that the WIZ still works, I think it is because of short time/fast writing.
Anyone know why the pin 10 never goes high, when using the other SPI devices?
I using U8GLIB_NHD27OLED_2X_BW libraries for normal ascii display printing.
Here is the code for mutifont, maybe the problem is here?:
#define SLAVESELECT_MFD 45
void WriteTopMultiFont(long* Addres){ // Chinese characters for Top half of Display
column = 0;
row = 6;
for(unsigned int j = 0; j < sizeof(taddress)/4;j++){
byte adress[3];
SPI.beginTransaction(SPI_DISPLAY_SETTINGS);
digitalWrite(SLAVESELECT_MFD, LOW);
SPI.transfer(SLAVESELECT_MFD, 0x0B); //READ command
for(int i=2;i>=0;i--){
adress[i] = ((Addres[j] >>(8*i)) & 0xFF);
SPI.transfer(SLAVESELECT_MFD, adress[i]); //Address Bytes 1 to 3
}
SPI.transfer(SLAVESELECT_MFD, 0xFF); //Dummy Byte
for(unsigned int i= 0;i<32;i++){
buffer[i]=SPI.transfer(SLAVESELECT_MFD, 0); //read dot-matrix font data
}
digitalWrite(SLAVESELECT_MFD, HIGH);
SPI.endTransaction();
if(adress[0]!=0x00){
if(counter<sizeof(ttext)/2){
for(unsigned int i= 0;i<sizeof(buffer)/2;i++){
for(unsigned int j=0;j<8;j++)
{
//getKeypress();
if(bitRead(buffer[i],j)) u8g.drawPixel(column+i,row+j);
}
}
for(unsigned int i= 16;i<sizeof(buffer);i++)
{
for(unsigned int j=0;j<8;j++)
{
//getKeypress();
if(bitRead(buffer[i],j)) u8g.drawPixel(column+i-16,row+j+8);
}
}
counter++;
column+=22;
}
}
else {column +=40;}
}
counter = 0;
row = 0;
memset(buffer,0x00,sizeof(buffer));
}