CONFIG HITAG
Contents |
Action
Configures the timer and HITAG variables.
Syntax
CONFIG HITAG = prescale, TYPE=tp, DOUT = dout, DIN=din , CLOCK=clock, INT=int
CONFIG HITAG = prescale, TYPE=tp, DEMOD= demod, INT=@int
Remarks
syntax for HTRC110
prescale |
The pre scaler value that is used by TIMER0. A value of 8 and 256 will work at 8 MHz. |
tp |
The kind of RFID chip you use. Use HTRC110. |
DOUT |
The pin that is connected to the DOUT pin of the HTRC110. This pin is used in input mode since DOUT is an output. A pin that support the pin-change interrupt or the PCINT should be selected. |
DIN |
The pin that is connected to the DIN pin of the HTRC110. This pin is used in output mode. You can chose any pin that can be used in output mode. |
CLOCK |
The pin that is connected tot the CLOCK pin of the HTRC110. This pin is used in output mode. You can chose any pin that can be used in output mode. |
INT |
The interrupt used. Note that you need to precede the interrupt with an @ sign. For example for INT1 you provide : @INT1 |
syntax for EM4095
prescale |
The pre scaler value that is used by TIMER0. A value of 8 and 256 will work at 8 MHz. |
tp |
The kind of RFID chip you use. Use EM4095. |
demod |
The pin that is connected to the DEMOD pin of the EM4095. This pin is used in input mode. A pin that support the pin-change interrupt or the PCINT should be selected. |
INT |
The interrupt used. Note that you need to precede the interrupt with an @ sign. For example for INT1 you provide : @INT1 |
The CONFIG HITAGE command will generate a number of internal used variables and constants.
Constants : _TAG_MIN_SHORT, _TAG_MAX_SHORT , _TAG_MIN_LONG and _TAG_MAX_LONG.
See the description of READHITAG to see how they are calculated. The actual value will depend on the prescale value you use.
Variables for HTRC110 :
_htr_statemachine , a byte that is used to maintain a state machine.
_htcbit , a byte that will hold the received bit.
_htcbitcount , a byte to store the number of received bits.
_htcmpulse , a byte that stores the pulse
_htr_pulse_state , a byte that is used to maintain the pulse state machine.
_htc_retries, a byte that is used for the number of retries.
_tagdelta , a byte that will held the delta time between 2 edges.
_tagtime , a byte with the actual timer0 value when an edge is detected.
_taglasttime , a byte with the previous edge time, needed to calculate the delta time.
_tagparbit , a byte that will held the parity.
_tagdata , a byte where the bits are stored before they are loaded into the serial number array.
_tagid , a word that points to the serial number array
The HTRC110.LBX contains a number of other constants that are used to control the HTRC chip.
The _init_Tag routine is called automatically.
The clock output of the Mega88 is used to drive the HTRC110. Since the clock output of the internal oscillator is 8 MHz, the HTRC110 is also configured to work at 8 MHz. The .equ for Tag_set_config_page3 = &H40 + 48 + Fsel0 in the LBX. You can set it to 12 and 16 MHz too but you can not drive it from the clock output then.
Variables for EM4095 :
_tagflag , a byte that stores the return flag that will be loaded with 1 when a valid tag is detected
_tag_insync ,a byte that is used to store the state of the bit stream.
_tag_bitcount , a byte that stores the total bits when not in sync yet
_tag_tbit , a byte that stores the total received bits
_tag_par , a byte that stores the parity
_tag_timeout ,a byte that is loaded with the time that will be tried to detect an RFID chip
_taglasttime , a byte that stores the last time a valid edge was detected
_tagid , a word that points to the serial number array
See also