Reading/writing from SPI0 registers in the BeagleBone Black in the master-single channel mode

Hi All,

I am trying to write a simple code for the SPI0 channel for Master-single channel mode.This means that my device is a master and it is talking to just one channel.

The steps I am following from the manual are as follows :

  1. Enabling CM_PER_SPI0 clock //to enable the clock for SPI module

  2. Resetting the SPI module from the SYSCONFIG register // need to initialize the module

  3. Checking if reset done from the SYSSTATUS register

  4. Writing to SYSCONFIG Register // 3PIN mode enabled as I am have just short circuited MISO and MOSI PIn 18 and 21

  5. Write to MODULCTRL register

  6. Write to SYST[SSB] // to set the bits the IRQSTATUS

  7. Enabling the RX0 FULL and TX0_EMPTY from the IRQENABL register

  8. Write to CH(0)_CONF register

  9. Enabling the channel 0 by CH(0)_CTRL register

  10. Now for read/write of 8 bit word

LOOP:(till all the words are transferred)
a) wait till TX0_Empty event occurs
b) put data in the TX0 register
c) wait for the RX_FULL event to occur
d) Read from the RX0 register

e) Reset the status bit of the IRQSTATUS for RX_FULL and TX_EMPTY from the SYST[SSB] = 1

the screen shot give the register content and I am sending non-zero values to TX0 register but always getting 00’s in the RX register.
Any help would be great!!!