Jump to content
Electronics-Lab.com Community

Tony_Stoynov

Members
  • Posts

    197
  • Joined

  • Last visited

    Never

Posts posted by Tony_Stoynov

  1. Hi,
    today i have a long flight, i think will find some time to make explain more in details, but this will be later.

    Edit.
    OK, i make the simulation on 19200 bps, you talk a keyboard rate around 20 Khz. In this circuit i not store data, i transfer it on every bit, and output bt rate is connect to the input bit rate, if you use 9600, the PS2 bit rate must be 9600 too.
    I think i try to explein how this work, now i will get answer to your questions :
    Q1 : When you recive the start byte ths byte set triger U1A. This triger enable the U4A gate, and clock signal is transfer to the clock output.
    On the every clock signal the U3A is increment. This is 4 bit binary counter. On the output of the counter i have connected several gates, U5A, U4B, U4C. I use this gates to detect different numbers on the conter outputs. This is the NAND gates. The state diagrm for nand is :
    A 1 0 0 1 input
    B 1 0 1 0 input
    C 0 1 1 1 output
    How you can see the output going to low level only to of the input is 1, in all other case the output is to high level. This i to same for 2 and 3 input NAND.
    Ok, when the bit A,B,D is hight the output of U5A is low. This low level i use to generate the Reset signal. If i use directly this output the reset cygnal will generate several nanoseconds after the edge of the clock, this will close gate U4A, and the keyboard contoller may be can not detect valid clock. To prevent this I use U7B. This is OR gate. The state diagram for OR gate is :
    A 1 0 0 1
    B 1 0 1 0
    C 1 0 1 1
    The output of this element is low only two inputs is low. The seccond inputs on U7B i connect to the invert clock signal. The counter incement on the fallow adge, then when counter is increment to 11, the clock will be low. The invert clock will be high and output on U7B will be high. When clock go to hig level, on the all input on U7B will have a low level, then autput will be low too, this is the reset. All device in the circuit diagram have a low level reset.
    Ok, when i have a reset, this reset the U1A, and gate U4A will be closed. This is th end of the transmision.
    Way 11, becouse you have 1 start, 8 data, 1 parity and 1 stop, the sum of this is 11.
    The other two gates generate the signal for the party bit and stop bit.
    How works the parity. What is the paritym the parity is counting how bit on each type you have. You have two tye of parity even, and odd, one count the logic 1, another logic 0.

    RS_PS2.pdf

  2. Hi,
    pleasesee the attachment.
    I not have a time to real test this circuit, i made only computer simulation.
    Tx is the input, you must have MAX232 befor this schem or some other level converter.
    Xtal is input for sampling, this can be on chip generator, or simple quartz generator whit invertor, the frequency must be exactly 2.4576 Mhz
    Data is the data stream to PS2
    Clock i the clock to PS2
    U8 this is the devider by 128. The devider have a circuit for sync, U7D. R1/C1 give you small time delay, to move the faling edge to the midle of the data bit.
    When you reive the start bit the U1A flip-flop change the state. Q output allow the clock to the clock output. This clock increment the U3 counter.
    The Tx data going to Data output via U4D. U4D is using to add the parity and stop bit to the data.
    U2B is use like a T flip-flop, devider by 2. This flip flop count the rising edge, and giv you the parity bit.
    U5A generate the reset signal, when have a 11 clock impulse. The impuls will be generate on the rising age after last clock impuls. To do this, U7B use invert cloc from U6A.
    U4C generate signal to :
    1 - stop the parrity bit calculation, Q' going to Low level.
    2 - to allow parrity counter output to data line, U7C.
    U4B make reset impulse

    RS_PS2.pdf

  3. Hi,
    you want to produce this device, this is right. If i am right, then you have a need from :
    1. Low price
    2. EMC certification
    3. Reliability
    4. Easy to use and compatibility to another devices

    1. Low price, this depend from size and numbers of components. For example one microcontroller have a price around 2$, i talk about controller with integrate RS. If you make this with a TTL and CMOS circuit, you will need no less that 10 chips. The price of this chips is may be equal or high that price of a microcontroller. On the other hand for this chips you need 10 time more space, the board will be 10 time expensive.
    2. 10 TTL chips have a high EMI vs one microcontroller
    3. 10 TTL have around 10 time low reliability
    4. With TTL you can realise simple conversion, but my suggestion is to convert ASCI in this hardware device, not in the PC, because if you want to use simple hyper terminal you can't. You can put jumper, or software configuration on the microcontroller version, that will control type of data, simple ASCI or already converted data.

    I can give you many other reasons to using the microcontroller, my business is this, to design the device and consultation for my client how they can improve the products. If you still want i can think around TTL version, but this is will be a complex schem, and i don't sure that will have a time to make this for you.

  4. What type of compiler you have? You must have a samples in your compiler. If you need some info about C look for ANSI C books.Also you must read very carefully the processor data sheet.
    When you have a real task, please write what is the difficult for you, and i believe that will have a many people that will help you.

  5. Hi,
    i find 20 minutes and made something for you, but i can't test because have not the PS2. I use PIC16F628, below you can find the HEX, and asm.
    PIN 7 is the recive form MAX232
    PIN 17 is the Clock
    PIN 18 is the Data
    Tomorrow, i try to find a time to draw the schecm, but this is standard PIC, MCLR pin to +5 via 2 kOm. Use 20 Mhz quartz with 18 pF capacitor to ground. And nothing more. If this is god for you, i

    Serial_to_PS2.rar

  6. Hi,
    yes, of course you can use standard IC but this will be very big and complex circuit diagram. I prefer to use the microcontrollers. I am have no a complete driver for a PS2 keyboard, but can ask some friend.
    If this is your software, i can suggest something other, why dont use RTS/CTS signal to generate directly PS2 stream, and then you put only one MAX232 to convert the signal, but actually MAX is not need, the optocoupler will be OK.

    p.s. i not have any PC with the PS/2 input, i use the notebooks, and this is the problem, i can't test the soft, in other case i can write this soft for you.

  7. OK,
    now i have some more questions:
    1. the first PC make a coding in to PS2 format or just make this coding to protect the data.
    2. How long is the cable between PC, if distances is more that 2-3 meters, then you can have a problem.

    The conversion can do with a microcontller,:PIC, Atmel etc, or with logic, i talk about CPLD, but if you like the challenge can make this with TTL ;). I will suggest microcontroller, but CPLD is also good solution.

  8. Sorry but i will repeat,you will say if i understood right.
    You have two PCs, A and B. On every PC you have a soft. This soft send data to RS port, for example, if you have "Hello" your soft will send characters H,E,L,L,O.
    The receiver soft will capture this characters and will use for something.

    Now,
    1.  You want to put hardware device between PC, that will coding sending data. When this device receive "A" will send "IC F0 IC".

    Or ....
    2. The first PC send data in this coding, "a" to "IC F0 IC" ..... and the hardware device must receive this data and convert it to standard PS2 protocol and send this data to keyboard on the second PC.

×
  • Create New...