Other Parts Discussed in Thread: C2000WARE
Hello,
I'm having problems utilizing the driverlib SPI on the TMS320F280049 processor to communicate with an external serial NOR flash memory. I'm seeing data written returned with the same data shifted left by 8 bits even though I have disabled loopback. Can anyone help me identify what could be going wrong here?
My settings utilize the SCI-B interface
#define SPI_SIMO_PIN 56
#define SPI_SOMI_PIN 57
#define SPI_CLOCK_PIN 32
#define SPI_ENABLE_PIN 27
With all the pins configured as necessary for SPI use.
Baud rate set to LSPCLK frequency /4.
Bit rate set to 500000.
Data length set to 8.
SPI set to rising edge without delay, SPI_PROT_POLOPHA0.
Set to master mode.
Note, I don't use the FIFO, have the loopback disabled, and set the emulation mode to free run.
Highspeed and DMA are not used.
My SPI setup function calls
1) SPI_disableModule
2) SPI_setConfig
3) SPI_disableLoopback
4) SPI_setEmulationMode
5) then SPI_enableModule
My SPI transmission function:
1) Turns on the chip select (pin low)
2) Loops through the data message. SPI_writeDataNonBlocking then SPI_readDataBlockingNonFIFO until data is sent/readback.
3) Turns off the chip select (pin high)
My test includes sending a message to read the manufacturer's ID using this message
uint16_t outIdData[20] =
{0x9F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00};
This is what I see returned (as seen in watch):
inIdData unsigned int[20] [0x9FFF,0x00FF,0x00FF,0x00FF,0x00FF...] (Hex) 0x0000B028@Data
[0] unsigned int 0x9FFF (Hex) 0x0000B028@Data
[1] unsigned int 0x00FF (Hex) 0x0000B029@Data
[2] unsigned int 0x00FF (Hex) 0x0000B02A@Data
[3] unsigned int 0x00FF (Hex) 0x0000B02B@Data
[4] unsigned int 0x00FF (Hex) 0x0000B02C@Data
[5] unsigned int 0x00FF (Hex) 0x0000B02D@Data
[6] unsigned int 0x00FF (Hex) 0x0000B02E@Data
[7] unsigned int 0x00FF (Hex) 0x0000B02F@Data
[8] unsigned int 0x00FF (Hex) 0x0000B030@Data
[9] unsigned int 0x00FF (Hex) 0x0000B031@Data
[10] unsigned int 0x00FF (Hex) 0x0000B032@Data
[11] unsigned int 0x00FF (Hex) 0x0000B033@Data
[12] unsigned int 0x00FF (Hex) 0x0000B034@Data
[13] unsigned int 0x00FF (Hex) 0x0000B035@Data
[14] unsigned int 0x00FF (Hex) 0x0000B036@Data
[15] unsigned int 0x00FF (Hex) 0x0000B037@Data
[16] unsigned int 0x00FF (Hex) 0x0000B038@Data
[17] unsigned int 0x00FF (Hex) 0x0000B039@Data
[18] unsigned int 0x00FF (Hex) 0x0000B03A@Data
[19] unsigned int 0x00FF (Hex) 0x0000B03B@Data
Here is the SPIB register values:
SPICCR 0x0087 SPI Configuration Control Register [Memory Mapped]
SPICTL 0x0006 SPI Operation Control Register [Memory Mapped]
SPISTS 0x0000 SPI Status Register [Memory Mapped]
SPIBRR 0x000B SPI Baud Rate Register [Memory Mapped]
SPIRXEMU 0x00FF SPI Emulation Buffer Register [Memory Mapped]
SPIRXBUF 0x00FF SPI Serial Input Buffer Register [Memory Mapped]
SPITXBUF 0x0000 SPI Serial Output Buffer Register [Memory Mapped]
SPIDAT 0x00FF SPI Serial Data Register [Memory Mapped]
SPIFFTX 0xA000 SPI FIFO Transmit Register [Memory Mapped]
SPIFFRX 0x201F SPI FIFO Receive Register [Memory Mapped]
SPIFFCT 0x0000 SPI FIFO Control Register [Memory Mapped]
SPIPRI 0x0010 SPI Priority Control Register [Memory Mapped]
Thanks in advance,
-Wes






