Skip to main content
ricardo2399
Associate III
August 20, 2008
Question

SSP0

  • August 20, 2008
  • 3 replies
  • 661 views
Posted on August 20, 2008 at 12:27

SSP0

This topic has been closed for replies.

3 replies

matthew239955_stm1
Visitor II
May 17, 2011
Posted on May 17, 2011 at 09:55

You must release the SSP peripheral (and any other peripherals you want to change register values for) from reset before writing to the other registers. After you enable the APB periph clock, add this line:

SCU_APBPeriphReset(__SSP0, DISABLE); //Take Port out of Reset

That should allow you to change register values for the SSP0.

Matt

ricardo2399
Associate III
May 17, 2011
Posted on May 17, 2011 at 09:55

Hi everyone

I'm using ST 91x_SSP lib, and port5.x to work with SSP0 to an SD card.

When i'm debbuging code, and pass the SSP0->CR0, CR1 and etc, and try to write to them, they just don't change their values!

Does anyone know what m i doing wrong, please? :o

here is my initialization code:

SCU_APBPeriphClockConfig(__SSP0, ENABLE );

SSP_DeInit(SSP0);

SSP_StructInit(&SSP_InitStructure);

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_8b;

SSP_InitStructure.SSP_ClockRate = 5;

SSP_InitStructure.SSP_ClockPrescaler = 2;

SSP_Init(SSP0, &SSP_InitStructure);

SSP_Cmd(SSP0, ENABLE);

THANKS :|

ricardo2399
Associate III
May 17, 2011
Posted on May 17, 2011 at 09:55

hi Matt

That is done in the SSP_DeInit(); routine. Even with that, i just cant write to those, and after trying, when i leave that routine, the processor just crash... :-S

If it helps, i'm using FreeRTOS, and an IAR evaluation Board. Every else work except that :-S

Thanks for the tip