Hi,
I am trying to use OMAP-L138/C6748 development kit SPI0 (on ARM core) to communicate with external device (connected on J15 of OMAP L138 dev board).
The OMAP is setup to use 4pin master mode (with CS4 used for SPI0), sending out SPI data at bit rate of 1Mb/s and the slave device responds with expected byte,
I originally used the example loop-back code and modified it to communicate with external device.
but SPIBUF register in OMAP is not updating as per the response I see on SOMI line, the value of this register in debug register view is 0 and reading the register returns 0x00.
Setup:
- I am using TI-RTOS and its example code as startup guide and modified it.
- I can confirm SPI_CLK, SIMO and SOMI states by checking these signals on oscilloscope. please check the waveform image (yellow trace is SPI_CLK and pink one is response back from slave device on SOMI).
- I have updated the PINMUX3 as per SPI0 4Pin mode requirements. I have attached code snippet here, after this code execution the PINMUX3 value = 0x88141181.
-------------------------------------------------------------------------------------------------------
hSysCfg->PINMUX3 &= (~(
// CSL_SYSCFG_PINMUX3_PINMUX3_31_28_MASK | not used
// CSL_SYSCFG_PINMUX3_PINMUX3_27_24_MASK | not used
CSL_SYSCFG_PINMUX3_PINMUX3_23_20_MASK | // SPI0 used
CSL_SYSCFG_PINMUX3_PINMUX3_19_16_MASK | // GPIO used for Enable
CSL_SYSCFG_PINMUX3_PINMUX3_15_12_MASK | // SPI0 used
CSL_SYSCFG_PINMUX3_PINMUX3_11_8_MASK | // SPI0 used 0
// CSL_SYSCFG_PINMUX3_PINMUX3_7_4_MASK | not used
CSL_SYSCFG_PINMUX3_PINMUX3_3_0_MASK) // SPI0 used
);
hSysCfg->PINMUX3 |= ((CSL_SYSCFG_PINMUX3_PINMUX3_23_20_SPI0_SCS4 << CSL_SYSCFG_PINMUX3_PINMUX3_23_20_SHIFT) |
(CSL_SYSCFG_PINMUX3_PINMUX3_19_16_GPIO8_4 << CSL_SYSCFG_PINMUX3_PINMUX3_19_16_SHIFT) |
(CSL_SYSCFG_PINMUX3_PINMUX3_15_12_SPI0_SIMO << CSL_SYSCFG_PINMUX3_PINMUX3_15_12_SHIFT) |
(CSL_SYSCFG_PINMUX3_PINMUX3_11_8_SPI0_SOMI << CSL_SYSCFG_PINMUX3_PINMUX3_11_8_SHIFT) |
CSL_SYSCFG_PINMUX3_PINMUX3_3_0_SPI0_CLK
);
-------------------------------------------------------------------------------------------------------
- SPIPC0 register fields reflects the setting that I wish to work with, i.e. SPI pin functions for CLK, SIMO, SOMI and SCSFUN[4] are true.
SPIPC0 = 0x01010E10
- R214, R215, R216 were not populated on dev kit, I installed these resistors as well, so SPI0 pins are connected to J15 of the board (where we have connected the slave device and also tapping the signals for oscilloscope).
- also confirmed R275 (pull up) is available on LCDK board.
Can somebody please help me identify what could be the problem that I am not receiving the data available at SOMI pin in my SPIBUF register?
Thanks,