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 :
Enabling CM_PER_SPI0 clock //to enable the clock for SPI module
Resetting the SPI module from the SYSCONFIG register // need to initialize the module
Checking if reset done from the SYSSTATUS register
Writing to SYSCONFIG Register // 3PIN mode enabled as I am have just short circuited MISO and MOSI PIn 18 and 21
Write to MODULCTRL register
Write to SYST[SSB] // to set the bits the IRQSTATUS
Enabling the RX0 FULL and TX0_EMPTY from the IRQENABL register
Write to CH(0)_CONF register
Enabling the channel 0 by CH(0)_CTRL register
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!!!