First the hardware setup.
The Arduino Pro 16mhz 5v is connected to a breadboard
Vcc connects to RFID Vcc
Gnd connects to RFID Gnd
Pin 2 connects to RFID Enable
Pin 0 (Rx) connects to RFID SOUT
The Arduino Pro is connected to my PC Via SFE FTDI 5v
Now the code
Taken from here: playground/Learning/PRFID
// RFID reader for Arduino
// Wiring version by BARRAGAN
// Modified for Arudino by djmatic
int val = 0;
char code[10];
int bytesread = 0;
void setup() {
Serial.begin(2400); // RFID reader SOUT pin connected to Serial RX pin at 2400bps
pinMode(2,OUTPUT); // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin
digitalWrite(2, LOW); // Activate the RFID reader
}
void loop() {
if(Serial.available() > 0) { // if data available from reader
if((val = Serial.read()) == 10) { // check for header
bytesread = 0;
while(bytesread<10) { // read 10 digit code
if( Serial.available() > 0) {
val = Serial.read();
if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading
break; // stop reading
}
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
}
}
if(bytesread == 10) { // if 10 digit read is complete
Serial.print("TAG code is: "); // possibly a good TAG
Serial.println(code); // print the TAG code
}
bytesread = 0;
delay(500); // wait for a second
}
}
}
Now the exact same code is uploaded to my Duemilanov and the only 2 wires I change are the SOUT from RFID to Pin 0(Rx) on Duem and RFID Enable to Duem pin 2. I still have the pro plugged into the breadboard and its providing power and ground so power isn't a problem.
This code then works just as you would expect it prints Tage Code:xxxxxxxxxx. so as I said above its not power
I have gone so far as to test the system by adding a .5sec led blink on pin 13 when a card is read and it again reads and blinks the LED on teh Deum but not the Pro.
It seems to me that I'm calling the enable pin incorrectly or something else that is a small difference between the pro and Duem. I'm not the smartest guy on the planet here but darn, I am a tech support guy! I know I have to be missing something small here.... You know I wonder if the Pro is broken? Off to try some other test code... will report back in the mean time contemplate
Ok I just tried my LED Blink test code again but this time with FTDI Unplugged and success!!!! The FDTI must be holding the serial port open, this is actually not a problem, this is going in my car so it wont have a serial connection anyways!
Wierd I would still like to know if anyone has any idea why thats happening?