Pages: [1]   Go Down
Author Topic: baudrate error  (Read 510 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi everyone,
i'm working with an instrument (tdr100) which is set to communicate at 57.6k and it shoould send me 2048 float in a string of       characters (9000+), through rs232 cable.
after i sniffed the serial port on the laptop, i'm trying to connect the instrument to arduino due, through a MAX3232. but when i get the response, it seems to miss some characters(the code i wrote is pretty simple and should be ok, i'll post it on the bottom)
thus i guess the problem could be the approximation with which the baudrate is calculated and generated.
do you know how to calculate this error, so i might try to fix it?

p.s. i looked on the datasheet of the sam3x but i didn't find any hint about 84MHz clock.

this is the code i wrote to acquire the characters:
Code:
char response_array[9002];
char* rsp;
rsp=response_array;
while(Serial1.available()){
    digitalWrite(red,HIGH);
    *rsp = Serial1.read();
    rsp++;
    digitalWrite(red,LOW);
  }

Logged

Canada
Offline Offline
Newbie
*
Karma: 1
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Did you setup your Arduino to receive at 57.6k?  Have you tried to receive the data on your PC, and are the missing characters there?
Do you use timers in your Arduino code?
I've used my Due @115.2k and 57.6k sending 100-200 characters without problem, so it may be because of the longer messages.

Can we see your entire code to try and solve the issue?
Logged

Pages: [1]   Go Up
Jump to: