This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P: MCSPI multi-frame transmit with wrong receive

Part Number: AM62P
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

  • Hi,

    Thank you for attaching the supporting configurations and the code snippet, this helps a lot.

    I see there is nothing wrong with the SysConfig configuration and the code snippet which you attached.

    So lets clarify few things first up since I do not know about the exact Peripheral which you are using.

    Please answer the following:

    When sending in a single frame to the Peripheral, what are the expected values?

    F5h sent then we receive FAh from Gyro

    F2h sent then we receive a from Gyro

    F3h sent then we receive b from Gyro

    F4h sent then we receive c from Gyro

    6Bh sent then we receive d from Gyro

    If expected value is a 8 bit value, please try single frame for all the values above and see if the expected values are shown and then switch to sending multiple frames, if that is supported by the Peripheral.

    Thanks,

    Vaibhav