Other Parts Discussed in Thread: SYSCONFIG
Tool/software: Linux
Hi,
I am using BBB.
I am trying to write a value directly in the register to control mcSPI, not through the spi library.
But no matter how I change the value, I can't send the correct CLK signal.
I wrote a program through the SPI library, it works fine, I used config-pin to change the pin-mode, so I think I should have no errors in the pinmux settings.
Here is the simple program I wrote. I used devmem2 to write value in register.
CM_PER_SPI1_CLKCTRL 0x2 //enable clk
MCSPI_SYSCONFIG 0x2 //reset spi
MCSPI_MODULCTRL 0x1 // single master 4pin mode
MCSPI_SYSCONFIG 0x309 // OCP and Functional clocks are maintained and smart-idle
MCSPI_IRQSTATUS 0xffffffff //reset interrupt
MCSPI_IRQENABLE 0x70 //enable tx1_underflow, rx1_full, tx1_empty
MCSPI_CH1CTRL 0x0 //disable channel1
MCSPI_CH1CONF 0x0x20103cc //set config of spi1
MCSPI_CH1CTRL 0x1 //enable channel1
MCSPI_TX1 0xaa //write 0xaa in tx1
MCSPI_CH1CTRL 0x0 //disable channel
Please tell me where the error is, thank you very much, I have been looking for a few weeks and no results.