cancel
Showing results for 
Search instead for 
Did you mean: 

ssp example is not working on MCBSTR9 Evaluation Board

nanuradha
Associate II
Posted on December 21, 2006 at 10:49

ssp example is not working on MCBSTR9 Evaluation Board

5 REPLIES 5
nanuradha
Associate II
Posted on May 17, 2011 at 09:34

hai,

ssp example is not working on MCBSTR9 Evaluation Board.

i am not even getting the clock in SCLK pin(P2.4),can we monitor this clock by using CRO.

anybody please clarify these doughts and send the working code for SSP(spi).

thanks in advance

raj.

[ This message was edited by: anuradha on 14-12-2006 05:55 ]

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

Hi anuradha,

after some trials and after contacting ST team about this problem, it seems that the configuration of GPIO5 in SSP example, should be as follow:

GPIO_DeInit (GPIO5);

/*Gonfigure SSP0_CLK, SSP0_MOSI, SSP0_nSS pins */

GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_7;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2;

GPIO_Init (GPIO5, &GPIO_InitStructure);

Normally with this configuration the SSP example works fine under both STR9 and IAR eval boards with pin5.7 pulled up.

Best regards,

mirou

[ This message was edited by: mirou on 14-12-2006 11:28 ]

[ This message was edited by: mirou on 14-12-2006 11:29 ]

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

Hi Mirou,

i have modified my code according u'r sugession but i have no luck.

here i am sending my complete code please have a glance of it and give me u'r sugessions.

in my code i am using SSP0 as Master Mode and SSP1 as Slave mode.

NSS pins are directly connected to VCC(Master) and GND(Slave) within the board. according to u'r suggest i Disable the GPIO_IPConnected.

For generating a SCLK i have used following values

SSP_InitStructure.SSP_ClockRate = 25;

SSP_InitStructure.SSP_ClockPrescaler = 2;

Default fpclk is 48Mhz

from these values my expected bit rate is 1.7142 Mbps according formula

fsclk=fpclk/(CPSDVR+(1+SCR)).

but i am not able to monitor this clock on SCLK pin(P2.4)using CRO.

can we observe this clock?

And i have Debug this code, from Debug what i am observe is..

there is no value in SSP->DR register.

and the value of SSP->SR is 0x0013 or 0x0003, it mean Tx FIFO is Empty and Tx FIFO is not Full.

Finally my program has strucked at

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

please clarify my doughts regarding bit rate and clock.

thanks and regards

-=raj=-

jjacobsen
Associate II
Posted on May 17, 2011 at 09:34

Keil describes a problem with the ssp on the MCBSTR9 in their forum.

See

http://www.keil.com/support/docs/3242.htm

.

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

Hi anuradha,

If you look at the schematic of the MCBSTR9 Evaluation Board, you find that SCLK1 (P3.4) is also used as interrupt input from the Ethernet controller. Hence to use this pin in SPI application you have to disconnect R31 from board.

May be this is the problem!

Best regards

mirou