05-23-2021 08:38 AM - edited 05-23-2021 08:40 AM
i want to send some bytes over serial port in every two milisec.
Solved! Go to Solution.
05-23-2021 09:04 AM
Show us what you have. We are here to HELP. (Not "do".)
05-23-2021 11:02 AM
05-27-2021 10:56 AM
i need to send one frame of data which of 20bytes.and i have to send those bytes in every 2msec over serial port with a board rate of 9600.
05-27-2021 11:16 AM
Let's do some math!🤔
9600 baud is 9600 bits per second. Depending on data bits and parity, it is roughly 10 bits to send a byte of data.
So 9600 baud really means approximately 960 bytes per second. To simplify, we'll just round up to 1000 bytes per second.
To send 20 bytes, it will take 20 milliseconds. (20 bytes divided by 1000 bytes per second.)
So how do you expect to send 20 bytes in only 2 milliseconds? You'll only get 2 bytes through!
You need a baud rate that is at least 10 times faster, and more to have a chance. No way with 9600 baud. Try 115,200 baud.
05-27-2021 11:20 AM - edited 05-27-2021 11:22 AM
Did you do the math?
20 bytes every 2ms is 10000 bytes per second (or 80000 bits/s + overhead). How are you trying to squeeze that into a pipe with a capacity of 9600 bits per second???? (I assume you mean Baud rate, Not even sure what a "board rate" would be) You are trying to use a tricycle as a freight train. 😮
(EDIT: looks like Ravens wrote more and in shorter time. Same story though. I am getting too slow!)