How wiegand rfid interface with pic18f4520

RFID reader, Reader/Writer, Tag.....

How wiegand rfid interface with pic18f4520

Postby rachel.tan » Sat Feb 23, 2013 9:15 am

Hi, im sucks in programming, i need help in wiegand rfid c programming in mplab c18 complier. Im using PIC18f4520 and c language . I've changed all the configuration of PIC16 to PIC18, why is the code not working? How to read the tag number and display it on LCD? Do i need to use any wiegand to uart converter or i can just get my results through the PIC port(connect the data0 and data1 to RC1 and RC2)? Or i must get my result through the RS232? PLease help. (
rachel.tan
Freshie
 
Posts: 4
Joined: Sat Feb 23, 2013 9:08 am

Re: How wiegand rfid interface with pic18f4520

Postby robosang » Sat Feb 23, 2013 3:52 pm

Are you sure you upgrade the code correctly? A single wrong configuration bit might cause nothing to work even the rest of program is correct. :mrgreen:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: How wiegand rfid interface with pic18f4520

Postby rachel.tan » Sat Feb 23, 2013 4:26 pm

for pic16f876A in assembly language is __config(0x3F32)
for pic18f4520 in C language is
#pragma config OSC = RCIO6
#pragma config FCMEN = OFF
#pragma config IESO = OFF
#pragma config PWRT = OFF
#pragma config BOREN = SBORDIS
#pragma config BORV = 0
#pragma config WDT = ON
#pragma config CCP2MX = PORTC
#pragma config PBADEN = ON
#pragma config LPT1OSC = OFF
#pragma config MCLRE = ON
#pragma config STVREN = ON
#pragma config LVP = ON

is it correct??
rachel.tan
Freshie
 
Posts: 4
Joined: Sat Feb 23, 2013 9:08 am

Re: How wiegand rfid interface with pic18f4520

Postby robosang » Sat Feb 23, 2013 4:35 pm

I wonder how you translate it?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: How wiegand rfid interface with pic18f4520

Postby shahrul » Sat Feb 23, 2013 7:04 pm

This is my configuration. I'm lazy, that's why I'm doing this and auto select PIC configuration.
CODE: SELECT_ALL_CODE
#if defined (_16F777)
   __CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & BOREN_OFF & MCLRE_ON & CCP2MX_RC1);
   __CONFIG(FCMEN_OFF & IESO_OFF);
   #define _XTAL_FREQ    20000000
#elif defined (_16F877A)
   __CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & BOREN_OFF & LVP_OFF);
   #define _XTAL_FREQ    20000000
#elif defined (_16F887)
   __CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & BOREN_OFF & CP_ON & MCLRE_ON &   LVP_OFF);
   #define _XTAL_FREQ    20000000
#elif defined (_18F4520)
   __CONFIG(1,HS & FCMDIS & IESODIS);
   __CONFIG(2,PWRTEN & BOREN & BORV20 & WDTDIS & WDTPS32K);
   __CONFIG(3,CCP2RC1 & PBADDIS & LPT1DIS & MCLREN);
   __CONFIG(4,XINSTDIS & STVREN & LVPDIS & DEBUGDIS);
   __CONFIG(5,UNPROTECT);
   __CONFIG(6,UNPROTECT);
   __CONFIG(7,UNPROTECT);
   #define _XTAL_FREQ    20000000
#elif defined (_18F4550)
   __CONFIG(1,USBOSC & CPUDIV1 & PLLDIV5 & HSPLL  & FCMDIS & IESODIS);
   __CONFIG(2,VREGEN & PWRTEN & BOREN & BORV20 & WDTDIS & WDTPS32K);
   __CONFIG(3,CCP2RC1 & PBADDIS & LPT1DIS & MCLREN);
   __CONFIG(4,XINSTDIS & STVREN & LVPDIS & ICPORTDIS & DEBUGDIS);
   __CONFIG(5,UNPROTECT);
   __CONFIG(6,UNPROTECT);
   __CONFIG(7,UNPROTECT);
   #define _XTAL_FREQ    48000000
#elif defined (__dsPIC30F4013__)
   __CONFIG(FOSC, HS);
   __CONFIG(FWDT, WDTDIS);
   __CONFIG(FBORPOR, MCLREN & BORDIS & PWRT64);
   __CONFIG(FGS, GCPU & GWRU);
   __CONFIG(FICD, PGEMU);
   #define _XTAL_FREQ    20000000
#else
   #error PIC not support
#endif
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: How wiegand rfid interface with pic18f4520

Postby rachel.tan » Sat Feb 23, 2013 8:53 pm

Thank you very much! :)
rachel.tan
Freshie
 
Posts: 4
Joined: Sat Feb 23, 2013 9:08 am


Return to RFID

Who is online

Users browsing this forum: No registered users and 4 guests

cron