![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
***Long post ahead :P Sorry for possible English mistakes, it ain't my mother tongue
Hi guys, my name's Steve and I'm currently finishing my formation in Tech. EE here in Canada. **Background info*** I'm currently doing my final project with my partner and we've encountered some problems we can't resolve so I decided to try the forums since I know there are very knowledgeable people here Our project is a basic liquor inventory system for bars/restaurants. A waitress would take an inventory reading of their bottles (26oz/40oz mainly) of hard alcohol/liquor at the begining of her work shift then take one at the end to know wich quantity of alcohol was sold during the night. Here's how it should work First you identify the bottle using a bar-code scanner and some pre-applied bar codes sticker. The data sent by the bar-code scanner (a ps/2 modified cuecat) is sent into the pic (P16F877) who selects the good bottle (we need to do this cause each alcohol has a different volumic mass when weighted). We then drop the bottle on our RS232-enabled scale (Acculab VIR-4KG) wich sends the weight into the pic. This weight is transformed into ounces using a pre-calculated algebric transformation stored inside the pic. The result is then displayed on an alphanumeric LCD. And now here's the problem :P Our knowledge of the RS232 interface is somewhat limited and for various reasons we don't wanna rely too much on our teachers so I'm hoping some people can help us here. We tried hooking up the bar-code scanner to a logic analyser to see what kind of data stream we always got random strings of data. Were guessing it's because we left the CLK pin floating ... I looked around the net and couldn't find anything about it. What should I input into this pin? It usually comes from the computer so I'm guessing a square wave signal at a specific frequency? If anyone has other comments regarding the subject feel free to post Thanks, Steve |
|
|
|
|
|
|
(permalink) |
|
As you said the barcode scanner is a "modifed PS-2 cuecat". If it is using a PS-2 interface then that is not RS-232. My guess is the barcode scanner is inserted betwwen the PS-2 keyboard and the PC PS-2 keyboard jack. You can try googling for PS-2 keyboard interface timings. Keywords would be "PIC PS-2 interface".
Or try this link: http://panda.cs.ndsu.nodak.edu/~acha...ro/PS2/ps2.htm You also mentioned an RS-232 enabled scale. Do you mean you need two interfaces on the PIC? One is RS-232 and the other PS-2.
__________________
"Having to do with Motion Control" |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Basically it's a syncronous serial protocol, with start bit, 8 data bits, parity bit, and stop bit. It also has the possibility of being bi-directional, so you can write to the keyboard - the EPE code is only one way though. |
||
|
|
|
|
|
(permalink) |
|
Yeah sorry had a mind fart :P The scale is using a RS-232 interface while the cuecat is PS/2.
Anyway thanks for the links, I'll check them out and update in the upcoming days if all goes well. Thanks |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|