hello,
i am trying to interface W5500 with TI’s tms320f28335.
I did all the initialisations as per the data sheet. And tried to read back the Version register but am getting wrong values every time.
The initialisation code and the Data transmittind command is as shown.
void spi_init()
{
SpiaRegs.SPICCR.all =0x0007; // Reset on, falling edge, 8-bit char bits
SpiaRegs.SPICTL.all =0x00E; // Enable master mode, normal phase,
// enable talk, and SPI int disabled.
SpiaRegs.SPIBRR =0x001F;
SpiaRegs.SPICCR.all =0x0087; // Relinquish SPI from Reset
SpiaRegs.SPIPRI.bit.FREE = 1; // Set so breakpoints don’t disturb xmission
}
void_sendFrame
{
GpioDataRegs.GPBCLEAR.bit.GPIO57 = 1;
sdata = 0x00;
spi_xmit(sdata);
I am getting the version register value as
0x01 on the first try
0x02 on the second and
0x03 on the third.
and 0x04 on the 4rth…
i have read in this forum that sending 0x01 , 0x02, 0x03, is normal behaviour.
but why 0x28 unsted of 0x04.
midnightcow,
Really thanks for the help sir,
With that above code the data was not being send for some reason i dont know.
Now i changed the code for transmitting part as mentioned below.
Am reading the version register correctly now,
But i have some doubt.
I got the the value 0x04 on the 4th read only.
So this happens for every other register?
That this dummy byte of 0x01 0x02 0x03 comes?