Weigand to RS232 in PBPBasic?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156

    Default Weigand to RS232 in PBPBasic?

    Hi,

    I only find one post regarding Weigand to RS232, and its in assy. Has anybody tried a converter in PBP?

    Len

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    circuitpro , 29 bit, 32 bit? Hand shaking? Just to say Weigand doesn't give much info...

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Sorry. I'm just trying to understand the technique involved, really. I think that any wiegand pbp application would show me that, but specifically I am interested in a 26 bit application. It seems like you could just use two interrupts to put an ascii word together, but the problem there is recognizing the end of the transmission. Needless to say, I'm a little confused about how to begin with this, (and of course the clock keeps ticking).
    Last edited by circuitpro; - 2nd September 2010 at 17:31.

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Yes, it is as simple as using two interrupts and forming a word from the interrupts. The length of the bits doesn't matter in the least - it can be as long as necessary. That's how all these 'custom' variations come about. After the timeout period (forgot what it's called right now), that marks the end of the word.

    Thanks to DT_Ints, it's very simple, and checks out by comparing to a prox reader with a RS232 output. ;-)

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default

    Wiegand has very short pulses of the order of 50uSec. PBP interrupts or DT-INTS need a very fast say 40MHz controller to catch these pulses.

    I had found a reader that happened to be slower, I mean the low going pulses were over 175uSec. But that is not the case always.

    Darrel had helped me alot to reduce the latency of the Intterupts but was not possible to catch the 50uS at 4 or 8MHz system clock.

    I used another method in a tight loop and was able to work at 4MHz clock.

    Code:
    mainloop:
    if d0=0 then                'Wiegand D0 line read
        array[index]=0          'at 4MHz reads 50usec pulses!
        index=index+1          'Increment array index
        while d0=0:wend          'Wait for D0 line to go high
        endif
    if d1=0 then          'Eiegand D1 line read
        array[index]=1
        index=index+1
        while d1=0:wend
    endif
    if index=26 then convert    'If 26 bits read, convert to ASCII
    goto mainloop
    Ioannis

  6. #6
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Yeah, every once in awhile, alot of software headaches can be instantly cured with a $.15 flip-flop!

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default

    I do not quite follow... How does a F.F. relate to the case?

    Ioannis

  8. #8
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    looked too quickly. I was looking into hardware decoding, or at least helping the micro out with a little hardware. it's only a NAND gate, but a 40 mhz clock works fine. (also found out in the process that a PIC18F4685 makes a nice 'upgrade' to the PIC16F877A in a LAB-X1 board).

    http://www.siliconchip.com.au/cms/A_107882/article.html

    http://docs.tibbo.com/taiko/index.ht...egand_mode.htm

    happy decoding.

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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