I am trying to connect touchscreen controller with OMAP 3530 over SPI.
Can anyone send some code samples that include SPI configuration, PAD Configuration and to test SPI in loopback mode.
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.
I am trying to connect touchscreen controller with OMAP 3530 over SPI.
Can anyone send some code samples that include SPI configuration, PAD Configuration and to test SPI in loopback mode.
Srinivas
Attached is a low level example which setups SPI2 (or SPI1) as a master transmitter/receiver. There is an option to enable a loopback mode.
I used Code Composer to compile and download via JTAG to the OMAP3530 EVM which was booted to the uboot prompt.
Paul
Done following pad configuration: INPUT_ENABLE (1 << 8) CONTROL_PADCONF_MCSPI2_CLK = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
PULL_INACTIVE (0 << 3)
MUX_MODE_0 (0 << 0)
/*MCSPI2_CLK*/
CONTROL_PADCONF_MCSPI2_SIMO = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
/*MCSPI2_SIMO*/
CONTROL_PADCONF_MCSPI2_SOMI = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
/*MCSPI2_SOMI*/
CONTROL_PADCONF_MCSPI2_CS0 = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
/*MCSPI2_CS0*/
Is this OK?
INPUT_ENABLE (1 << 8)
PULL_INACTIVE (0 << 3)
MUX_MODE_0 (0 << 0)
These are correct for the lower half word of the padconf register. The padconf register contains configurations for two pins so the upper half word would be left shifted by and additional 16 bits. Also, MUX_MODE is a 3 bit field.
CONTROL_PADCONF_MCSPI2_CLK = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
Settings are correct but this pad configuration is in the upper word [31:16].
CONTROL_PADCONF_MCSPI2_SIMO = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
There is no need to enable the input for this pad unless you want to do the loopback configuration.
CONTROL_PADCONF_MCSPI2_SOMI = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
Settings are correct but this pad but this pad configuration is in the upper word [31:16].
CONTROL_PADCONF_MCSPI2_CS0 = (INPUT_ENABLE | PULL_INACTIVE | MUX_MODE_0);
No need to have the input enabled for CS, otherwise ok.
For the above, I'm assuming that this is for master mode setup.
Paul