Read RFID reader data on Cerbuino Bee

@ Dave McLaughlin -

Fully Yes, D0 and D1 are TTL 0/5V compliant. Interal PullUp is also often provided by the Reader so that an InterrputPort with EdgeLow trigger is sufficient !

Advantage of this against RS232 is that you have plenty of Inputs on a chip, where you do not have so many RS and often you need RS to be used for dialing instead of just reading datas from a “passive” peripheral…

I think, it would be nice to have code sample for the less experienced.

@ julien.pierre -

In pseudo language, I would say :

//
Define a STRING Wiegand_Code as default EMPTY;

Define a INTERRUPTPORT D0 as default HIGH;
Define a INTERRUPTPORT D1 as default HIGH;

Define an EVENT D0_Evt as EDGELOW;
Define an EVENT D1_Evt as EDGELOW;

Define an INT Code_Length as default 26;
//

CODE :

D0_Evt_ONINTERRUPT
{
ADDCHAR(‘0’) TO Wiegand_Code;
IF (LEN(Wiegand_Code) == Code_Length)
{
Print WIegand_Code;
Wiegand_Code = EMPTY;
}
}

D1_Evt_ONINTERRUPT
{
ADDCHAR(‘1’) TO Wiegand_Code;
IF (LEN(Wiegand_Code) == Code_Length)
{
Print WIegand_Code;
Wiegand_Code = EMPTY;
}
}

Very schematic I recognize :slight_smile: but it will work !