How to use RX TX ??

Hi,



I have a WIO GPS board, and would like to use RX TX for a RDM6300 RFID scanner

when I use the RDM6300 with a standard arduino it works just fine… I can declare Digital pins as RX TX and it works



like this for eg:



#include <SoftwareSerial.h>

#include “RDM6300.h”



SoftwareSerial rdm_serial(10, 11);

RDM6300 rdm(&rdm_serial);



int led_pin = 13;





void setup()

{

pinMode(led_pin, OUTPUT);

digitalWrite(led_pin, LOW);

Serial.begin(115200);

Serial.println(“SETUP”);

blink(5);

}



void loop()

{

static const unsigned long long my_id = 0x0000ABCDEF;

static unsigned long long last_id = 0;



last_id = rdm.read();

Serial.print(“RFID: 0x”);

rdm.print_int64(last_id);

Serial.println();



}



Can I do the same with the WIO ? I tried the SerialUSB.begin iso serial.begin but no luck.

I tried using the UART port but no success on tx rx, no data received ?

of course I activated the #define GrovePowerPin 12



what can I do ?



thanks for your support

jean-Louis

Hi jean-Louis

We tested the UART and softwareSerial and both of them work well.



The following code shows how to use Grove UART port:

#define GrovePowerPin 12



void setup() {

pinMode(GrovePowerPin, OUTPUT);

digitalWrite(GrovePowerPin, HIGH); //power Grove

//SerialUSB.begin(115200);

SerialDBG.begin(115200); //set Grove UART baud rate 115200

}



void loop() {

//SerialUSB.println(“Grove UART is sending message”);

SerialDBG.println(“This is Grove UART”);

delay(1000);

}



D2, D4, A0, A2 also can be used for SoftwareSerial port.



#define GrovePowerPin 12

#include <SoftwareSerial.h>

SoftwareSerial ser_serial(A0,A1);

void setup() {

pinMode(GrovePowerPin, OUTPUT);

digitalWrite(GrovePowerPin, HIGH); //power Grove

ser_serial.begin(9600); /t Grove UART baud rate 115200

}



void loop() {

ser_serial.println(“This is Grove UART”);

delay(1000);

}





Seeed techsupport team

Bill

I must do something wrong …

on arduino leonardo this works with my rfid reader (RDM6300)

#include <SoftwareSerial.h>

SoftwareSerial RFID(2, 3); // RX and TX

int i;

void setup()

{

RFID.begin(9600); // start serial to RFID reader

Serial.begin(9600); // start serial to PC

}

void loop()

{

if (RFID.available() > 0)

{

i = RFID.read();

Serial.print(i, DEC);

Serial.print(" ");

}

}



now if I use it with WIO on digital ping 4,5, following your example I do :



#define GrovePowerPin 12

#include <SoftwareSerial.h>

SoftwareSerial ser_serial(4,5); // RX and TX

int i;

void setup()

{

pinMode(GrovePowerPin, OUTPUT);

digitalWrite(GrovePowerPin, HIGH); //power Grove

ser_serial.begin(9600); // start serial to RFID reader

//SerialUSB.begin(9600); // start serial to PC

}



void loop()

{



if (ser_serial.available() > 0)

{

i = ser_serial.read();

ser_serial.print(i, DEC);

}

}



but nothing received, what do I miss ?!

thanks,

Hi, if you use the software serial port to communicate with the sensor., you have to use the SerialDBG hardware serial port to print the message to PC terminal. thanks.



Seeed techsupport team

Bill

Hi,



despite all your support and advices, I can’t get it working, it might be the board or me ,but there is something wrong.

I’m stuck, could show me a code that would work with a device like this one ?

http://wiki.seeedstudio.com/Grove-125KHz_RFID_Reader/



thanks,

Hi, I do not have a tag, so i can’t test it. please test it and let us know if the issue is solved. thanks.



#define GrovePowerPin 12

#include <SoftwareSerial.h>

SoftwareSerial SoftSerial(A0,A1);



unsigned char buffer[64]; // buffer array for data receive over serial port

int count = 0; // counter for buffer array



void setup()

{

pinMode(GrovePowerPin, OUTPUT);

digitalWrite(GrovePowerPin, HIGH); //power Grove

SoftSerial.begin(9600); // Grove UART baud rate 9600

SerialDBG.begin(9600); // the Serial port of Arduino baud rate.

}



void loop()

{

// if date is coming from software serial port ==> data is coming from SoftSerial shield

if (SoftSerial.available())

{

while(SoftSerial.available()) // reading data into char array

{

buffer[count++] = SoftSerial.read(); // writing data into array

if(count == 64)break;

}

SerialDBG.write(buffer, count); // if no data transmission ends, write buffer to hardware serial port

clearBufferArray(); // call clearBufferArray function to clear the stored data from the array

count = 0; // set counter of while loop to zero

}

if (SerialDBG.available()) // if data is available on hardware serial port ==> data is coming from PC or notebook

SoftSerial.write(SerialDBG.read()); // write it to the SoftSerial shield

}

void clearBufferArray() // function to clear buffer array

{

// clear all index of array with command NULL

for (int i=0; i<count; i++)

{

buffer[i]=NULL;

}

}



best rgds

Bill

I connected the device like this





<LINK_TEXT text=“https://www.dropbox.com/s/2fv91i8quut1t … 2.JPG?dl=0”>https://www.dropbox.com/s/2fv91i8quut1tiw/IMG_2352.JPG?dl=0</LINK_TEXT>



code uploaded successfully



<LINK_TEXT text=“https://www.dropbox.com/s/ruwuc0zcvbu4f … l.png?dl=0”>https://www.dropbox.com/s/ruwuc0zcvbu4f3u/serial.png?dl=0</LINK_TEXT>



unfortunately nothing move :frowning:



jean-louis

Hi jean-Louis


  1. I see the white wire is removed from the Grove interface. We do need it for the software serial.
  2. for the tag, do you use the correct tag?



    thanks

    Bill


Can you tell me how this should be connected on an arduino mega?

Ground and VCC I understand, but to what pin should the Grove RX (white cable) and Grove TX (yellow cable go to on the arduino mega?

HI,

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).



For more info about the software serial, please refer to https://www.arduino.cc/en/Reference/SoftwareSerial thanks.



Bill

Hi Bill,



sorry to get back to this issue again but I never succeeded making work.

it sounds stupid be I am unable to use softwareserial in any case.

Since I have to finish a project where I have to equip 20 cars to get this geographical position and exchange data via SMS,

Would be able to test softwareserial on your side the same way I did ? ( with real hardware such as rfid reader or anything else ) ?



thanks

Jean-Louis

Hi Jean-Louis



Please help take a picture of the hardware setup and you code. we can simulate it here. thanks.

I have tried many times with many different ways to use RX TX for communication between a Wio GPS Board and an Arduino Due.

I have used the examples of Wio for serial communication, I have tried with different connection speeds.

Absolutely NO LUCK!

Please, please (and many more pleases) I need some help.

Anyone with a working example?