Go Down

Topic: Serial monitor displaying junk. (Read 880 times) previous topic - next topic

ashish-k

Aug 10, 2012, 06:59 pm Last Edit: Aug 10, 2012, 10:09 pm by ashish-k Reason: 1
I have Arduino duemilanove and it's 4-5 month old,
i have problem with serial interfacing,

i uploaded simple serial code:

Code: [Select]

void setup(){
 Serial.begin(9600);
 pinMode(13,OUTPUT);
}
void loop(){
 Serial.println("abcdefghijklmnopqrstuvwxyz");
 digitalWrite(13,HIGH);
 delay(500);
 digitalWrite(13,LOW);
 delay(500);
}


led 13 is blinking but serial output is like "¸?®?ÅÄçGó".

so i tried another two atmega328 with Arduino boot-loader but same problem.
i also tried to uninstall drivers, restart pc, serial loopback test shorting 0 and 1, external serial monitor and everything is fine except serial monitor,
i also used putty but same output.

ps. i can still upload the sketch, pc baud rate 9600.

any ideas ???
Rock it n loop it.

JavaMan

By any chance is the serial monitor baudrate different than 9600?  They need to be the same.

ashish-k

thanks for your replay but i mentioned that
PC BAUD RATE IS 9600".
Rock it n loop it.

AWOL

Have you changed any of the processor clock speed settings?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

ashish-k

nothing modified, just tried sd shield and it was working fine, but when i modified the sd sketch to read file and print on the serial the problem starts, don't know why. :|
Rock it n loop it.

JavaMan

Quote
thanks for your replay but i mentioned that
PC BAUD RATE IS 9600".


I realize you said that, it's just that I got some of the same characters you mentioned in your first post when I set my serial monitor to 300 baud.  Hope you find a solution! 

Osgeld

what does it do when you use a real serial terminal?
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

ashish-k

i also mentioned that i tried PUTTY and same output.
Rock it n loop it.

PaulS

Quote
nothing modified, just tried sd shield and it was working fine, but when i modified the sd sketch to read file and print on the serial the problem starts, don't know why.

Well, right there - line 37 - that's where you went wrong.

If you were to actually post the code you are running, then perhaps one of us would be inclined to try to replicate your problem. Or spot it.

ashish-k

#9
Aug 11, 2012, 06:48 pm Last Edit: Aug 11, 2012, 06:53 pm by ashish-k Reason: 1
i just uploaded the example sketch, then i uploaded same code with different file names like test1.txt, user.txt, password.txt
and the last one was not working and hear's the code
Code: [Select]

#include <SD.h>

File myFile;

void setup()
{
 Serial.begin(9600);
 Serial.print("Initializing SD card...");
 // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
 // Note that even if it's not used as the CS pin, the hardware SS pin
 // (10 on most Arduino boards, 53 on the Mega) must be left as an output
 // or the SD library functions will not work.
  pinMode(10, OUTPUT);
 
 if (!SD.begin(10)){
   Serial.println("initialization failed!");
   return;
 }
 Serial.println("initialization done.");
 // open the file. note that only one file can be open at a time,
 // so you have to close this one before opening another.
 myFile = SD.open("password.txt", FILE_WRITE);
 // if the file opened okay, write to it:
 if (myFile) {
   Serial.print("Writing to password.txt...");
   myFile.println("testing 1, 2, 3.");
// close the file:
   myFile.close();
   Serial.println("done.");
 } else {
   // if the file didn't open, print an error:
   Serial.println("error opening password.txt");
 }
}

void loop()
{
 myFile = SD.open("password.txt");
 if (myFile) {
   Serial.println("password.txt:");
   
   // read from the file until there's nothing else in it:
   while (myFile.available()) {
    Serial.write(myFile.read());
   }
   // close the file:
   myFile.close();
 } else {
  // if the file didn't open, print an error:
   Serial.println("error opening password.txt");
 }
delay(1000);
}


so basically the last code didn't worked so i uploaded the serial test that i mentioned at the beginning.

thank you.
Rock it n loop it.

Go Up