Wiegand data and com port


Closed Thread
Results 1 to 40 of 54

Hybrid View

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

  2. #2
    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

  3. #3
    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

  4. #4
    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.

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


    Did you find this post helpful? Yes | No

    Default

    Hi!
    Sure i could send you preprogrammed chip but is this really what you want? It could cost a lot...
    Wouldn't it be easier to fix your programmer? What device are you using and what errors does it generate?
    Anyway, if you still prefer a preprogrammed chip, send me your address. I will charge the cost of chip and nothing more. I guess that it is possible to send it with "receiver pays" option?

    rgds,
    /Felch

  6. #6
    jmaloway's Avatar
    jmaloway Guest


    Did you find this post helpful? Yes | No

    Default RE: Pre-Programmed Chip

    Felch,

    I don't know. I've never been good a programming - for any platform. I used to know a bit of Qbasic, but that's about it. Because I don't understand the language the code it written in, I have no idea where to look for errors. I didn't get any error messages when I burned your code onto a PIC, but it dosen't do anything when you power up the chip. I am a more electronically-minded person, I have no problems with the physical aspect such as wiring up the board, but software issues are simply beyond me. Below is what I did to burn the code onto a PIC16F628A using a JDM programmer:

    1. Saved code from your website as .asm file
    2. Opened "Pony Prog 2002" and opened the ASM file.
    3. Clicked "Write to Chip"
    4. Got the message "Write Sucessful"
    5. Wired up the chip with specified crystal, 22pF caps, Miniprox reader and powered it from +5V from my USB port.
    6. The reader powered up and completed the power-on self test.

    That's as far as I've gotten. I have playing around with MPlab, but it is ridicusly overcomplicated for me.

    Am I doing everything right? I have gone to all sorts of different websites and read tons of different beginner's guides to programming PICs but I still don't get it.

    Let me know if I am doing something wrong, and If I'm not then I'll just buy a chip from you. Do you have paypal?

    James.

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


    Did you find this post helpful? Yes | No

    Default

    Hi!
    It must be a PIC12F629, not 16f628! That's first. Then, After powering up the chip has no tasks, nor does it output anything. Only after you have presented a card (wiegand data arrives from reader to PIC), card number is output via serial port. Perhaps this helps?
    Let me know if it still does not work.

    /Felch

    PS. Do NOT forget to read PICc's internal calibration data and then burn it back. Otherwise serial comms speed would be incorrect! If programmer asks if it should use OSCAL from file or from chip, say use data from CHIP!

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