cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 UART1 most significant part problem

EPora.1
Associate II

Hi,

I'm trying to use uart1 in stm32f411ce and I have a weird problem. in my test I am sending data from the stm32 to an arduino and printing the received data on the serial monitor. In the stm32 I'm sending bytes with the most significant part counting from 0x02 to 0xF2. the list significant part always transmits well but the LSP has a weird behavior. I made a table that shows the transmitted bytes and the received bytes.

thanks0693W00000DqIsqQAF.jpg

13 REPLIES 13

I am trying to not use the HAL lib. But I should try same thing with the HAL​ to see if it's hardware and also check the tx register empty bit before transmit

EPora.1
Associate II

Problem solved. After a couple of days I have decided to check the uart with lower main clock frq and apparently it works under 86mhz

Congrats!, clock issues are not the easyest to spot.

Maybe your XTAL pcb traces have huge capacitance or you placed the sligtly bigger than needed capacitors?(or youre using one of those RC resonators instead of a xtal)

You can figure out the real clock your chip is using by probing with an oscilloscope very fast PWMs or outputing master clock directly to a pin.

0693W00000DqQp6QAF.png 

we dont need to firmware by ourselves, lets talk

It may be the problem. My capacitors on the xtal lines are 30pF. I have chose this based on the load capacitance of my ​crystal.