RFID via serial port D

Hi,
i’m developing a system with Rabbit 3700 and an RFID reader, ISC.MR101-A MID RANGE READER via RS-232.

After configuring, i’m witing this code:



int SendRFIDCommand() {
   auto int rec;
   auto unsigned long t0;

   serDopen(38400);
   serDdatabits(PARAM_8BIT);
   serDdatabits(PARAM_EPARITY);

          serDputc(0x05);
          serDputc(0xFF);
          serDputc(0x65);
          serDputc(0xE5);
          serDputc(0xCB);

    t0=MS_TIMER;
   while(serDpeek()==-1 && MS_TIMER<1000+t0);
   
   rec=serDread(RxBuff,17,1000);

  for (i = 0 ; i < 17; i++){
         printf("%d RxBuff->%x
", i, RxBuff[i]);
    		}

}


but i receive a wrong answer


0 RxBuff->5 
1 RxBuff->7F 
2 RxBuff->65 
3 RxBuff->65 
4 RxBuff->4B 

the correct anwer is 0D 00 65 00 01 07 00 60 4C 00 C9 FF C6

What’s wrong?

Thanks

Without knowing any of the technical details of the device you are talking to, I would say it looks like a valid response, since the data is in exactly the same format as the command you sent.

To me this suggests that the device can operate in several modes, and is replying in a mode other than one you are expecting.

This means that you probably need to look a bit closer at your initialisation code, maybe there’s something not quite right there?

Also worth checking that the device definately needs 8Bit with Even parity - many devices will only do parity with 7 bit data. (Just a guess since I have no details on the MR101).

Yesterday i found what was wrong. It was the serial cable.
I built a brand new cable with 3 wire in the correct manner.
It works good.
Some times we have to look behind the problems!

Thanks for the answer
Have a good day

Alex