![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
How difficult is it to connect an keyboard / barcode scanner to an pic and be able to recieve the data from it? any one ideas? what kind of communication is this? serial?? Tks | |
| |
| | #2 | |
| Quote:
| ||
| |
| | #3 |
|
well i have found an couple of good sites and i thingk that the scanner just watches and when there is no activety it starts sending the data.... (its all in the protocol of the AT interface).. ok, thik i will give this an go rather than USB or RS-232.... because at least i can then implement the power feed without modding the scanner, also PS2 is more common than RS-232 scanners.. Tks | |
| |
| | #4 | |
| Quote:
Serial - 1. PS2 - 3. USB - 40/50. Serial is by far the simplest, but PS2 is pretty easy - if PS2 scanners are easier (and cheaper) to obtain, that's the way I'd go. I'd only go the USB route if they were massively cheaper, and I couldn't get serial or PS2 ones. | ||
| |
| | #5 |
|
Thanxs nigel, the problem with RS-232 is that many clients then will need to invest in an RS-232 scanner...and abviuosly it isn't nececary as you said, PS2 is question of time and knowing rs-232 basics... also there are already many ps2 examples arround.. but USB is an hole other ch*t...its more like networking.. and at a level not within my range yet.. altough i hope that the PS2 scann doesn't do really strange things because... i'm certain that debugging what it does while you switch it on.. won't be that easy.. would there be an PS2 spy program arround?? i gues no no..RS-232 is there already...sow that would be better able to look what it sends... Tks | |
| |
| | #6 |
| If the clock and data lines are both high the keyboard sends the (0) start bit, 8 data bits, the parity bit and the stop bit. Data will be valid before the trailing edge and beyond the leading edge of the clock pulse. can any one explain this to me please?Does it mean that i need to capture the state of the data line when clock is high or when its low? I'm now doing this: If clock=0 Then ''when the keyboard wants to send data he pulls it to low level.. HSerout ["Data ready"] ''to debug console... For bbit=0 to 10 '' 1 start bit, 8 data bits 1 par 1 stop bit... last=1 ''security to captura data on seperate clock highs..?? While last=1 ''security to captura data on seperate clock highs..?? Delayus 4 If clock=1 then last=0 Wend If ddata=0 then CLEARBIT vvalue,bbit If ddata=1 then SETBIT vvalue,bbit ''HSerout ["Bit:",dec bbit,";",dec ddata," "] Next bbit HSerout ["RECV:",BIN VvAlue,10,13] End if When i hit an key on the keyboard i recieve Value 0! 2 times.. 1 time because of making some key, another one because releasing some key... now the trick should be that my timing or my scanning should be an bit better because in fact i never read ddata high... Both Clock and Data are connected to 5volts with an 10K restitor like in the examples on the net. what goes wrong?? Tks | |
| |
|
| Tags |
| keyboard, scanner |
| Thread Tools | |
| Display Modes | |
| |