2007-04-08 08:27 AM
2011-05-17 12:41 AM
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