Pages: [1]   Go Down
Author Topic: Problem using arduino board to write data  (Read 726 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all
I encounter problems while writing data using arduino board. I have written a simple progam for testing as followed:

Quote
void setup()
{
   Serial.begin(115200);
}

void loop()
{
   Serial.write(0xAA);
}


I use the max232 to convert the voltage level to rs232, and use the hyperterminal to observe the output. However, from the hyperterminal there are many "0" inserted to the output. How can these be solved?
Thanks.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With no delays, that's probably writing data faster than hyperterminal can display it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tried adding 1 second delay and 5 seconds delay in the program, but there is still problem.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Try a lower baud rate.  Ensure the two baud rates are the same.  Try a printable character.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks u guys, i'll try again later smiley
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 534
Posts: 26970
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hex AA = decimal 170
http://www.cs.utk.edu/~pham/ascii.html
look at the extended ascii table, maybe that is something hyperterminal cannot handle.
Try using Serial.print or Serial.println instead.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: