Pages: [1]   Go Down
Author Topic: how to see serial data in oscilloscope or other equipment?  (Read 2008 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 hi
I did a programming which to sent data serially using arduino uno. my rf module is xbee. so the programming works fine as my receiver arduino(other arduino) able to receive the data. So problem can i use oscilloscpe to see what data sending out? if can how i can  do it?
« Last Edit: March 29, 2011, 12:21:11 pm by rooney04 » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put your scope probe on your designated serial transmit pin.
Logged

"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.

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

...So problem can i use oscilloscpe to see what data sending out? if can how i can  do it?

Do you want to read the data, or just to see bits going by?

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

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

i just wanna see the bit going.
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So problem can i use oscilloscpe to see what data sending out? if can how i can  do it?

Answer to your question is yes. Put your oscilloscopes probes gnd to arduinos gnd, and touch the tip of the probe to arduinos send pin.

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am curious about one thing - if the OP owns an oscilloscope, but doesn't know how to hook it up, do you think they'll be able to figure out any of the other settings in order to even capture the signal transistions (not to mention that there isn't any info on this scope - does it have enough bandwidth, is it a DSO or analog, etc)?
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

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

i tried to put the probe to my transmitter pin and gnd pin, but still unable get the signal. i m using push buttons as user input. whenever i send a push button it will data . below my programming code. So i want to captured the byte been transferred using oscilloscope. When i pressed the push button, serial monitor showing the data been send but not in the oscilloscope.

int offPin         = 2;
int crankingPin    = 3;
int liftoffPin     = 4;
int upwardPin      = 5;
int downwardPin    = 6;
int turnleftPin    = 7;
int turnrightPin   = 8;
int forwardPin     = 9;
int backwardPin    = 10;
int buttonstate;


void setup()
{
// initialize the serial communication:
Serial.begin(9600);

// initialize the ledPin as an output:
 
pinMode(crankingPin, INPUT);
pinMode(liftoffPin, INPUT);
pinMode(upwardPin, INPUT);
pinMode(downwardPin, INPUT);
pinMode(turnleftPin, INPUT);
pinMode(turnrightPin, INPUT);
pinMode(forwardPin, INPUT);
pinMode(backwardPin, INPUT);
}

void loop()
{
 if(digitalRead(offPin)==HIGH)
  {
  Serial.write('0');
  delay(1000);
  }
  if(digitalRead(crankingPin)==HIGH)
  {
  Serial.write('1');
  delay(1000);
  }
 if(digitalRead(liftoffPin)==HIGH)
  {
  Serial.write('2');
  delay(1000);
  }

 if(digitalRead(upwardPin)==HIGH)
  {
  Serial.write('3');
  delay(1000);
  }
 
  if(digitalRead(downwardPin)==HIGH)
  {
  Serial.write('4');
  delay(1000);
  }
 
 if(digitalRead(turnleftPin)==HIGH)
  {
  Serial.write('5');
  delay(1000);
  }

 if(digitalRead(turnrightPin)==HIGH)
  {
  Serial.write('6');
  delay(1000);
  }
 
  if(digitalRead(forwardPin)==HIGH)
  {
  Serial.write('7');
  delay(1000);
  }
 
   if(digitalRead(backwardPin)==HIGH)
  {
  Serial.write('8');
  delay(1000);
  }
 
}

Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We would have to know more about your specific scope, manufacture and model number. Is it a triggered scope? What you require is to trigger on the falling edge of the send data line, that's when a start bit begins. Your horzontal time base needs to be able to show at least 10 milliseconds for a complete character. The vertical gain should be set to be able to see a 5vdc signal. Knowing how to use a scope takes some study and lots of practice. You are probably better off using a simple program that sends just on character, delays for a second and repeat, and then adust your scope controls to where you see the one complete character once a second on your scope.

Lefty


Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You are probably better off using a simple program that sends just on character,
I'd start simpler, with a square wave of roughly known frequency
Code:
void loop ()
{
  digitalWrite (txPin, HIGH);
  delayMicroseconds (100);
  digitalWrite (txPin, LOW);
  delayMicroseconds (100);
}
Logged

"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.

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You are probably better off using a simple program that sends just on character,
I'd start simpler, with a square wave of roughly known frequency
Code:
void loop ()
{
  digitalWrite (txPin, HIGH);
  delayMicroseconds (100);
  digitalWrite (txPin, LOW);
  delayMicroseconds (100);
}

I'm just not sure he would be able to get or know if his scope triggering is adjusted correctly with continuous pulses, that's why I suggested the single character per second. Heck, I don't even know if he has a analog or digital scope, and without more feedback from him I think I'll bow out for now.  smiley-wink
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first thing here is to learn the scope, then test the arduino...

I think we are trying to solve wrong problem.

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

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

Unless you have a good oscilloscope, it will be very hard to capture the data (although new models, even for low end, are starting to include a serial translate mode). Honestly, unless you are using borrowed equipment, as you do not seem to be very familiar with oscilloscopes I doubt you'll be able to use for debugging. Instead get a logic analyser, if you don't have the money to get a proper one just go to ebay and get a cheap know off. They are pretty much a USB transmitter and use your PC for all the processing, and yes, most of them are nothing more than toys, but it'll do the job at not very high speeds. If you have a litter bit more money I would recommend the Open Logic Sniffer, specially on top of the salea logic analyser since you get more hackable hardware for your money.
Logged

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

Im using digital ossciloscope
Logged

Pages: [1]   Go Up
Jump to: