Grove 125Khz RFID won't work with SoftSerial/seeeduino lite

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, jeremy882, crail.lyu969

Post Reply
ldsrc2008
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Wed Mar 23, 2016 9:18 pm

Grove 125Khz RFID won't work with SoftSerial/seeeduino lite

Post by ldsrc2008 » Wed Mar 23, 2016 9:25 pm

I have this gorve RFID reader:
http://www.seeedstudio.com/depot/Grove- ... -1008.html
and this seeduino lite based on 32U4
http://www.seeedstudio.com/wiki/Seeeduino_Lite

the RFID reader is set in UART mode.
If I connect to software serial with 10 as RX, 11 as TX, I got nothing. code as below:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// set the data rate for the SoftwareSerial port
mySerial.begin(9600);

}

void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}

But, if I connect RFID to serial1, I got the reading, code as following:

static long baud = 9600;
void setup() {
//pinMode(DTR_PIN, OUTPUT);
//digitalWrite(DTR_PIN, LOW);
Serial.begin(baud);
// while the serial stream is not open, do nothing:
while (!Serial) ;
Serial1.begin(baud);
}

void loop() {
// copy from virtual serial line to uart and vice versa
if (Serial.available()) {
char c = (char)Serial.read();
Serial1.write(c);
}
if (Serial1.available()) {
char c = (char)Serial1.read();
Serial.write(c);
}

}

what is wrong?

ldsrc2008
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Wed Mar 23, 2016 9:18 pm

Re: Grove 125Khz RFID won't work with SoftSerial/seeeduino l

Post by ldsrc2008 » Wed Mar 23, 2016 9:30 pm

BTW, I have tested both code with my grove GPS on software serial and seria1 on the same seeeduino lite, but send correct data.

Why my grove 125Khz RFID can not work with softserial?

viswa
Staff
Staff
Posts: 168
Joined: Tue Jan 25, 2011 11:16 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Seeeduino Film,Motion Frame,UartSbee

Re: Grove 125Khz RFID won't work with SoftSerial/seeeduino l

Post by viswa » Thu Mar 24, 2016 5:53 pm

Hello,

Could you please post more details of your setup -- photos of your setup, Arduino IDE version, connection diagram and RFID tag that was used.

Thanks and Warm Regards.

Post Reply