Barcode reader with PIC16f877A ?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    [QUOTE=skimask;49542]One of the problems you're going to have is the fact that you won't get an interrupt in the middle of a statement.
    QUOTE]

    oky I avoid this problem by placing If statement " If but1=0 " which all commands inside this if statement will not execute untill I press the button placed on portb.2

    but I want to ask if there is something wrong in my code

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    oky I avoid this problem by placing If statement " If but1=0 " which all commands inside this if statement will not execute untill I press the button placed on portb.2
    You sure did...missed that one, but it's still a valid point for future reference.

    but I want to ask if there is something wrong in my code
    Does it work?

    If code_works = 1 then
    nothing_wrong_with_code = 1
    else
    nothing_wrong_with_code = 0
    something_wrong_with_code = 1
    endif

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    You sure did...missed that one, but it's still a valid point for future
    oky for testing my code I insert ID card with this number "120063718" and the barcode give me a sound that the scanning completed , then if the scanning stage I pressed the button to display the data collected from this barcode reader the data output as follows

    counter=96
    data bits=
    10100001001111100010000011111100111110001000000111 0100101101011000000111010000011111100 ...........

    I want to know how to decode this data to display this ID number 120063718

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iugmoh View Post
    oky for testing my code I insert ID card with this number "120063718" and the barcode give me a sound that the scanning completed , then if the scanning stage I pressed the button to display the data collected from this barcode reader the data output as follows
    counter=96
    data bits=
    10100001001111100010000011111100111110001000000111 0100101101011000000111010000011111100 ...........
    I want to know how to decode this data to display this ID number 120063718
    For one thing, we don't know which barcode scanner you're using (not that it would matter much).
    Second thing, how does your scanner encode the information that it outputs?
    Obviously you've got data there. Whether it's good data or not is another story.
    What do the dots mean? Do they mean that there is more data to follow or are those the end of the string?
    Is this some sort of ASCII encoded data? BCD? Grey code? Otherwise? 8 bit data chunks? 12 bit? 4 bit repeated/inverted?

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    For one thing, we don't know which barcode scanner you're using
    oky, my barcode reader type is "PS/2 Keyboard Wedge Barcode Scanner" and I test it with my PS/2 PC port , which when i insert the ID card it's automatically display the number "120063718" with new line

    I know that the problem is how to know how encoding is done ?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iugmoh View Post
    oky, my barcode reader type is "PS/2 Keyboard Wedge Barcode Scanner" and I test it with my PS/2 PC port , which when i insert the ID card it's automatically display the number "120063718" with new line

    I know that the problem is how to know how encoding is done ?
    Then you'll probably have to get a list of the actual PS/2 scancodes relating to various keypresses, numeric, alpha, whatever. Probably throw all of those into a lookup table, crunch the table and get your keypress out of it.
    Basically, you're building a PS/2 keyboard reader. I'd be willing to bet that if you found some PS/2 reader code somewhere for plugging in a standard keyboard, that it would actually work.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    I will thank you another time for your patience, I understand that you are meaning that I can replace my barcode reader by a keyboard and pressing the same ID number to know how each number is encoding

    oky i will try this

Similar Threads

  1. PS/2 barcode reader to RS232 port - need help
    By phoenix_1 in forum Schematics
    Replies: 10
    Last Post: - 28th May 2008, 05:35
  2. Barcode reader Problem ?
    By iugmoh in forum General
    Replies: 5
    Last Post: - 18th February 2008, 20:25
  3. Serial interface with RFID reader
    By brid0030 in forum Serial
    Replies: 8
    Last Post: - 23rd January 2007, 06:23
  4. Proximity Card Reader
    By Sphere in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 6th November 2005, 14:43
  5. Smart card reader with PIC16F84A
    By bangunprayogi in forum Serial
    Replies: 0
    Last Post: - 12th August 2005, 10:36

Members who have read this thread : 0

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