Interfacing with PS2 and RS232, which chip?

View: New views
5 Messages — Rating Filter:   Alert me  

Interfacing with PS2 and RS232, which chip?

by Sylvester-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working on a project which will interface with a PS2 device, and
convert the signals to Serial RS232 format.

I believe a PIC and Max232 would be suitable for this task. The
project is still in early reseach/planning stages, so I'd like to ask
for advice from anyone who may have experience with PS2 interfacing.

As a PIC newbie I'm not sure of which PIC to use.

The PS2 protocol runs as a clock freq. of 10 - 16kHz, so speed
shouldn't be an issue (I guess incoming data should be stored in a
buffer and transmitted while the PS2 line is idle. A pic running at
4Mhz would execute 62.5 - 100 instructions per PS2 clock.)

PS2 signals are open collector types, meaning when idle the voltage is
held high by a pull-up resistor. Either the device or host (the pic)
can drive the signal low. I'm not sure about implementing this. The
literature I've read seems tells me to set the TRIS pin to input when
the signal should be high; set the pin to output and write a ZERO to
drive the signal low. Does anyone have any practical information on
open collector interfaces?

On the RS232 side, I intent to use a MAX232 to convert the 0/+5V to
the required voltages. I will only be using TxD and RxD for data, wich
will enable me to use RTS / DTR for power (still thinking about the
voltage regulator).

So I'll need 2 input pins and 2 output pins, and maybe a few more
outputs for status indicators. Any suggestions on selecting a suitable
pic?

I welcome any ideas / comments / alternate suggestions.
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

Re: Interfacing with PS2 and RS232, which chip?

by Electronic Elephant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sometimes the CPLD is a better choice?

E-elephant


On Sun, Jun 29, 2008 at 11:41 AM, Sylvester <mail@...> wrote:

> I'm working on a project which will interface with a PS2 device, and
> convert the signals to Serial RS232 format.
>
> I believe a PIC and Max232 would be suitable for this task. The
> project is still in early reseach/planning stages, so I'd like to ask
> for advice from anyone who may have experience with PS2 interfacing.
>
> As a PIC newbie I'm not sure of which PIC to use.
>
> The PS2 protocol runs as a clock freq. of 10 - 16kHz, so speed
> shouldn't be an issue (I guess incoming data should be stored in a
> buffer and transmitted while the PS2 line is idle. A pic running at
> 4Mhz would execute 62.5 - 100 instructions per PS2 clock.)
>
> PS2 signals are open collector types, meaning when idle the voltage is
> held high by a pull-up resistor. Either the device or host (the pic)
> can drive the signal low. I'm not sure about implementing this. The
> literature I've read seems tells me to set the TRIS pin to input when
> the signal should be high; set the pin to output and write a ZERO to
> drive the signal low. Does anyone have any practical information on
> open collector interfaces?
>
> On the RS232 side, I intent to use a MAX232 to convert the 0/+5V to
> the required voltages. I will only be using TxD and RxD for data, wich
> will enable me to use RTS / DTR for power (still thinking about the
> voltage regulator).
>
> So I'll need 2 input pins and 2 output pins, and maybe a few more
> outputs for status indicators. Any suggestions on selecting a suitable
> pic?
>
> I welcome any ideas / comments / alternate suggestions.
> --
> http://www.piclist.com PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

Re: Interfacing with PS2 and RS232, which chip?

by Bob Ammerman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am nearly certain you can find code to implement a PS2 receiver on the
microchip website. If nowhere else, it is part of the firmware for the
PICDEM USB demo board.

-- Bob Ammerman
RAm Systems


--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

Re: Interfacing with PS2 and RS232, which chip?

by threewheeler7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

are you writing this in asm? i have some projects that i have worked on that cover all the areas you are talking about and i have a project coming up that is very similar to yours so keep us posted.  and yes bob is right, check out the microchip's pdfs they helped me with the ps2 interface.


Re: Interfacing with PS2 and RS232, which chip?

by Sylvester-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> are you writing this in asm? i have some projects that i have worked on that
> cover all the areas you are talking about and i have a project coming up
> that is very similar to yours so keep us posted.  and yes bob is right,
> check out the microchip's pdfs they helped me with the ps2 interface.

Yes, I am using assembly, I think its the best way to learn about a
processor. I found series of good articles from microchip a PS2 to USB
mouse translator (TB055 - TB058) which is actually what I am doing,
which I'm using for the PS2 routines - thanks Bob for the tip.

I've decided to use a 16F84A for my project since its common and its
the subject of many tutorials on the Net. Anyway I'll keep you posted
with how I go.
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
LightInTheBox - Buy quality products at wholesale price