Part Number: TMS570LS3137
Hello,
I am working with SPI interface to comunícate with an external RAM memory. However, some pulses are missed in the clock signal. I attach a picture of it:
I configured WDEL = 0 and and CSHOLD = 1 to avoid this problem but the issue persists.
void writeFRAM(uint8 Ad2, uint8 Ad1, uint8 Ad0, uint8 dat)
{
spiDAT1_t dataconfig1_t;
dataconfig1_t.CS_HOLD = 1; // The chip select signal is deactivated at the end of a transfer after the T2CDELAY time has passed.
dataconfig1_t.WDEL = 0; // After a transaction, WDELAY of the corresponding data format will be loaded into the delay counter.
dataconfig1_t.DFSEL = SPI_FMT_0; // Data word format 0 is selected.
dataconfig1_t.CSNR = 0xFE; // Chip select (CS) number.
const uint16 WREN = 0x06; //WREN: Write enable command.
const uint16 WRITE = 0x02; //WRITE: Write command.
uint16 TX_Data_Master[5] = {WRITE, Ad2, Ad1, Ad0, dat}; //Set write command and direction in the output buffer.
spiTransmitData(spiREG3, &dataconfig1_t, 1, (uint16*)&WREN); //WREN command to enable writing operations.
spiTransmitData(spiREG3, &dataconfig1_t, 5, TX_Data_Master); //WREN command to enable writing operations.
}
uint8 readFRAM(uint8 Ad2, uint8 Ad1, uint8 Ad0)
{
spiDAT1_t dataconfig1_t;
dataconfig1_t.CS_HOLD = 1; // The chip select signal is deactivated at the end of a transfer after the T2CDELAY time has passed.
dataconfig1_t.WDEL = 0; // After a transaction, WDELAY of the corresponding data format will be loaded into the delay counter.
dataconfig1_t.DFSEL = SPI_FMT_0; // Data word format 0 is selected.
dataconfig1_t.CSNR = 0xFE; // Chip select (CS) number.
const uint16 READ = 0x03; //READ: Command to read an specific external memory location.
uint16 TX_Data_Master[4] = {READ, Ad2, Ad1, Ad0}; //Set read command and direction in the output buffer.
uint8 data = 0;
spiTransmitData(spiREG3, &dataconfig1_t, 4, TX_Data_Master); //WREN command to enable writing operations.
spiReceiveData(spiREG3, &dataconfig1_t, 1, (uint16 *) data);
return data;
}
Thank you and regards,
Leandro
