quilong
Joined: 17 Sep 2009 Posts: 2
|
RFID 125khZ_PIC16F877a_Reder(4095)+tag em4102+tag t5557 |
Posted: Thu Nov 12, 2009 6:53 am |
|
|
I'm designing a circuit for reading tag em4102 and writing tag T5557(Atmel). But I have some problems.
The first, I use this code for reading tag em4102.
Code: | #include <16f877a.h>
#include <def_16f877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,NOBROWNOUT,PUT
#include <em4095.c> // Controls the reader IC
#include <em4102.c> // Allows reading 4102 transponders
#use delay(clock=20000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
int8 msg[32];
void main()
{
int8 customerCode;
int32 tagNum;
rf_init(); // Initialize the RF reader
rf_powerUp(); // Power up the antenna
for(;;) {
if(read_4102(msg)) {
customerCode = msg[0];
tagNum = make32(msg[1], msg[2], msg[3], msg[4]);
printf(msg, "Customer Code: %u\n\r", customerCode);
puts(msg);
printf(msg, "Tag Number: %lu\n\n\r", tagNum);
puts(msg);
led=1;
}
}
} |
If It read succesfully, I will get tag num and customer code and will be power up led. But It doesn't work. I thinks my hardware is correct. Somebody help me, pleaze.
|
|