cancel
Showing results for 
Search instead for 
Did you mean: 

SSP clock frequency equation?

mtraman
Associate II
Posted on April 08, 2007 at 17:27

SSP clock frequency equation?

1 REPLY 1
mtraman
Associate II
Posted on May 17, 2011 at 09:41

Has anyone checked whether the frequency of the spi clock matches with the equation fsclk = fpclk /(cpsdvr * ( 1 + scr)) ?

I seem to get only half of the equation when i see it in oscilloscope.

When fpclk = 48MHz, cpsdrv = 24 and scr = 0, i get 1MHz instead of 2MHz.

when i change scr to 1 i get only 0.5MHz.

my settings are:

fpclk = 48MHz

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

SSP_InitStructure.SSP_DataSize = SSP_DataSize_8b;

SSP_InitStructure.SSP_ClockRate = 0;

SSP_InitStructure.SSP_ClockPrescaler = 24

SSP_Init(SSP0, &SSP_InitStructure);

SSP_Cmd(SSP0, ENABLE);

What is the correct equation for SSP clock?

thanks

vikram