Microcontroller › AVR › copying rfid tag no in an array for comparision › about rfid tag no
thank you dagakshay sir for your help .
i am working with your ref isr.
i want to know about rfid tag no.
i have three tag
3E009341E60A card 1
3E0093521CE3 card 2
3E0093491BFF card3
these are ascii values seen on realterm
their hex valuies are
03 33 45 30 30 39 33 34 31 45 36 30 41 0A 0D card 1
03 33 45 30 30 39 33 35 32 31 43 45 33 0A 0D card 2
03 33 45 30 30 39 33 34 39 31 42 46 46 0A 0D card 3
now can you tell me please about start bit stop bit & how much should be my array size and which element i should copare if i want to conpare A or F or 3 i.e. last charactor of tag no.
i have modified code as follows.
thanks again;
//Program to receive a 12 byte string from RFID and display it on LCD using serial interrupt
#define F_CPU 16000000UL
#include<avr/io.h>
#include<util/delay.h>
#include<avr/interrupt.h>
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) – 1)
#define LED PORTA
#define LED0 PA0;
#define LED1 PA1;
#define LED2 PA2;
#define unsigned char mybyte[14], i=0;
void usart_init()
{
UCSRB |= (1<<RXCIE) | (1 << RXEN) | (1 << TXEN); // Turn on the transmission and..
// reception circuitry
UCSRC |= (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit character sizes
UBRRL = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value..
// into the low byte of the UBRR register
UBRRH = (BAUD_PRESCALE >> ; // Load upper 8-bits of the baud rate value..
// into the high byte of the UBRR register
}
int main(void)
{
DDRA=0xff; // LED_DATA port as output port
cli();
usart_init();
_delay_ms(50); // delay of 50 mili seconds
sei();
while(1);
return 0;
}
ISR (USART_RXC_vect)
{
for(i=0;i<=13;i++)
{
mybyte=UDR;
}
if(mybyte[1]= = ‘A’)
LED=(1<<LED0);
if(mybyte[1]= =’F’)
LED=(1<<LED1);
if(mybyte[1]= = ‘3’)
LED=(1<<LED3);
_delay_ms(1000);
LED=0;
}