Forcing a clean uninterrupted baud when receiving data via serial port
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I made a project with a micro-controller that allows me to send data to the PC where the low nibbles of data always follow the same sequence. For example, My data is sent like this:
x0 x1 x2 x3 x4 ..... xE xF
where x is any hex value from 0 to F.
At the beginning the transmission is fine but when I send data from the PC to the micro-controller and then have it return data, it always wants to skip the exact same byte position. For example, Instead of...
x0 x1 x2 x3 x4......
I get:
x0 x2 x3 x4.....
I double checked my code and its efficient, so it can't be code especially if the exact same function to produce the data to the PC is exactly the same everytime and that function formats the data so the lower nibble is the sequence number and it waits for the transmission to complete.
This makes me think there are some unix settings I need to apply.
I looked at setserial and stty but I'm wondering what settings are actually the best. I don't mind if my computer literally locks all other processes up while the serial tests run.
I was thinking of adjusting closing_wait and close_delay options in setserial and maybe enabling low_latency as well as using the nice and ionice commands on the app (aka od) to watch the I/O. But then again, could the app I'm using is bad? This is the command I used to read data...
od -t x1 -w16 -v /dev/ttyS0
So what unix tools would help the most that would allow me to get ALL of the data without losing any character from the serial port? The data rate set for both devices is 57600bps, and I'm using a one meter serial port cable.
data-recovery serial-port data
add a comment |Â
up vote
0
down vote
favorite
I made a project with a micro-controller that allows me to send data to the PC where the low nibbles of data always follow the same sequence. For example, My data is sent like this:
x0 x1 x2 x3 x4 ..... xE xF
where x is any hex value from 0 to F.
At the beginning the transmission is fine but when I send data from the PC to the micro-controller and then have it return data, it always wants to skip the exact same byte position. For example, Instead of...
x0 x1 x2 x3 x4......
I get:
x0 x2 x3 x4.....
I double checked my code and its efficient, so it can't be code especially if the exact same function to produce the data to the PC is exactly the same everytime and that function formats the data so the lower nibble is the sequence number and it waits for the transmission to complete.
This makes me think there are some unix settings I need to apply.
I looked at setserial and stty but I'm wondering what settings are actually the best. I don't mind if my computer literally locks all other processes up while the serial tests run.
I was thinking of adjusting closing_wait and close_delay options in setserial and maybe enabling low_latency as well as using the nice and ionice commands on the app (aka od) to watch the I/O. But then again, could the app I'm using is bad? This is the command I used to read data...
od -t x1 -w16 -v /dev/ttyS0
So what unix tools would help the most that would allow me to get ALL of the data without losing any character from the serial port? The data rate set for both devices is 57600bps, and I'm using a one meter serial port cable.
data-recovery serial-port data
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I made a project with a micro-controller that allows me to send data to the PC where the low nibbles of data always follow the same sequence. For example, My data is sent like this:
x0 x1 x2 x3 x4 ..... xE xF
where x is any hex value from 0 to F.
At the beginning the transmission is fine but when I send data from the PC to the micro-controller and then have it return data, it always wants to skip the exact same byte position. For example, Instead of...
x0 x1 x2 x3 x4......
I get:
x0 x2 x3 x4.....
I double checked my code and its efficient, so it can't be code especially if the exact same function to produce the data to the PC is exactly the same everytime and that function formats the data so the lower nibble is the sequence number and it waits for the transmission to complete.
This makes me think there are some unix settings I need to apply.
I looked at setserial and stty but I'm wondering what settings are actually the best. I don't mind if my computer literally locks all other processes up while the serial tests run.
I was thinking of adjusting closing_wait and close_delay options in setserial and maybe enabling low_latency as well as using the nice and ionice commands on the app (aka od) to watch the I/O. But then again, could the app I'm using is bad? This is the command I used to read data...
od -t x1 -w16 -v /dev/ttyS0
So what unix tools would help the most that would allow me to get ALL of the data without losing any character from the serial port? The data rate set for both devices is 57600bps, and I'm using a one meter serial port cable.
data-recovery serial-port data
I made a project with a micro-controller that allows me to send data to the PC where the low nibbles of data always follow the same sequence. For example, My data is sent like this:
x0 x1 x2 x3 x4 ..... xE xF
where x is any hex value from 0 to F.
At the beginning the transmission is fine but when I send data from the PC to the micro-controller and then have it return data, it always wants to skip the exact same byte position. For example, Instead of...
x0 x1 x2 x3 x4......
I get:
x0 x2 x3 x4.....
I double checked my code and its efficient, so it can't be code especially if the exact same function to produce the data to the PC is exactly the same everytime and that function formats the data so the lower nibble is the sequence number and it waits for the transmission to complete.
This makes me think there are some unix settings I need to apply.
I looked at setserial and stty but I'm wondering what settings are actually the best. I don't mind if my computer literally locks all other processes up while the serial tests run.
I was thinking of adjusting closing_wait and close_delay options in setserial and maybe enabling low_latency as well as using the nice and ionice commands on the app (aka od) to watch the I/O. But then again, could the app I'm using is bad? This is the command I used to read data...
od -t x1 -w16 -v /dev/ttyS0
So what unix tools would help the most that would allow me to get ALL of the data without losing any character from the serial port? The data rate set for both devices is 57600bps, and I'm using a one meter serial port cable.
data-recovery serial-port data
asked Oct 28 '17 at 3:07
Mike
1213
1213
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54
add a comment |Â
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f400999%2fforcing-a-clean-uninterrupted-baud-when-receiving-data-via-serial-port%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Does it happen at a lower baud? Also can you rig a serial line between two microcontrollers, or two linux systems, and then see if the problem appears in those other cases or not?
â thrig
Oct 28 '17 at 12:45
Today, I ran the same tests again, this time without first launching any additional programs in X and the data passed through better this time. It must be my computer was being slow even though it responds fast.
â Mike
Oct 28 '17 at 21:54