Skip to main content
Vk.2
Associate
September 18, 2021
Question

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.)

  • September 18, 2021
  • 3 replies
  • 1111 views

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

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
September 18, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Vk.2
Vk.2Author
Associate
September 20, 2021

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.

S.Ma
Principal
September 18, 2021

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