eng.hasan.power
Member level 1
ciao Tutti,
im trying to get the string from the SPI,
i have 97J60 Ethernet Controller, working as a SPI Slave,
now im trying to get the string, from the Master, then send it to the UART, for testing,
here is my Code,
int Receive(void)
{
char tempSPI1[1]; // This is our received byte.
int tempSPI;
OpenSPI1(SLV_SSOFF, MODE_00, SMPEND); //hasan
getsSPI1(tempSPI1, 1); // Read buffer
DelayMs(50);
putsUART(tempSPI1);
DelayMs(50);
CloseSPI1(); // Disable the MSSP
putrsUART(" received somthing ");
CloseSPI1(); // Disable the MSSP
}
the problem is,
when i send 0xEE i receive string "f" ,,,which represent 0x66 not 0xEE
when i send 0x00 i receive nothing,,,,when i receive 0x0A i receive nothing too,,,
when i send 0xF0 i receive p ,, which is false too,,,,,,
i dont know where is the problem,
im sure about the master, i can see it clearly with the Oscilloscope,
thanks in Advance, Regards
Hasan
im trying to get the string from the SPI,
i have 97J60 Ethernet Controller, working as a SPI Slave,
now im trying to get the string, from the Master, then send it to the UART, for testing,
here is my Code,
int Receive(void)
{
char tempSPI1[1]; // This is our received byte.
int tempSPI;
OpenSPI1(SLV_SSOFF, MODE_00, SMPEND); //hasan
getsSPI1(tempSPI1, 1); // Read buffer
DelayMs(50);
putsUART(tempSPI1);
DelayMs(50);
CloseSPI1(); // Disable the MSSP
putrsUART(" received somthing ");
CloseSPI1(); // Disable the MSSP
}
the problem is,
when i send 0xEE i receive string "f" ,,,which represent 0x66 not 0xEE
when i send 0x00 i receive nothing,,,,when i receive 0x0A i receive nothing too,,,
when i send 0xF0 i receive p ,, which is false too,,,,,,
i dont know where is the problem,
im sure about the master, i can see it clearly with the Oscilloscope,
thanks in Advance, Regards
Hasan