This sketch just sends out some ascii one's as a test stream - it's running on a breadboarded 168
#include <NewSoftSerial.h>
#define rxPin 18
#define txPin 19
NewSoftSerial mySerial(rxPin, txPin);
void setup() {
mySerial.begin(9600);
mySerial.print("1111111111");
}
void loop(void) {
}
This code catches the software serial stream and passes it to the PC over the hardware uart & USB - it's on a diecimilia 328.
#include <NewSoftSerial.h>
#define rxPin 2
#define txPin 3
// set up a new serial port
NewSoftSerial mySerial(rxPin, txPin); //(rx,tx)
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
Serial.begin(9600); //start the hardware UART as well
Serial.println("Software Serial to Hardware Serial Relay");
}
void loop() {
// listen for new serial coming in:
if (mySerial.available()){ //if there's new data in
char someChar = mySerial.read();
Serial.print(someChar); //send it to the PC
}
}
By the time it gets to windows the characters are mangled insead of ascii "1"s I'm getting someling like hex C5 C5 8A 8A 8A 8A 8A 8A 8A 8A FE
The only thing I can think of is that the internal timing of the breadboard processor is too sloppy but before I start ripping the hardware up I thought I'd ask if anyone can see something else I've goobered. I know I've used software serial before at higher data rates on a breadboard with no problem.