UART protocol sniffer question

More
13 years 7 months ago #459 by loowens
I am trying to use my XProtoLab (HW rev 1.7, firmware 2.0) to sniff UART traffic being sent by an Atmega328P-PU.  Using an Arduino UNO without a processor wired to TX/RX pins of the chip I am able to see the transmitted messaging when set to half the bps rate of the sketch (sketch configured for 9600 monitor arduino set to 4800 in serial monitor). When I try to use the Xprotolab set at 4800 or 9600 all I get is garbled messages in the ASCII display setting. I've tried mutliple spees settings with the same results.  The transmission is set to no parity and 1 stop bit.
Any idea what else I could look at?

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #460 by ganzziani
Set the Xprotolab in Scope mode, using the vertical cursors verify that the length of the pulses correspond to the correct bps.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago - 13 years 7 months ago #474 by dtmf
UART sniffer via Bluetooth test:
Last edit: 13 years 7 months ago by dtmf.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago - 13 years 6 months ago #488 by loowens
Sorry about the long delay in my response. Was waiting for radio hardware to come in and the holidays to pass. Anyway here is my situation I have a radio transmitter that is supposedly expecting a 1200bps 7,E,1 UART transmission from my ATMEGA328-P-PU chip. I have the radio connected to pin 3 of the chip for comms, and pins 7 and 8 for power. I have the Xprotolab connected on Logic2 (UART RX) to the ATMEGA Pin3. When I run the UART sniffer all is get is 0's or garbage depending on settings. The chip is running this Arduino Sketch.
void setup() { 
///init serial comms 
Serial.begin(1200,SERIAL_7E1); }
// Loop for testing, final revision will be run once per power cycle
void loop() { 
//turn pin 9 on to full power 
analogWrite(9, 255); 
//wait 5ms for sensor to settle 
delay(5); 
// read the input on analog pin A5: 
int sensorValue = analogRead(A5);
  // Convert the analog reading to a voltage and multiply by 100 to remove decimal point: 
float voltage = sensorValue * (5.0 / 10.23);
   //turn pin 9 off 
analogWrite(9, 0); 
//build array
  char voltread[10];
  sprintf (voltread, "V;RB0%03i;",(int)voltage); 
//add checksum to transmission
  byte checksum = 0;
    for(int i = 0; i < 9; i++) checksum ^= voltread; 
char transmission[13]; 
sprintf (transmission, "%s%x;", voltread, checksum); 
Serial.println(transmission); 
 delay(3000);}
 
 The output should look like V;RB0475;3F (everything after RB0 will vary based on reading and checksum calculation). The program outputs to a variable resistor then reads the return voltage to insert into the message.
Last edit: 13 years 6 months ago by loowens.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #489 by ganzziani
Hi. Currently the Xprotolab only decodes UART with 8 data bits. I'll add a note on my wish list to improve this in the future.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #490 by loowens
Thanks, at least I don't feel like I'm going crazy now.

Please Log in or Create an account to join the conversation.

Time to create page: 0.183 seconds
Powered by Kunena Forum