I am having trouble using the ECSPI from the Cortex-M4 of the i.MX8MM with the functions available in fsl_ecspi.c.
Eventually, I need to communicate with complex ADC and DAC devices. To try and simplify things to prove the interface I have gone back to an SPI flash device and trying to read the manufacturer ID. The flash data sheet shows the following diagram:
Looking at the SPI bus on a logic analyser I don't ever seem to see any data coming from the device. I appear to have 4 bytes being written to the slave device and the CS# going high then low between each byte being sent.
The setup of the ESCPI controller is as per the SDK sample:
/* Master config:
* masterConfig.channel = kECSPI_Channel0;
* masterConfig.burstLength = 8;
* masterConfig.samplePeriodClock = kECSPI_spiClock;
* masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;
* masterConfig.chipSelectDelay = 0;
* masterConfig.samplePeriod = 0;
* masterConfig.txFifoThreshold = 1;
* masterConfig.rxFifoThreshold = 0;
*/
ECSPI_MasterGetDefaultConfig(&masterConfig);
masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;
ECSPI_MasterInit(EXAMPLE_ECSPI_MASTER_BASEADDR, &masterConfig, ECSPI_MASTER_CLK_FREQ);
Anyone got any ideas how I make this work?
-Andy.