I'm using a RS232 RFID reader that works when I talk with it directly in serial monitor. The protocol for the Serial Input and Output lines is 9600 Baud, 8 data bits, 1 stop bit, no parity.(http://www.priority1design.com.au/shopfront/index.php?main_page=product_info&cPath=1&products_id=32)
I'm using an MAX232 RS232 - TTL converter to connect the business to mu Arduino UNO. (http://www.ebay.co.uk/itm/132161976896?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)
When I connect the MAX232 to the Reader I get no communication. I'm using the following sketch to talk with the RFID reader. When I send a command through the RXD light flashes for an instant, but nothing comes back.
Has anyone had similar issues with this?
heinburgh:
I'm using a RS232 RFID reader that works when I talk with it directly in serial monitor. The protocol for the Serial Input and Output lines is 9600 Baud, 8 data bits, 1 stop bit, no parity.(http://www.priority1design.com.au/shopfront/index.php?main_page=product_info&cPath=1&products_id=32)
I'm using an MAX232 RS232 - TTL converter to connect the business to mu Arduino UNO. (http://www.ebay.co.uk/itm/132161976896?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)
When I connect the MAX232 to the Reader I get no communication. I'm using the following sketch to talk with the RFID reader. When I send a command through the RXD light flashes for an instant, but nothing comes back.
Has anyone had similar issues with this?
Something seems to be missing!
Please show a schematic of how you have things connected. Are you powering the converter from the Arduino?
Paul
Paul_KD7HB:
Something seems to be missing!
Please show a schematic of how you have things connected. Are you powering the converter from the Arduino?
Paul
Hi Paul_KD7HB, I don't have a way of making a schematic for you, unless I scribble one by hand. Typing it out will be more pleasing to the eye 
I tried it out while powering from a usb cable that came with it, as well as from the Arduino - both ways give the same result. I have pin #4 (arduino RX) connected to MAX232 TX, and pin#5 (arduino TX) connected to MAX232 RX. Ground from Arduino connected to MAX232 ground.
The only extra item is a male/male adapter between the reader and MAX232.
Something else I just noticed, with the wires connected as I said above, when I send a command the RX light flashes briefly. Normal right?
Now when I change the pins around in the sketch, i.e. making TX = 4 and RX = 5, when I send a command nothing lights up.
When I leave the sketch at TX = 5, RX = 4, but I physically switch the wires around on the MAX232, when I send a command the TX light flashes briefly. And again, when I change the sketch to TX = 4 and RX = 5 with the wires switched, no light flashes.
This doesn't seem logical.
Looking at the Ebay pictures, I see a jumper on the RX pin of the MAX232 board. What is that for? Is it jumpered to the TX pin for a loopback test?
Is logical. The TX LED is on the TTL input to the MAX232. The RX LED is on the TTL output of the MAX232.
By your first post, the RX LED flashed, indicating you did receive something through the MAX232.
What you forgot is to include your Arduino code.
Paul
Sorry, thought I had the code in there.
#include <SoftwareSerial.h>
SoftwareSerial rfid(5, 4);
void setup(){
Serial.begin(9600);
rfid.begin(9600);
}
void loop(){
if(rfid.available()){
Serial.write(rfid.read());
}
if(Serial.available()){
rfid.write(Serial.read());
}
}
Paul_KD7HB:
Looking at the Ebay pictures, I see a jumper on the RX pin of the MAX232 board. What is that for? Is it jumpered to the TX pin for a loopback test?
Mine didn't come with the jumper, in fact now that I look at it closely it looks quite different to what I have.
Would that help to test loopback? Would it say anything about the unit working, or does it simply bypass it?
IS there an adjacent pin on your unit? Does the board identify the adjacent pin? And you can loopback RS232 signals. Does the Arduino support it - don't know.
Paul
The board only has a straight line of four pins: VCC, RXD, TXD, GND.
What about testing it connected to a com port of my pc? Send commands through the com port and see if it shows up in the Arduino serial monitor?
heinburgh:
The board only has a straight line of four pins: VCC, RXD, TXD, GND.
What about testing it connected to a com port of my pc? Send commands through the com port and see if it shows up in the Arduino serial monitor?
Does your PC really have a real RS232 port? I guess another USB port with converter would work. So, sure, test out the whole works that way, then you can eliminate the problems or narrow it down a bit.
Paul
I wrote this sketch to test the MAX232 (turns out it has a MAX3232 chip which uses 3.3V, so I connected it to my Arduino's 3.3V supply instead - same results.)
#include <SoftwareSerial.h>
#include <Adafruit_RGBLCDShield.h>
SoftwareSerial rfid(5, 4);
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
void setup(){
Serial.begin(9600);
rfid.begin(9600);
lcd.begin(16, 2);
}
void loop(){
/* if(rfid.available()){
Serial.write(rfid.read()); */
lcd.clear();
lcd.setCursor(0,0);
lcd.print(F("TX:"));
lcd.setCursor(6,0);
lcd.print(Serial.read());
lcd.setCursor(0,1);
lcd.print(F("RX:"));
lcd.setCursor(6,1);
lcd.print(rfid.read());
delay(500);
rfid.println(F("TEST"));
}
Results of the sketch: When I monitor the arduino in serial monitor it shows TX -1 and RX -1, since nothing is happening. When I type in a letter and send it, the LCD gives the numerical value of whatever letter I entered, as expected.
When I change the IDE port to check on the serial port connected to the RS232 side of the MAX232 (rfid), I see TEST being printed every 500ms, and the RX light on the MAX232 flashes, as expected. When I now enter text from the monitor, the TX light on the MAX232 flashes, but nothing shows up on my Arduino LCD. So the MAX232 receives from either end (RS232 and Arduino) and passes from Arduino on to RS232, but not the other way around.
Any ideas what else I can do to troubleshoot? Or any ideas on what I'm missing? I know I'm looking over something obvious here.
First, the MAX3232 is usable on either voltage. I used it on 5V, so what ever is convenient. I think the RS232 voltages it creates may be a bit higher on 5v. Mine gate 8.3V, as I recall.
At this point, it is pretty much a hands-on debug situation. Do you have an oscilloscope to track the signal? If we were closer, I would loan you a data communications monitor. I have two, one from my time as a communications consultant and one we used to use here at the plant. Neither are of much use today!!!
A LED in series with a 1000 ohm resistor can be used across the RS232 line to ground, to see if any data, even corrupted, is getting sent.
Paul
Ok problem solved. Turns out that 1 of the 4 wires that the unit came with had not a trace of copper in it. When I switched the cables around and reversed the software serial pin numbers (I mentioned that a few posts earlier) the outcome was illogical. Reason being the cable I used on the TX side had no copper in it. Empty insulation. She is up and running!!
Thanks for taking the time, Paul!
"Turns out that 1 of the 4 wires that the unit came with had not a trace of copper in it."
Guess that's one way to say on material costs.
heinburgh:
Ok problem solved. Turns out that 1 of the 4 wires that the unit came with had not a trace of copper in it. When I switched the cables around and reversed the software serial pin numbers (I mentioned that a few posts earlier) the outcome was illogical. Reason being the cable I used on the TX side had no copper in it. Empty insulation. She is up and running!!
Thanks for taking the time, Paul!
Damn copper thieves!
Now, that is really bizarre! Who would have thought? But look at how much you have learned in the process. Glad it's running.
Paul
Buying stuff on ebay, and then going for the option that is $3 cheaper always ends up costing you much more than $3 in the end. When will I learn.
I feel like crying. Just a few minutes after solving the problem I suspect I burnt my board while replacing the test wire with a wire of the desired length.
http://forum.arduino.cc/index.php?topic=476222.0
Yes, that's why you should always remove power before moving wires. I suspect we've all blown a chip or a board moving live wires, I know I have. I've even blown the lids off ICs applying 12V or 15V by accident to 5V parts.
Hi heinburgh,
I have a uhf RFID Reader having RS 232 port,rs 232 to TTL (MAX232) converter module,arduino UNO.
I want to get the hex code from reader to arduino display on serial monitor.
Can you help me to interface rs 232 to TTL (MAX232) converter module,arduino UNO (how to connect by jumper wire).
And sketch to get dat from reader and display on serial monitor.