Microcontroller › PIC › RFID interfacing with pic › the above rfid interfacing to
March 15, 2014 at 8:56 am
#11304
Participant
the above rfid interfacing to pic18f4550 code is not working …please suggest the right code as fast u can
#include <p18f4550.h>
/*The following lines of code perform interrupt vector relocation to work with the USB bootloader. These must be used with every application program to run as a USB application.*/
#pragma code
#pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
void _high_ISR (void)
{
_asm goto change _endasm
}
#pragma code _LOW_INTERRUPT_VECTOR = 0x000818
void _low_ISR (void)
{
;
}
#pragma code
void change(void)
{
INTCON3bits.INT1IF = 0;
}
#define FREQ 12000000
#define baud 9600
#define spbrg_value (((FREQ/64)/baud)-1)
#define rs PORTAbits.RA0
#define rw PORTAbits.RA1
#define en PORTAbits.RA2
#define lcdport LATB
unsigned char rx_data();
void lcd_ini(void);
void lcdcmd(unsigned char);
void lcddata(unsigned char);
void MsDelay(unsigned int delay);
unsigned char data[] =”unique ID No.”;
unsigned char card_id[12];
unsigned int i=0,pos;
void main()
{
TRISB=0; // set port B as output port
LATB=0;
TRISA=0;
LATA=0;
SPBRG=spbrg_value; // fill SPBRG reg to set the baud rate
RCSTAbits.SPEN=1; // to activate serial port (Tx and Rx pins)
RCSTAbits.CREN=1; // to enable continuous reception
PIE1bits.RCIE=1; // to enable the reception (RX)interrupt
INTCONbits.GIE=1;
INTCONbits.PEIE=1;
lcd_ini(); // lcd initialization
while(data!=’