Other Parts Discussed in Thread: HALCOGEN
Tool/software:
Hi,
I'm trying to read data from a SPI flash using the SPI4 peripheral.
When controling the CS manually (with a gpio) everything is working well. But when I let the SPI4 peripheral control the gpio, I can't get a valid reading.
A simple example would be the JEDEC ID command:
spiBASE_t *base = spiREG4;
spiDAT1_t data_format = {.CS_HOLD = true,
.WDEL = true,
.DFSEL = SPI_FMT_0,
.CSNR = SPI_CS_0};
uint16_t tx[10] = {JDEC_COMMAND};
uint16_t rx[10] = {0};
spiTransmitData(base, &data_format, 1, tx);
spiReceiveData(base, &data_format, 4, rx);
I suspect that the problems is that the CS is reset in between the Transmit and Receive operation.
How can I make sure CS is kept low?
Please note that I can't use spiTransmitAndReceiveData because I don't want to receive at the same time that I transmit.
Regards,
Gabriel
