[libopenstm32-devel] Baud issues
Status: Inactive
Brought to you by:
uh1763
From: Nico v. G. <Nic...@FU...> - 2011-06-14 19:50:03
|
Hey. I'm currently working with libopenstm32 on a stm32-h107 dev board. It's great, but I have some problemes here and there: When I try to configure some USARTs (1&2) I have to divide the baud rate by two to get a working serial connection (my baud rate is 921600 on USART1 => usart_set_baudrate(USART1, 921600 / 2); and 1MB on USART2 => usart_set_baudrate(USART1, 1000000 / 2) ). Now I can communicate with the uc, but after an unknown amount of time the serial connection is not working anymore for some seconds. I thought it may be an inaccurate baud rate, so I checked the values in USART_BRR. For USART1 there is 9.12 and for USART2 4,8. By using the formula of the reference manual (baud = f_clk/(16*usart_brr)) or the table 189 on page 748, I get the following values: USART1: 921600 = 72000000/(16*4,875) USART2: 1000000 = 36000000 / (16*2,25) I'm suprised that I actually have a working connection for about 90% of time, but I think either I made a math error or something else is wrong here. Does anybody has a hint? Greetins Nico . |