Loading...
Pages: [1]   Go Down
Author Topic: Garbage Values on Serial Monitor  (Read 668 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Recently purchased an Arduino Fio, and was trying out the Serial.print function.

However when I upload the program all it gives me on the serial monitor are garbage values.  My code is as follows:

void setup()
{
  Serial.begin(9600);
}
 
void loop()
{
  Serial.println("Hello World");
  delay(100);
}

Any ideas?  I have made sure that I have selected the correct board and com port, and the serial monitor is set to 9600 baud.

Thanks!

H
Logged

Offline Offline
Full Member
***
Karma: 8
Posts: 147
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm pretty sure the serial signal is inverted and you have to use a MAX232 chip to connect to a PC.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 314
Posts: 35517
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How ARE you getting the serial data from the FIO to the PC?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you mean inverted?

Sorry I forgot to mention I am using two Xbee shields to wirelessly simulate a serial connection.

Thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm pretty sure the serial signal is inverted and you have to use a MAX232 chip to connect to a PC.

I am not quite sure I understand what you are saying... are you suggesting that the serial signal is inverted due to a hardware problem?  Or a software setup that I have overlooked?

Is a MAX 232 chip necessary since I am using a pair of XBee shields to wirelessly communicate with the PC through ZigBee?

H
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 248
Posts: 16535
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The IDE serial monitor or something else?
If something else, is it also set to 8-N-1?
8 bits, no parity, 1 stop bit
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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally figured it out.  I was using a baud rate of 9600 (in the program), when I changed it to a baud rate to 57600 it worked.

Since the example programs all use a baud rate of 9600, how do I know when to change it to what baud rate?

H
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 248
Posts: 16535
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Guess you need to look every time. Take nothing for granted.
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

Pages: [1]   Go Up
Print
 
Jump to: