Hi there, please help me, I want to make a circuit that can do such task:
the circuit would receive input from a barcode scanner's output, and then the circuit would transmit the received data to the PC's serial port. Normally, the barcode scanner's output is connected to the PC using PS/2 keyboard interface. I want to convert it into serial.
PS/2 is a synchronous serial protocol but RS232 is asynchronous.
The so called PS/2<->Serial adaptors only take care of wire connections but does not work except only for a "Combo Mouse" that is designed to work with both PS/2 AND Serial Mode.
You do realise that there is no simple answer to your problem except something intelligent sitting between these two protocols doing protocol conversion.
That said, it can be done using a microcontroller and a TTL to RS232 chip(MAX232).
An example using AVR is here, in Japanese:
**broken link removed**
All the information like circuit diagram, source and binary code are there. You can use ATTiny2313 to replace the AT90S2313.
I can only give you an overly simplified view regarding actual usage. Synchronous transfer is controlled via a master clock common to both parties and both parties know exactly when the data is coming.
The asynchronous transfer is done with both sides agree on a clock rate but in real life they will not be exactly the same due to many factors. Both parties don't know exactly when the next piece of data is going to arrive/begin. Communication is still possible with slight baudrate difference between two parties. E.g. one is at 9600 bps while another is at 9603bps.
What is the data format from the output of a barcode scanner? Is it ASCII or specific key code?