Wiegand data and com port


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    ARES's Avatar
    ARES Guest

    Default Wiegand data and com port

    I have a reader (HID Prox Point) and it sends data in wiegand format.I want to read this data from com port.Help me about this circuit.How can i do this type of circuit.

    Thanx,

  2. #2
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    It's quite simple. Device sends pulse on Data0 if it wants to signal that bit =0 and vide versa. There are 26 or sometimes 40 bits including parity in beginning and end.
    Have wrote decoder with rs232 output for 12F629 and 16F628. I will post code, if interested.

  3. #3
    Join Date
    Jan 2005
    Location
    Australia
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile

    Dear Felch,

    I am interested in your work. Could you please post your Weigand code? Thank you.
    Yuantu Huang

  4. #4
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Hi!
    You'll find the code at http://parsek.yf.ttu.ee/~felc/proximity.asm
    It is a single chip proximity card reader decoder that outputs 6 char (ASCII) number of the card if pin PIC's named "enable" is at high level. Discards readers parity bits (i found that they make no errors anyway...so far). Output parameters: 4800,n,8,1, bit-banged I/O. Critical to correct reading of OSCCAL value of PIC12F629. Be sure not to spoil it when burning the chip!!!
    Although comments are in estonian (my native tongue) , definitions should be understandable. Mail and ask if anything remains unclear.
    Code not for commercial use !
    Happy PIC-ing!
    /Felch

  5. #5
    Join Date
    Jan 2005
    Location
    Australia
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Dear Felch,

    Thank you very much for your code. I am now implementing 8 card readers (both Track2 and variable length Weigand) on a single 16F737 using PICbasic Pro. Currently I have a problem for PIC18F8720 to access 2MB EMI using PICbasic Pro.

    I will let you know once I implement 8 card readers on a single PIC.

    Best regards,
    Yuantu Huang

  6. #6
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Nice to hear that this piece of code is useful.
    I was thinking about adding another proximity reader to the same PIC myself too but it was a little bit difficult. As you may have noticed, HID readers are critical: they give a very short pulse (about 40uS) but on the other hand their data "packet" lasts very long (about 70 mS!!).
    Long packet is not a problem of course but it takes nearly 36uS for a PIC running @4MHz to branch form "everyday jobs" to card reading.
    So if i have 2 readers active at the same PIC chip, it really puts it on the edge.

  7. #7
    alind's Avatar
    alind Guest


    Did you find this post helpful? Yes | No

    Default 8 card readers

    Yuantu,
    I was very interested to hear about your plan to implement 8 card readers.
    How did you get on?
    I am keen to do the same thing, but figured it would be necesary to have a seperate PIC for each reader...
    Allan


    Quote Originally Posted by Yuantu Huang
    Dear Felch,

    Thank you very much for your code. I am now implementing 8 card readers (both Track2 and variable length Weigand) on a single 16F737 using PICbasic Pro. Currently I have a problem for PIC18F8720 to access 2MB EMI using PICbasic Pro.

    I will let you know once I implement 8 card readers on a single PIC.

    Best regards,

  8. #8
    samiassaad's Avatar
    samiassaad Guest


    Did you find this post helpful? Yes | No

    Default help me

    Hi sir/
    I am using PIC16F877 to read weigand data from a HID card reader proxpoint. I am using 24 bits crad , 8 bits is site code and 16 bits card number. Also there is 2 extra bits added by the reader called parity bit, please could you tell me about the parity bits? DO they implement as logic 0 or logic 1?
    also could you tell me about weigand protocol, the order of data in it? and I will be very thankul.
    Best Regards
    Sami Assaad

  9. #9
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    A copy of my reply to somebody who asked questions like yours. Hope it helps you .
    --------------
    Hi!
    Wiegand timing is a difficult question. I found one doc ( http://parsek.yf.ttu.ee/~felc/Wiegand2.pdf ) but in reality it looks different and depends much on manufacturers ...ee...fantasy ? Anyway, working principle is always the same, like described in the pdf.
    About code. Are the files, mentioned in my postings missing? There should be full Prox reader code for PIC12F629 and essential part for PIC16F628 reading 2 readers simultaneously. Heavily commented.
    In assembly, of course

    rgds,
    /Felch

    PS. If you still have questions, drop me a mail
    PS. will copy the same contents to forum also, may-be somebody needs it.
    ------------------------

    /Felch

  10. #10
    pmatyas's Avatar
    pmatyas Guest


    Did you find this post helpful? Yes | No

    Default Hi

    I'm interested your converter, can you send mee an schematic and program source in PIC 16f628?

    regards,
    Mathias

    Quote Originally Posted by Felch View Post
    It's quite simple. Device sends pulse on Data0 if it wants to signal that bit =0 and vide versa. There are 26 or sometimes 40 bits including parity in beginning and end.
    Have wrote decoder with rs232 output for 12F629 and 16F628. I will post code, if interested.

  11. #11
    jose pascoal's Avatar
    jose pascoal Guest


    Did you find this post helpful? Yes | No

    Thumbs up wiegand to rs232 ready to use

    found this one, ready, tested & cheap

    http://www.etconcept.com/Security.htm

  12. #12
    Join Date
    May 2008
    Location
    Durban, South Africa
    Posts
    2


    Did you find this post helpful? Yes | No

    Thumbs up Wiegand to RS485

    Hi Felch,

    I think you have done a fantastic job and thanks for sharing. I am also new to this but it all makes sense and can't wait to get my hands on the microchip and start experimenting. While I'm still finding my feet please can I ask your help (which I am sure won't be too difficult)? I need to convert the 26bit Wiegand to RS485 for the sake of reading up to 1.2 Kms away. If its not to difficult do you think you could post modified code for me?

    Many many thanks!

    Richard.

  13. #13
    fdmourao's Avatar
    fdmourao Guest


    Did you find this post helpful? Yes | No

    Default RS232 to Wiegand

    Hi,
    I'm a newbie working with PIC's, but I'm trying to develop a converter from a RS232 signal to a Wiegand 26 bit's.
    Can somebody help me to know where can I start from? What PIC will I choose? Is the code shown on this thread to do the inverse conversion a good starting point?

    Thanx in advance.

    Francisco

  14. #14
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fdmourao
    Hi,
    I'm a newbie working with PIC's, but I'm trying to develop a converter from a RS232 signal to a Wiegand 26 bit's.
    Can somebody help me to know where can I start from?...
    Francisco
    Hi!
    This piece of code sends contence of databuf to PIC's pins in pseudowiegand format. Hope it helps. (Comments translated to english, i do not expect you to understand estonian....)
    http://parsek.yf.ttu.ee/~felc/wiegand.asm

  15. #15
    markocosic's Avatar
    markocosic Guest


    Did you find this post helpful? Yes | No

    Default

    Hi!

    I'm trying to read RFID tags using an HID Corp reader (the OEM150), store the ID numbers of the RIFD tags that get read (up to 12 of them) on the microcontroller, transmit the ID numbers of the RFID tags in memory via 'one-way-RS232' to another device then reset the reader ready to scan more RFID tags. The device doesn't need to 'scan' and 'transmit' at the same time.

    (its something to be used on a 'treasure hunt' of sorts and needs to communicate via RS232)

    Would a PIC12F629 be able to do this? Could your code be adapted? I'm a mechanical engineer that knows enough about PICs to flash LEDs but that's about the limit at the moment!

    Thanks,

    Marko

  16. #16
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Yes, i guess that the code could be adapted. You only have to write a routine for storing numbers in EEPROM. Only thing that might get disturbing is PIC's oscillator frequency deviation due to temperature. It might affect RS232. Test it before hunting real treasures .)

  17. #17
    markocosic's Avatar
    markocosic Guest


    Did you find this post helpful? Yes | No

    Default

    Good warning on the temperature variation - a larger pic and external xtal (or something like a 16F88 with internal crystal/more acpability than is needed?) might be required.

    I don't suppose you could re-post the 12XXXX IC code could you (my email is mac65 <at> cam.ac.uk if you'd prefer to send it by mail) as the web-links above are broken.

    Thanks,

    --
    Marko (working his way through the PIC instruction sets as bed-time reading!)

  18. #18
    Join Date
    Mar 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Wiegand to RS232 interface

    Felch

    i have been reading this thread, and quite interest to build one, but the link you posted has been broken, can you post the proximity.asm again?

    can i have both asm and hex file for PIC12F629?

    Thanks!

    William
    Last edited by hkwkok; - 1st March 2007 at 07:22.

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    For me the link is OK.

    Here it is:

    ;================================================= ==============================
    ;******************** xmit some bytes from buffer to PORTB pins6,7 *************
    ;================================================= ==============================
    Send_Coins_1: movlw Puhver
    movwf FSR
    movf INDF,W ; read timeout value sent by host
    movwf temp
    movlw 0xFF
    movwf T2CON
    send_c_0: clrf TMR2
    bcf PIR1,TMR2IF
    send_c_1: btfss Nupp ; are we allowed to transmit wiegand ?
    goto send_c_2 ; yep!
    btfss PIR1,TMR2IF ; no, wait until allowed or timeout
    goto send_c_1
    decfsz temp
    goto send_c_0
    bcf PIR1,TMR2IF
    bcf T2CON,TMR2ON
    goto send_c_fail ; taimaut: ****ing off...
    send_c_2: bsf pank
    bcf TRISB,6 ; permission granted, switch port pins to outputs
    bcf TRISB,7
    bcf pank
    bsf Dat0B ; pins also, not only direction
    bsf Dat1B
    call taimer ; take a break
    incf FSR,F
    movf INDF,W
    movwf count ; read nr. of bytes to be transmitted
    send_c_3: incf FSR,F
    movf INDF,W
    movwf tomp1
    call xmit_wieg ; read byte form "Puhver" and xmit
    decfsz count
    goto send_c_3 ; until bored
    bsf pank
    bsf TRISB,6 ; Wiegand port B as input again
    bsf TRISB,7
    bcf pank
    bsf Dat0B
    bsf Dat1B
    send_c_fail: movlw HIGH main_15
    movwf PCLATH
    goto main_15 ; return to housekeeping tasks, restore PCLATH
    ;================================================= ==============================
    ; ******************** xmiting junk in wiegand format ************
    ;================================================= ==============================
    xmit_wieg: movlw .8 ; 8 bits/byte
    movwf tomp
    xmit_wieg_1: rlf tomp1,F
    btfss CARRY ; form impulse to which pin ?
    goto xmit_wieg_2
    bcf Dat1B
    goto xmit_wieg_3
    xmit_wieg_2: bcf Dat0B
    xmit_wieg_3: call taimer50uS ; output LOW for about 50uS
    call taimer50uS
    bsf Dat0B ; lend of pulse, outputs HIGH
    bsf Dat1B
    call taimer3mS ; 3 mS pause
    decfsz tomp ; repeat it 8x
    goto xmit_wieg_1
    return
    taimer3mS: movlw 0x0F
    movwf T2CON
    clrf TMR2
    bcf PIR1,TMR2IF
    goto taimer_1
    taimer50uS: movlw 0x04
    movwf T2CON
    movlw 0x82
    movwf TMR2
    bcf PIR1,TMR2IF
    goto taimer_1
    taimer: clrf TMR2
    movlw 0xFF
    movwf T2CON
    bcf PIR1,TMR2IF
    taimer_1: btfss PIR1,TMR2IF
    goto taimer_1
    bcf PIR1,TMR2IF
    bcf T2CON,TMR2ON
    return

  20. #20
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by hkwkok View Post
    Felch

    i have been reading this thread, and quite interest to build one, but the link you posted has been broken, can you post the proximity.asm again?
    Linkworks but may-be there are problems in some servers. Anyway here it is attached.
    I can't give hex file, this is not a complete project but only fragment of a larger one.
    About reading distance: i have used cables (CAT5) up to 20 meters without problems.
    Attached Files Attached Files

  21. #21
    Join Date
    Mar 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Question wiegand

    Dear Felch,
    Sorry, i need the one is PROXIMITY.asm, which is you posted on 4th march 2005, and the link is http://parsek.yf.ttu.ee/~felc/proximity.asm still not working, is it complete project? if yes, can i have the hex file?
    By the way, how is James(jmaloway) done this project? I live in Canada too, can we share the experience?

    William

  22. #22
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Hi!
    Understood you wrong.
    Yes, proximity reader is a stand-alone device. Here's the complete project (MPLAB).
    Attached Files Attached Files

  23. #23
    Join Date
    Mar 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Thumbs up wiegand to rs232 convertion

    Fekch,
    Thanks for your files, actually i using the HID ProxPoint Plus reader(wiegand format), i want to convert it to rs232 format, because i have a lot of used proxkey on hand, but can't see the card number, can i use the Windows' HyperTerminal to retrieve the number?

    And my last question is the pin connection of PIC12F629 as below?
    Pin 1: +5V DC
    Pin 2: Prox reader "Data 0"
    Pin 3: Prox reader "Data 1"
    Pin 4: No Connection
    Pin 5: No Connection
    Pin 6: No Connection / +5V
    Pin 7: RS-232 Data out
    Pin 8: Ground

    No crystal is needed as the oscillation is taken care of by the internal oscillator.


    Thanks Again! i hope the project above can be done my work.


    Wiliam

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts