Wiegand data and com port


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    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,

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


    Did you find this post helpful? Yes | No

    Default

    Hi!
    I have recalculated things and...actually it is not very difficult. I can now read 2 RFID-s simultaneously. I have PIC16F628 running at 11.0592MHz (comm's crystal). RFID's generate a port change interrupt and first thing the int routine does is saving readers port data.
    This is one possible way to solve the problem. Probably there are others as well.
    /Felch

    PS. I use assembly language, Basic seems to bee too slow.

  3. #3
    alind's Avatar
    alind Guest


    Did you find this post helpful? Yes | No

    Default

    Felch,
    I'd be keen to see your latest code for that.
    I guess you use the USART port for one of the inputs.
    I also use assembler. Check out my work, recompliing and adding SMTP and RTC support to a TCP/IP stack (with web browser) on a 18F452. It wasn't easy though.
    http://al.joho.com

    I am thinking of adding your Wiegand reader support to the stack to make a door access control system.
    Allan

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


    Did you find this post helpful? Yes | No

    Default

    Hi!
    My code is also used in a networked access system... I DID have to cut out some parts of it since i am not allowed to distribute it. Nevertheless i hope it will help you. Comments are in Estonian but code in pure assembly
    I do not use UART for RFID-s but RB4...RB7 port's port change int.
    Mail me if anything remains unclear or needs to be translated.

    /Felch
    PS. I am also working with radioactivity monitoring system. It will be something like a portable datalogger equipped with GPS. Data is stored on an MMS card. Presently busy with FAT code. How does your appartus look like?

    EDIT: It crossed my mind that if you have your readers data-pins, say D0, wire-ored together to generate an RB0-int, then read (in the int routine) readers ports and save them for processing, one could service 8 or even more RFID-readers. May-be even simultaneously if PIC is fast enough. In the int routine one only needs to shift some bits, that's all!
    This kind of approach seems to be used in commercial security systems.

    EDIT: Mistake in circuit - BUZ and LED are actually B-readers datapins D0 and D1 .
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Felch; - 19th August 2005 at 19:26.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Allan,

    I am using PIC16F737 internal clock 8MHz, Card 1 is connected to RA6 and RA7, Cards 2, 3, and 4 are connected to PORTC<0:2,5:7>, and Cards 5,6,7,and 8
    are connected to PORTB. All 16 card pins 1K resistors pull up to 5V.

    I use the following code to determine which card has presented.

    MainLoop:
    CurrCard = 0
    ' Card reader 1
    CheckPortA:
    TempVar = PORTA
    if TempVar < $C0 then CurrCard = 1 : goto FoundCard

    ' Card readers 5, 6, 7, and 8
    CheckPortB:
    TempVar = PORTB
    if TempVar < $FF then
    if TempVar.0 = 0 then CurrCard = 5 : goto FoundCard
    if TempVar.1 = 0 then CurrCard = 5 : goto FoundCard
    if TempVar.2 = 0 then CurrCard = 6 : goto FoundCard
    if TempVar.3 = 0 then CurrCard = 6 : goto FoundCard
    if TempVar.4 = 0 then CurrCard = 7 : goto FoundCard
    if TempVar.5 = 0 then CurrCard = 7 : gosub FoundCard
    CurrCard = 8
    goto FoundCard
    endif

    ' Card readers 2, 3, and 4
    CheckPortC:
    TempVar = PORTC
    TempVar = TempVar & %11100111
    if TempVar < %11100111 then
    if TempVar.0 = 0 then CurrCard = 2 : goto FoundCard
    if TempVar.1 = 0 then CurrCard = 2 : goto FoundCard
    if TempVar.2 = 0 then CurrCard = 3 : goto FoundCard
    if TempVar.5 = 0 then CurrCard = 3 : goto FoundCard
    CurrCard = 4
    goto FoundCard
    endif

    goto Mainloop

    FoundCard:
    select case CurrCard
    Case 1: ' scan card 1
    ...
    end select
    ...
    goto Mainloop
    Yuantu Huang

  6. #6
    alind's Avatar
    alind Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Felch and Yuantu, looks like I have plenty to get started with now!
    Regards,
    ALlan

  7. #7
    jmaloway's Avatar
    jmaloway Guest


    Did you find this post helpful? Yes | No

    Default Pre-Programed PIC?

    Hey there,

    Felch,

    I have been reading this thread and am really interested in giving this project a try, the only problem is that I can't seem to sucessfully burn a PIC - I have tried almost every method possible and I was wondering - Could I buy a pre-programed PIC from you? I live in Canada and would of course pay for all shipping costs.

    Thanks,

    James.

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