cancel
Showing results for 
Search instead for 
Did you mean: 

STR912FW44X SSP0 (Master) to SSP1 (Slave) can not communicate

terrance
Associate II
Posted on April 08, 2007 at 14:47

STR912FW44X SSP0 (Master) to SSP1 (Slave) can not communicate

5 REPLIES 5
terrance
Associate II
Posted on May 17, 2011 at 09:33

Good day,

Problem Statement: I cannot get SSP0 (Master)to communicate properly with SSP1 (Slave), similar to your SSP code Example1.

1) The serial data on the MISO line (using a logic analyzer) is ''CORRECT''. But when reading the data contained in the SSP0 Data Register, the data is ''INCORRECT'' => it is the same as what was transmitted by the master on the MOSI pin! Note, that I have confirmed that the SSP0 LoopBack Bit in CR1 is Not Set/Active (Loop Back is deactivated).

2) The data read out of the SSP1 (Slave) Data Register is correct and again confirmed by reading the MOSI line with a Logic Analyzer.

3) The SSP MasterConfiguration: (C Code)

/* Configure SSP0 as SPI Master and 16 bit data transfer */

SSP_DeInit(SSP0);

SSP_InitStructure.SSP_FrameFormat = SSP_FrameFormat_Motorola;

SSP_InitStructure.SSP_Mode = SSP_Mode_Master;

SSP_InitStructure.SSP_CPOL = SSP_CPOL_High;

SSP_InitStructure.SSP_CPHA = SSP_CPHA_2Edge;

SSP_InitStructure.SSP_DataSize = SSP_DataSize_16b;

SSP_InitStructure.SSP_ClockRate = 10;

SSP_InitStructure.SSP_ClockPrescaler = 14;

SSP_Init(SSP0, &SSP_InitStructure);

/* Configure SSP1 as SPI Slave (Re-use most of above settings for SSP1) */

SSP_DeInit(SSP1);

SSP_InitStructure.SSP_Mode = SSP_Mode_Slave;

SSP_InitStructure.SSP_SlaveOutput = SSP_SlaveOutput_Enable;

SSP_Init(SSP1, &SSP_InitStructure);

4) NSS pin is actively held high for the Master and Low for the Slave.

5) Can you explain Section 10.3.4 in your STR9xF Reference Manual? => As far as I can tell their isn’t any way to software control the NSS signal (No SSM or SSI bits in the SSP CR1 Register)!

Thank you for your help

amira1
Associate II
Posted on May 17, 2011 at 09:33

Hi bugaloo;

please be sure that SSP0_NSS is directly connected to Vcc and there is no pull up between the pin and Vcc.

Best regards,

mirou

nanuradha
Associate II
Posted on May 17, 2011 at 09:33

hai bugaloo,

i am also facing the same problem.

my program is struck here in the following statement.

while(SSP_GetFlagStatus(SSP1, SSP_FLAG_RxFifoNotEmpty)==RESET);

i have tested this through Debug.

and even i am not getting the clock on SCLK(P2.4) pin. can we monitor the clock on the SCLK pin? please help me regarding this and send the working example code.

thanks in advance

raj.

bramos
Associate
Posted on May 17, 2011 at 09:33

I appear to be having the same problem as bugaloo. I'm talking to an SD card (on Keil's MCB-STR9 board v3) and the slave response looks right when I look at it on a scope but the data I read from the FIFO is the data I sent. I've confirmed that the loopback is off and all my configuration registers look right when using the debugger.

Mirou, you suggest tieing the NSS high but that's the chip select line so, as expected, the slave doesn't respond. Also, wouldn't it be bad to tie an output high when it tries to drive the line low?

Any other suggestions? I've spent a few days on this and I can't think of any else to try. Thanks.

- Brian

mtraman
Associate II
Posted on May 17, 2011 at 09:33

Hi

the clk,mosi,nss should hav their alternateipconnected member to be disabled and

miso should hav the alternateipconnected member enabled while setting up the GPIOs.

i faced exactly the same problem the above thing worked