Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hello All,
We have configured McSPI3 as shown below in our "platform_tda2xx_pad_config.c" file in PSDK 03.03,
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR8, //SCLK
0xc0003);
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR9, //MOSI
0xc0003);
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR10, //MISO
0xc0003);
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR11, //CS0-Acceleromter
0x60003);
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR12, //CS1-Gyro
0x60003);
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR7, //Accel INT
(0x60000U | CTRL_CORE_PAD_MCASP1_AXR7_MCASP1_AXR7_MUXMODE_GPIO5_9_14));
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR3, //Gyro INT
(0x60000U | CTRL_CORE_PAD_MCASP1_AXR3_MCASP1_AXR3_MUXMODE_GPIO5_5_14));
And we have also read the control pad registers on CCS memory browsers and we got the same values as was set from the above code.
We have Accelerometer Gyroscope combo chip connected on our custom TDA2P board over McSPI3. Both Accelero and gyro have different chip select pins. So we have used MCSPI in Multichannel mode by setting :
==> "mcspiPrms.spiHWCfgData.singleOrMultiChEnable = MCSPI_MULTI_CHANNEL". &
==> channel 0 & 1 for accel & gyro respectively . For example,
mcspiPrms.spiHWCfgData.configChfmt[0] -------- For Accelero
mcspiPrms.spiHWCfgData.configChfmt[1] -------- For Gyro
We debugged our code and found out that, when we execute following,
"mcspiHandle_gyro = GIO_create("/mcspi2", GIO_INOUT, &ioParams, &eb);"
we get below error,
"
*ERROR* Line: 276, File: src/bsp_mcspi.c - SPIEN hold (FORCE bit) is invalid in MULTI channel mode,cannot open the channel
ti.sysbios.io.GIO: line 253: ti.sysbios.io.GIO: line 253: E_createFailed: mdCreateChan returned error -1
"
Can anyone suggest how can we make MULTI_CHANNEL mode work.
Thanks,
Abhay