Hitag 2 RFID help

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
mrclauds
Posts: 14
Joined: Fri May 13, 2011 6:25 pm
Has thanked: 3 times
Been thanked: 2 times

Hitag 2 RFID help

Post by mrclauds »

Hi everyone...

Im struggling with the rfid a little and was hoping someone could give me some guidance...
The module I am using is : http://docs-europe.electrocomponents.co ... 813104.pdf
Pic16F877A

I've gone through the examples and cant seem to make heads or tails out of it as i cant get it to work with my module...
I want to bit bang and not use the UART Rx and Tx as it is already being used for PC communications...
Could someone show me how to do it please and explain how and why is was done so I can understand it and be able to apply it to future projects?
Also, where would I find the information on what each command under rfid does?
Read UID
Read block
read buffer
Write etc...
Not sure what each one is doing exactly...
Using Hitag 2 in password mode, Please tell me if this is correct?
I must read buffer to get tag password
write buffer to reply with reader password
read block to see data on card?

Also, I was able to make a small program to read a 4001 tag with just it's ID using read buffer and then display it on a screen...
The problem is that when I put another tag over reader it still shows me the original tags ID? I must reprogram the system and shut it down to get it to read each new tag ID?
I assume this is due to the module reading the tag and keeping that data in it' own buffer and I simply read it over and over, how would I clear the modules buffer so it can pick up the new tags ID?

If someone could explain how flowcode is communicating with the chip, then I might be able to understand what is going on...

Thanks
Clauds

mrclauds
Posts: 14
Joined: Fri May 13, 2011 6:25 pm
Has thanked: 3 times
Been thanked: 2 times

Re: Hitag 2 RFID help

Post by mrclauds »

I've managed to come right with regards to reading the rfid tag using lots of trial and error...
I'm still stuck with regards to using the rfid without using the chips UART though?

Am i going to have to bit bang each command individually?
Or can I still use the standard RFID macros somehow?

Thanks
Clauds

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Hitag 2 RFID help

Post by Benj »

Hello Clauds,

You can move the RFID component to use a bit bandged serial UART rather then the standard hardware UART by using the code customization feature. Select the RFID component on the panel and then click the custom code button on the properties pane. You will need to edit the following sections of code.

Initialisation
SendRS232Char
ReceiveRS232Char

You can find examples of the code for the software bit banged operation from the RS232 component C file.

If you get stuck then attach your program to the forums and your customized component functions will be retained in the file for us to look at.

mrclauds
Posts: 14
Joined: Fri May 13, 2011 6:25 pm
Has thanked: 3 times
Been thanked: 2 times

Re: Hitag 2 RFID help

Post by mrclauds »

Thanks Benj

I was thinking of changing the pc comms over to bit banged and keep the rfid on UART...
Is there any reason why I shouldn't?
I assume the reliability of the bit banged protocol is as good as the inbuild UART provided the coding is well done right?
If so, then it will be simpler to have comms with PC via bitbanging and RFID on UART...

Thanks
Clauds

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Hitag 2 RFID help

Post by Benj »

Hello Clauds,

Yes that is probably a better option as the code is already there to do the bit banging for the serial comms. The bit banging code should work ok at the default clock speed of 19.6608MHz and a few others but we have modified the code for the new release to provide more accurate timing across the board. Give it a go and let me know if you have any problems.

mrclauds
Posts: 14
Joined: Fri May 13, 2011 6:25 pm
Has thanked: 3 times
Been thanked: 2 times

Re: Hitag 2 RFID help

Post by mrclauds »

Thanks very much :)

Post Reply