Hi,
how can i use wiegand protocol via interrupt?
pls help
baris@ulgen.com.tr
wiegand
-
- Posts: 15
- Joined: 09 May 2008 18:34
Re: wiegand
i write programme and this is work with out interrupt.
Code: Select all
program wiegand26
' Lcd module connections
dim LCD_RS as sbit at RB4_bit
LCD_EN as sbit at RB5_bit
LCD_D4 as sbit at RB0_bit
LCD_D5 as sbit at RB1_bit
LCD_D6 as sbit at RB2_bit
LCD_D7 as sbit at RB3_bit
LCD_RS_Direction as sbit at TRISB4_bit
LCD_EN_Direction as sbit at TRISB5_bit
LCD_D4_Direction as sbit at TRISB0_bit
LCD_D5_Direction as sbit at TRISB1_bit
LCD_D6_Direction as sbit at TRISB2_bit
LCD_D7_Direction as sbit at TRISB3_bit
' End Lcd module connections
dim wiegand, buffer as longint
dim ar1, at1 as word
dim num as string[8]
dim fcl as string[8]
dim cnt, even, odd as byte
dim ID as string[11]
dim sayi as string[8]
main:
ADCON1 = 0x0F ' Configure AN pins as digital I/O
cmcon = 0x07
PORTA = 255
TRISA = 255
PORTD = 0
TRISD = 0
cnt = 0
wiegand = 0
num = 0
lcd_init()
lcd_cmd(_LCD_CURSOR_OFF)
lcd_cmd(_LCD_FIRST_ROW)
while TRUE
if porta.0 = 0 then
delay_us(500)
wiegand = wiegand << 1
cnt = cnt + 1
end if
if porta.1 = 0 then
delay_us(500)
wiegand = wiegand << 1
wiegand = wiegand or 0x00000001
cnt = cnt + 1
end if
if cnt = 26 then
lcd_cmd(_LCD_FIRST_ROW)
wiegand = wiegand >> 1
buffer = wiegand and 0x00FF0000
buffer = buffer >> 16
at1 = buffer and 0x000FFFFF
ar1 = wiegand and 0x0000FFFF
longinttostr(wiegand, ID)
bytetostr(at1, fcl)
wordtostr(ar1, num)
lcd_out(1,1,"FACILITY : ")
lcd_out_cp(fcl)
lcd_out(2,1,"ID NUMBER: ")
lcd_out_cp(num)
cnt = 0
wiegand = 0
end if
wend
end.
Re: wiegand
got problem with this code.
on card (wiegand id): 0009079479 138,35511
data received: fc1=30024, num=117
0003058857 046,44201
received: 21334, 209
on card (wiegand id): 0009079479 138,35511
data received: fc1=30024, num=117
0003058857 046,44201
received: 21334, 209
- petar.timotijevic
- mikroElektronika team
- Posts: 1739
- Joined: 19 Feb 2014 13:46
- Location: Serbia
- Contact:
Re: wiegand
Hi,
Please see source code example for RFID Reader board:
www.mikroe.com/downloads/get/247/rfid_examples.zip
RFid Reader Board
http://www.mikroe.com/add-on-boards/var ... id-reader/
http://www.libstock.com/projects/view/3 ... h-4-relays
Best regards,
Peter
Please see source code example for RFID Reader board:
www.mikroe.com/downloads/get/247/rfid_examples.zip
RFid Reader Board
http://www.mikroe.com/add-on-boards/var ... id-reader/
http://www.libstock.com/projects/view/3 ... h-4-relays
Best regards,
Peter