I write below instruction to start working with mcspi on beaglebone black.
//Enable SPI0 Clock
SPI0_CLK= ON;
//Disable Channel
MCSPI_CH0CTRL =0x00000000;
//set Master Mode
MCSPI0_MODULCTRL=0x00000000;
//Reset IRQ status and Enable IRQ
MCSPI_IRQSTATUS =0x00000000;
MCSPI_IRQENABLE =0xFFFFFFFF;
//D0 output and D1 input
MCSPI_SYST |= 0x00000200;
//Config channel0
MCSPI_CH0CONF =0x000607D7;
//Start the channel
MCSPI_CH0CTRL =0x00000001;
//Write in Tx buffer
MCSPI_TX0=0xaa;
//Check If EOT set.
while (((MCSPI_CH0STAT & 0x00000004)>>2) == 0);
//Check If RXS set.
while ((MCSPI_CH0STAT & 0x00000001) == 0);
//Read received data
result=MCSPI_RX0;
//Disable SPI0 clcok
SPI0_CLK = OFF;
also i set below configuration for spi pins in Device Tree:
0x150 0x10 /* spi0_sclk, OUTPUT_PULLUP | MODE0 */
0x154 0x10 /* spi0_d0, OUTPUT_PULLUP | MODE0 */
0x158 0x30 /* spi0_d1, InPUT_PULLUP | MODE0 */
0x15c 0x10 /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
But the data that i read from MCSPI_RX0 register is zero. For testing i
connect SPI0_D1 pin to VCC on board, therefore i must get all ones in
result but the result is zeros still. Also i connect SPI0_D0 and SPI0_D1 on
board , therefore i must receive 0xaa on result but it's still zero.
I connect Logic Analyzer to CS0,CLK and SPI0_D0 pins and show in below
image.
[image: Capture.PNG]
As you can see CLK frequency change during communication , but CS works
fine and D0 has some invalid data instead of 0xaa.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/09e390bf-b966-46eb-bbd3-d732b6a86850%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.