Right .. oscilloscope purchased.
I did also find that turning local echo off on the wifi device helps alot ..
Code looks like this now:
#include <NewSoftSerial.h>
NewSoftSerial mySerial(3, 2); //rx,tx
void setup()
{
Serial.begin(9600);
Serial.println("Start");
// set the data rate for the NewSoftSerial port
mySerial.begin(9600);
mySerial.println("AT+iE0"); //set local echo off
delay(500);
while (mySerial.available())
{
Serial.print((char)mySerial.read());
}
mySerial.println("AT+iRP19"); // reads some adc value from device
delay(500);
while (mySerial.available())
{
Serial.print((char)mySerial.read());
}
}
void loop() // run over and over again
{
mySerial.println("AT+i"); // should return i/ok
delay(500);
while (mySerial.available())
{
Serial.print((char)mySerial.read());
}
delay(1000);
}
And output like this:
Start
I/OK
ADC value = 55
I/OK
I/OK
..... {some I/OK removed to ease reading}
I/OK
I/OK
¤/OK
I/OK
I/OK
RéjªHøI/OK
I/OK
I/OK
I/OK
I/OK
¤/OK
I/OK
I/OK
RéjªHøI/OK
I/OK
I/OK
I/OK
I/OK
I/OK
Since there is a nice delay in the void loop its easy to catch the different pulse trains on the scope.
I have the probe connected to ground and the rx pin of the arduino (5v side). The pulses are all nice and square and come out very close to 5V with a 30uS rise time. Ripple voltage on the 3v supply is less than 20mV.
The scope is a Philips/Fluke pm3350 digital storage at 50MHz and has a register store function. This allows you to 'save' a pulse train and then overlay it on the screen together with the current pulse train triggered.
Problem is the junk chars output (RéjªHø) and the correct output (I/OK) generate exactly the same pulse train! :o
Anyone ideas where the software may be getting the junk chars from or am I not using the scope correctly? :-?