PSoC5LP: Merging input/output pins into a single bidirectional pin?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Hi there,

I have a question about adjusting a design for a PS/2 Keyboard/Mouse Interface that previously used 2 pins for clock and data (seperate In and Out) for the clock and data lines:

pastedImage_1.png

The signals were combined external to the PSoC:

pastedImage_0.png

The code I have written bit-bangs the PS/2 interface with the falling edge of the clock being the trigger to read data bits.

What I'd like to do is possibly change these to single Clock and Data lines to simplify the design.

I have a couple concerns:

1) If I merge ClkIn and ClkOut into a single pin (set for Input/Output - Open-drain drive low) will my Clock interrupt fire when I toggle the pin as an output?  If so I will probably need to ignore the interrupt for when the PSoC has control of the clock?  I'm already doing this for the existing design so it's not an issue if this is the case.

2) Both the mouse and Keyboard clock signals are on one port.  Since (if I recall correctly) there's only one dedicated interrupt signal per-port, will I need to make special considerations to separate the two interrupts?  Or would this all be taken care of by having two separate ISR components (one for keyboard clock, one for mouse clock)?

Thanks in advance for any tips.  I want to make sure I have an understanding of the inner workings of how this will behave before I go ahead writing too much code.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I wonder if something like below will work.

ISR will be triggered only when output_en = low.

000-schematic.JPG

moto

View solution in original post

8 Replies