cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to set OVER8 in STM3240G-EVAL (STM32F407IGH6)

tirthankar
Associate
Posted on November 05, 2012 at 08:21

Hello Friends,

Am trying to achieve a high baud rate using USART1 - 7.3728Mbps

SYSCLK=168MHz

APB2=84MHz

Now to achieve this baud rate, I need the OVER8=1 (3 bits for Fraction)

Using example code, I set the OVER8 by following piece of code:

    USART_OverSampling8Cmd(USART1, ENABLE);

But it seems this piece of code has no affect.

I tried using the Register>>USART1>>CR1 but unable to find any OVER8 ?

Am using IAR Kickstart edition 6.4 (Free license, but, limited to 32kb code size)

I believe that STM32F407 family should support the OVER8?

Would really appreciate, if someone could take time and assist me?

Thanks in advance,

Best Regards

#usart
5 REPLIES 5
Posted on November 05, 2012 at 09:33

Quote from stm32f4xx_usart.c:

 

*          In order to reach higher communication baudrates, it is possible to

  *          enable the oversampling by 8 mode using the function USART_OverSampling8Cmd().

  *          This function should be called after enabling the USART clock (RCC_APBxPeriphClockCmd())

  *          and before calling the function USART_Init().

JW
Posted on November 05, 2012 at 13:08

Well, I think your bigger problem here will be getting the baud rate you actually want.

The settings are likely to result in a rate of 7.6363 Mbps (+3.57%), running at 162 MHz might get you to 7.3636 Mbps (-0.12%).

To get closer to the rate you want you'll want to clock from a more suitable crystal, and choose optimal PLL settings.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on November 05, 2012 at 13:34

... and your next problem will be to get such a high-bandwidth signal through your level-shifter hardware and cable. I wouln't be surprised if you have transmission errors in the 2-digits percent range.

jpeacock2399
Associate II
Posted on November 06, 2012 at 15:56

Over a short distance either RS-485, LVDS or a high speed optocoupler can easily handle an 8MHz data rate. Won't work for RS-232 though. 

At that high a data rate you will need to use DMA for transfers; the per character total interrupt service latency would have to be around 1usec, and even then you won't have any CPU time left.

Is the baud rate not changing?  What value are you putting in the BRR?

Jack Peacock
Posted on November 06, 2012 at 16:44

Well hopefully the OP has some grasp of the data stream in question given the specificity of the baud rate required.

Then again it sounds like a downstream GSM HSDPA rate, which is more of a modem over air number rather than the speed you'd want to talk to the modem, using buffering and flow control.

And yes, you'd definitely want to use DMA if you want to come close to saturating the channel, and perhaps consider synchronous mode.

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