Okay i have this rfid module which has a serial UART interface
Its been a pain in the backside for three days now and i'm getting really fraustrated so it's time to call in the LMR professionals!
My problem consists of two, maybe more issues which i'm having a hard time with and im sure you would to if you was a noob with rfid modules so here is my problem
Here is the module http://www.elechouse.com/elechouse/images/product/13.56MHZ_RFID_Module/13.56MHZ_RFID_Manual.pdf
I'm trying to figure out how to write properly to the card
Here is some code i wrote:
void write_string_to_card(unsigned char key_type, unsigned char *key, unsigned char block_number, unsigned char *string)
{
unsigned char command_buf[30];
unsigned char i;
command_buf[0] = 0xAB; /** data frame head */
command_buf[1] = 0x1A; /** data frame length */
command_buf[2] = 0x04; /** COMMAND: write data to a block */
command_buf[3] = block_number;
command_buf[4] = key_type;
/** frame key area initialize */
for(i=0; i<8; i++)
{
command_buf[5+i] = key[i];
}
/** frame data area initilize */
for(i=0; i<16; i++)
{
command_buf[12+i] = string[i];
}
/** send frame through serial port*/
for(i=0; i<27; i++)
{
Serial3.write(command_buf[i]);
}
Serial.println("Written to card");
}
void setup()
{
Serial.begin(9600);
Serial3.begin(9600);
}
void loop()
{
unsigned char string[16] = "HI, RFID";
unsigned char key[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,};
/** send string use 0 type key to 3rd block */
write_string_to_card(0, key, 3, string);
delay(2000); /** Delay to write to the card next time */
}
Now even after i do this it writes to the card but i'm also having an issue reading the cards 3rd block
So i'm wondering if anyone can help me out by creating two arduino sketches to read/write to/from the same area of the rfid tag
Please let me know if y need more information!
-Elitism