Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UART speed not sufficient

Status
Not open for further replies.

hassanmd

Member level 1
Joined
May 31, 2007
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,554
hi:
i am interfacing STM32 at 115200 bit per sec baud rate with PC. I have data of 32768 bytes.

32768x (8/115200) =2.27
theoretically data should transmit in 3 sec approx at MAX. but I have received data in 2 to 3 min...

1-why is that so?

I also interface with matlab. but same result!!!!!

2-would that be same even If transfer my code in VC6?

thanks
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,978
Could you show your code please?

Some points:

1. Don't forget to add the start and stop bits when working out the data throughput (so with one stop bit, each data byte requires 10 bits of serial).
2. While a single byte will be sent at the baud rate, there is nothing to say the next one will follow immediately. Are you using handshaking or flow control?
 

hassanmd

Member level 1
Joined
May 31, 2007
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,554
thanks. no, i am not using hand shake or flow control. simply STM32F4 transmitting the DATA and PC is receiving it. there is no problem on STM32 side, AS if i would communicate between 2 controllers it will be done exactly on speed i calculated... but with PC it slows down. in matlab same result.
i have no loss of bit or byte. i think , there is some thing with PC buffer ...!!!
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,978
If you are not using any form of handshaking, then the sender is causing the issue.

The receiver cannot control the data rate without handshake or flow control.

So, if the STM32 is sending data to the PC, check your code.
 

hassanmd

Member level 1
Joined
May 31, 2007
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,554
If you are not using any form of handshaking, then the sender is causing the issue.

The receiver cannot control the data rate without handshake or flow control.

So, if the STM32 is sending data to the PC, check your code.


thanks.
I got it. my bad. not getting point earlier. i can get image data in 3 sec now.
 

milind.a.kulkarni

Advanced Member level 3
Joined
Oct 6, 2011
Messages
923
Helped
214
Reputation
428
Reaction score
208
Trophy points
1,333
Location
Bangalore
Activity points
7,438
As per my knowledge most of the UART driver have some inherent delay routines....I mean to say you will get single byte with the baud rate that you specified but what happens when you are getting the byte there will be atleast one instruction delay....Also in case of puts function in UART driver there will be some delay in your routine....It is better to put your code for more insight on this....

Good Luck
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top