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!

    Serial string "ID xxxxxx" is output on GPIO0 if GPIO1 is at high level (enable pin). Taking GPIO1 low will disable output. Output speed is 4800 bd.
    If you mix up D0 and D1, data will still be output but card number will be wrong.

    I have the same code working at 16F628 too. It really requires only minimal changes.

    I will "release" a newer version on reader code now (should be attached). Late program had problems with certain types of readers: it did not read anything. Present code fixes it. One more bug is fixed.

    About OSCCAL (calibration data). My serial output (bit-banging) routine (actually not mine, I guess mr. Myke Predko wrote it) relies on chips internal oscillator. It's frequency must be exactly 4MHz or receiving computer will fail to read stream. Microchip has made PIC's internal osc's frequency adjustable by means of changing one conf byte - the OSCCAL. It has been set in factory to some (correct) value. When you burn chip, it will get a new value from the .HEX file. This must be avoided. I am not sure about PonyProg but most PIC programmers now about that trick and ask user for the right value. Programmer can read it from chip and then, after burning code, restore it.

    Happy PICing!
    /Felch
    Attached Files Attached Files
    Last edited by Felch; - 27th October 2005 at 18:03.

  2. #2
    jmaloway's Avatar
    jmaloway Guest


    Did you find this post helpful? Yes | No

    Default Pic

    Thanks,

    I think I'm starting to get a better grasp on how this works.

    When you say that GPIO1 (pin 7) must be high, you just mean not connected to ground, right? Or does it have to be connected to +5V?

    Thanks for the updated code, I really appreciate it.

    I don't know what the frequency of the chip that I have is, I've uploaded and downloaded from it countless times, but I don't know if it's ever actually done anything. Can I just use an external Xtal? I have a bang-on 4.000 Mhz one right here.

    Thanks again,

    James.

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


    Did you find this post helpful? Yes | No

    Default

    GPIO1 must be connected to +5V, preferably via 1k resistor. Since there is an internal pull-up resistor in PIC, you may also leave this pin floating. You can comment checking this pin out from code if you don't need it. My application needed disabling reader.
    Likewise you may change code to implement external xtal oscillator. X-tal can be connected to GPIO5&4 only but since GPIO3 and 2 are free, you can do this. You will need a pull-up for GPIO3 (it does not have internal one.

  4. #4
    jmaloway's Avatar
    jmaloway Guest


    Did you find this post helpful? Yes | No

    Default Pin-Outs

    Ok, I think I understand the method to the madness, but...

    One thing I don't understand and haven't been able to get any info about on the net is which pins on the PIC the GPIO pins are - are they the RA or the RB pins, and is the numbering the same?

    My other question is... why is the oscilator not connected to pins 15 & 16? I though that since those were the "OSC" inputs on a PIC, that they were the only pins that you could attach a Xtal to. And to recap quickly, it's supposed to be running @ 4.000Mhz, right?

    Thanks again,

    James.

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


    Did you find this post helpful? Yes | No

    Default

    PIC16F628 has 16 i/o pins which are divided into 2 groups - ports. They are PORTA and PORTB. naturally they have different pin numbers! Powerful PICs have more ports (18f452 up to PORTE). PIC12F629 has only 6 pins and they are named GPIO0...GPIO5.
    Abbout xtal connection: what code are you talking about? proximity.asm works on pic12f629 which does not have pins 15 and 16!? And the code relies on internal oscillator, no xtal!
    dbl_rdr on the other hand works on 16f628 (or analogous). There xtal must be connected to pins 15&16. If u use other chip, pin numbers will be different. Of course xtal can be connested only to dedicated pins. That's true with every microcontroller.

    Proximity.asm runs at 4MHz.

  6. #6
    jmaloway's Avatar
    jmaloway Guest


    Did you find this post helpful? Yes | No

    Default Wiegand-To-RS-232 Adapter

    Ok, I think I get it now.

    I am going to head over to my parts supplier tommorow and pick up a PIC12F629.

    When I get the chip, I'm supposed to get the OSCAL value by doing an upload from the chip and then choosing to use the value from the chip, right?

    Then, once I get "proximity.asm" loaded onto the chip, the pin connections should go as follows:

    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.

    Is this correct? :-)

    Thanks again,

    James.

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


    Did you find this post helpful? Yes | No

    Default

    Yep. That's correct.

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


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by Felch View Post
    Serial string "ID xxxxxx" is output on GPIO0 if GPIO1 is at high level (enable pin). Taking GPIO1 low will disable output. Output speed is 4800 bd.
    I've been carefully trying to decipher your code and am quite pleased I seem to be following most of it, however, when I examine your send_rs232 routine, it looks to me like it only outputs "ID xxxx". i.e. 4 digits - not 5 as one might expect (00000 - 65535). Am I missing something?

  9. #9
    Join Date
    Jun 2008
    Posts
    2


    Did you find this post helpful? Yes | No

    Question question

    im' try create circuit with RFIDlock.zip and not work
    if pic not programed voltage pin GP0 = 0V
    if pic it's pogramed with RFIDlukk.HEX (winpic) voltage pin GP=5V continus
    what is wrong

    scuse my primitive englese
    Attached Images Attached Images  

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Welcome hansol.

    It helps others to help you if you post your code. (and configuration settings) The schematic is great but...
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    Jun 2008
    Posts
    2


    Did you find this post helpful? Yes | No

    Default code

    code adn reader is ay-k12 rosslare(wiegand 26 bit)
    Attached Files Attached Files

  12. #12
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Hi,

    My ASM is very rusty, but after rereading this thread I think the answer , or at least your problem is addressed starting at post #18.

    Sorry I can not be more help.
    Dave
    Always wear safety glasses while programming.

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