Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi,
I am using the MCSPI to control the gyroscope. Based on the datasheet of gyroscope, when the SOC send a single frame ‘0xF5’ the gyro will respond with a single frame '0xFA'. The above process is feasible based on our test. However, when we try to send multi-frame via SPI, the gyro cannot respond normally and it only respond with '0x00'. I try to change the 'MCSPI_ChConfig.csIdleTime' to expand the interval for CS signal but it did not work.
I used logic analyzer to catch the wave and attached it below. The red line refers to single frame part and the green line refers to mutli-frame part.
I also attach the sysconfig configuration for spi channel.
The spi transfer code is shown below.
uint16_t spitxbuffer[5]; uint16_t spirxbuffer[5]; MCSPI_Transaction spiTransaction; int32_t transferOK; MCSPI_Transaction_init(&spiTransaction); spiTransaction.channel = gConfigMcspi0ChCfg[0].chNum; spiTransaction.dataSize = 16; spiTransaction.csDisable = FALSE; spiTransaction.count = 5; spiTransaction.txBuf = spiTxBuffer; spiTransaction.rxBuf = spiRxBuffer; spiTransaction.args = NULL; transferOK = MCSPI_transfer(gMcspiHandle[CONFIG_MCSPI0], &spiTransaction);
BR,
Bomiao