Hello,
I am using a 28069 that is connected via SPI to a Winbond W25Q80BV (serial FLASH).
http://www.adafruit.com/datasheets/W25Q80BV.pdf
I am having issues communicating with the device. I am currently just trying to read back the Manufacturer and Device ID via command 90h.
The instruction is initiated by driving the /CS pin low and shifting the instruction “90h” followed by a 24-bit address of 000000h. After which, the Manufacturer ID for Winbond (EFh) and the Device ID (13h) are shifted out on the falling edge of CLK with the MSB first:
NOTE: The device supports SPI modes 0 and 3.
I am configuring for SPI mode 0:
SpiaRegs.SPICCR.all = 0x0007; // Reset on, rising edge, 8-bit char bits
SpiaRegs.SPICTL.all = 0x0006; // Enable master mode, normal phase,
SpiaRegs.SPIBRR = 0x13; // baud rate is 1MHZ
SpiaRegs.SPICCR.all = 0x0087; // Relinquish SPI from Reset
SpiaRegs.SPIPRI.bit.FREE = 1; // Set so breakpoints don't disturb xmission
Also since I need /CS to stay low for multiple byte transfers I configure GPIO 19 (SPISTEA) as a GPIO and "manually" set it low during transfers.
I am doing the transfer as follows:
buffer[0] = 0x9000; // uses MSB
buffer[1] = 0x0000; // uses MSB
len = 6;
GpioDataRegs.GPACLEAR.bit.GPIO19 = 1;
for(jj=0; jj<len; jj++)
{
SpiaRegs.SPITXBUF = buffer[jj];
while(SpiaRegs.SPIFFRX.bit.RXFFST !=1) { }
rdata[jj] = SpiaRegs.SPIRXBUF;
}
GpioDataRegs.GPASET.bit.GPIO19 = 1;
What I see with a scope is the following:
The top signal is the /CS. The middle signal is the CLK running at 1 MHZ. There are a total of (8 *6) 48 CLK pulses. The bottom signal is the MOSI data.
A close up of the data being sent is:
To me this looks correct:
FIRST BYTE=> 0x90 => 1001 0000
SECOND BYTE => 0x00 => 0000 0000
THIRD BYTE => 0x00 => 0000 0000
FOURTH BYTE => 0x00 => 0000 0000
FIFTH BYTE => 0x00 => 0000 0000
SIXTH BYTE => 0x00 => 0000 0000
All I read back are 0xFF.
Any insight or what I might be able to check would be greatly appreciated.
Thanks,
Brent W.



