Interesting to see that someone came across a similar problem.
I am currently using the Arduino Mini to read data from an RFID reader and send it through the serial. To communicate with the RFID reader (which also talks through serial, 9600 baud rate) I need to use a SoftwareSerial.
Whenever a call to SoftwareeSerial.read() is made I get some character printed out on the USB Serial (usually 'b') even if I don'call any printing function; and then the Mini resets :-?
This is exactly the same behaviour that I get if I don't have anything plugged onto my designated software serial ports.
I have previously connected the RFID reader directly to the Arduino USB and I am sure that it is working. I also have tried programming the Mini so that the RFID reader is connected to the hardware serial pors and the USB to the software ones. The result is the same, the Mini keeps on resetting.
Code follows:
#include <SoftwareSerial.h>
#define rxPin 3
#define txPin 2
#define ledPin 13
// set up a soft serial port
SoftwareSerial mySerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
// set txPin high (as recommended in forum)
digitalWrite(txPin, HIGH);
// set the data rate for the serial ports
mySerial.begin(9600);
Serial.begin(9600);
// say something
Serial.println("Hello World!");
}
void loop() {
char someChar = '0';
someChar = mySerial.read();
// print out the character:
Serial.print(someChar, DEC);
// toggle an LED just so you see the thing's alive.
// this LED will go on with every OTHER character received:
toggle(13);
}
So does SoftwareSerial implement the whole serial protocol or should I be sending some character to start the serial communication? Altough the reset thing is quite strange....
Cheers!
TMSM