Page 1 of 1

RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Mon Sep 10, 2012 8:28 pm
by pikachuX
1) Can this RFID Reader work with PIC16F877A?
2) Did the reading can send to computer?

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Mon Sep 10, 2012 9:46 pm
by shahrul
pikachuX WROTE:1) Can this RFID Reader work with PIC16F877A?
2) Did the reading can send to computer?

Since you ask can or not, not ask how. So, I answer yes for both question. :)

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 11, 2012 6:34 am
by pikachuX
I currently is beginner for RFID.
Did any tutorial for RS232 send output to computer using PIC16877A?

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 11, 2012 8:23 am
by shahrul
pikachuX WROTE:I currently is beginner for RFID.
Did any tutorial for RS232 send output to computer using PIC16877A?

CODE: SELECT_ALL_CODE
uart_string("TEST");
uart_write(0x0D);

function
CODE: SELECT_ALL_CODE
   void uart_init(unsigned int baudrate)
   {
   TRISC7=1;
   TRISC6=0;
   #if defined (_16F877A)
      TXSTA=0b00100000;   
      RCSTA=0b10010000;
      if(baudrate<=38400){
         BRGH=0;
         SPBRG=(int)(_XTAL_FREQ/(64.0*baudrate)-1);}
      else{
         BRGH=1;
         SPBRG=(int)(_XTAL_FREQ/(16.0*baudrate)-1);}   
   #endif
   #if defined (_16F886) || (_16F887)
      TXSTA=0b00100000;   
      RCSTA=0b10010000;
      if(baudrate<=38400){
         BRGH=0;
         SPBRG=(int)(_XTAL_FREQ/(64.0*baudrate)-1);}
      else{
         BRGH=1;
         SPBRG=(int)(_XTAL_FREQ/(16.0*baudrate)-1);}
      BAUDCTL=0;
      SPBRGH=0;   
   #endif
   #if defined (_18F2550) || (_18F4550)
      TXSTA=0b00100000;   
      RCSTA=0b10010000;
      BAUDCON=0;
      SPBRG=(int)(_XTAL_FREQ/(64.0*baudrate)-1);
   #endif
   }

   void uart_write(char data)
   {
   while(TXIF==0) continue;
   TXREG=data;
   }
   
   void uart_string(const char *s)
   {
   while(*s) uart_write(*s++);
   }

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 11, 2012 1:51 pm
by hyng
Have you go through this DIY? This project use PIC16F876A instead of 877A.
http://www.cytron.com.my/viewProduct.php?pid=ExUoFhQNEwkWCyklKREgO2IGmqiNPZZB49SjdeVTBfM=

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 18, 2012 10:59 am
by pikachuX
Did the RFID Reader RS232 need the Max232 driver ? or Max232 driver already consist in RFID Reader RS232 itself?

Reference:
http://shahrulnizam.com/max232-driver/

Actually i want to read the tag ID from the RS232 reader and send it to my programming which Value = Tag ID that i scan.

This is my code:
<input type="text" name="Tag_ID" Value="Tag ID">

Thanks

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 18, 2012 12:11 pm
by gadgetng
pikachuX WROTE:Did the RFID Reader RS232 need the Max232 driver ? or Max232 driver already consist in RFID Reader RS232 itself?

If you want to interface the reader to UART of PIC, you can use this
http://www.cytron.com.my/viewProduct.php?pcode=URS232A&name=UART%20to%20RS232%20Converter

or you can follow the DIY PR8-B method (refer to the schematic).

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Tue Sep 18, 2012 4:51 pm
by shahrul
At first I test the RFID Reader, I don't see in the datasheet either the signal use uart or rs232, then what I do is measure the voltage at signal pin. If uart the voltage from 0V to 5V, or rs232 the voltage from -12V to 12V. What I measure, I get above 5V. (not exactly get 12) so I know that is rs232.

You can use MAX232 as interface or can do circuitly to change
-12 become 5V and 12V become 0V since it's only 1 direction, from RFID to PIC. You can see http://shahrulnizam.com/pic-lesson-rfid-reader

Re: RFID Reader-RS232 Work with PIC16F877A?

PostPosted: Wed Sep 19, 2012 10:48 pm
by pikachuX
Thanks for the information that you give,i will try it myself :lol: