Hi,
I'm trying to read in a bitstream via the SPI module and hand it over via DMA. A fist step is to only read it in the FIFO and check the function of the SPI.
The Bitstream has a 10MHz clock signal
I decided to go for:
-Slave Network Mode
-FIFO buffers to read in (8bit or 16bit)
-SPI A
-High-Speed Mode
I cannot get any data inside, when debugging I cannot see any changes in the FIFO Status bits or SPI RX Data
I tried it with Pull ups on and off, no difference
The clk is connected to GPIO 60 SPICLK
The Bitstream to GPIO 58 SPISIMOA
SPISTEA is on GPIO61 a wire to GND or 3.3V didnot change anything
Here is my GPIO settings as it is recommended in the technical reference Table 7-7
EALLOW;
GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 0x11; // Configure GPIO58 as SPISIMOA
GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 0x11; // Configure GPIO59 as SPISOMIA
GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 0x11; // Configure GPIO60 as SPICLKA
GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 0x11; // Configure GPIO61 as SPISTEA
GpioCtrlRegs.GPBGMUX2.bit.GPIO58 = 0x11; // Configure GPIO58 as SPISIMOA High-Speed Mode
GpioCtrlRegs.GPBGMUX2.bit.GPIO59 = 0x11; // Configure GPIO59 as SPISOMIA High-Speed Mode
GpioCtrlRegs.GPBGMUX2.bit.GPIO60 = 0x11; // Configure GPIO60 as SPICLKA High-Speed Mode
GpioCtrlRegs.GPBGMUX2.bit.GPIO61 = 0x11; // Configure GPIO61 as SPISTEA High-Speed Mode
EDIS;
and here my settings for the SPI registers:
ClkCfgRegs.LOSPCP.bit.LSPCLKDIV = 0;
SpiaRegs.SPICCR.bit.SPISWRESET = 0; // set SPI to Reset
// FIFO configuration
SpiaRegs.SPIFFCT.all = 0; // place SPI FIFO in reset , clear SPIFFCT (control register FIFO)
for(m=0;m<3;m++); // wait ??
SpiaRegs.SPIFFTX.bit.SPIFFENA = 0x1; // FIFO mode enable
SpiaRegs.SPIFFRX.all = 0; // clear FFRX register
SpiaRegs.SPIFFRX.bit.RXFFIL = 0x8; // Set RX FIFO level
SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1; // FIFO RX release
// SPI configuration
// already done by default
SpiaRegs.SPICTL.bit.MASTER_SLAVE = 0; // Network Mode = Slave
SpiaRegs.SPICTL.bit.TALK = 0; // only receive, SPISOMI is put into the high-impedance state
// other then default
SpiaRegs.SPICCR.all = 0; // Clear SPI control register, SPI in reset
SpiaRegs.SPICCR.bit.SPICHAR = 0x7; // 0xF 16bit words, 0x7 8bit words
SpiaRegs.SPICCR.bit.CLKPOLARITY = 0x1;
//SpiaRegs.SPICCR.bit.HS_MODE = 0x1; // enable High-Speed Mode for SPI, set bit 5
SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = 17; //
//SpiaRegs.SPICCR.all = 0x009F ; // Release SPI from Reset, enable LB mode
SpiaRegs.SPICCR.bit.SPISWRESET = 0x1; // Release SPI from Reset
The input signal looks good on scope and I do not really know where to look at next.
Does anybody see my mistake or do you have an idea for debugging?
Thank you
Georg
Thanks Georg