cancel
Showing results for 
Search instead for 
Did you mean: 

hi iam trying to interface stm32f4 discovery board with ADC IC ADS8320. the maximum spi clock that can be given to ADC IC is 2.4MHz. But when i try to reduce SPI clock frequency to 1MHZ(using the external cystal given in board as clock source.)

Vk.2
Associate II

the uart stops working and code gets stuck. Can anyone tell me why this is happening?

3 REPLIES 3

Please try to keep the title/summary short with the bulk of the detail within the post.

>>Can anyone tell me why this is happening?

No, you'll want to use a debugger, and perhaps a scope or logic analyzer to inspect external pins.

>>the uart stops working and code gets stuck. 

Stuck where? If you stop/break execution in the debugger, where does it look to be stuck?

Try instrumenting your code to better understand the flow prior to the failure.

The SWO/SWV might be usable if the UART really isn't working.

Repeatedly entering the same interrupt handler?

Stuck in a while(1) loop like Error_Handler() or HardFault_Handler() and not reporting that it reached them, or how?

How is the SPI clocked, exactly? If you're tapping the board source are you distorting or stopping it?

The SPI peripheral has a prescaler, but the frequencies you can hit are limited by the APB source. You might have to adjust down the AHB/CPU clock to hit specific targets.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

Any betazoid who can answer? Spi, usart...

Hi Tesla DeLorean thanks for the reply.0693W00000Dng6LQAR.pngok i will do that . In this inage there is prescalar and baud rate. my doubt is that does this baud rate reperesent the clock given by controller to slave device.