Button emulation relative to ports

Post Reply
Osta
Posts: 53
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 1:12 pm
Has thanked: 1 time
Been thanked: 3 times

Button emulation relative to ports

Post by Osta »

Hey, everybody!
I have the task of putting buttons between the ports.
But in the emulator all the buttons work relative to ground,
Do you know if it is possible to simulate buttons in relation to ports?

chipfryer27
Valued Contributor
Posts: 154
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 109 times
Been thanked: 83 times

Re: Button emulation relative to ports

Post by chipfryer27 »

Hi

Not sure if I understand your request correctly. Do you wish to connect a button for example between Port A0 and B0 or such like?

If so, how will the ports detect any change in voltage? Will you initially make Port A0 "high" and try and detect a "high" on Port B0? If so you could just set B0 to be "active high". Ports can be set to be active High or Low.

Sorry if I've misunderstood your request.

Regards

Osta
Posts: 53
Joined: Thu Dec 10, 2020 1:12 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Button emulation relative to ports

Post by Osta »

I mean the dynamic polling of the buttons, as well as working with sensors that require polarity reversal and combined switching of other devices.

BenR
Matrix Staff
Posts: 1106
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 281 times
Been thanked: 377 times

Re: Button emulation relative to ports

Post by BenR »

Hello,

Possible yes, but you might need to create a component to allow you to do it, as you say the current built in components work to pull to the voltage rails VCC and VSS.

We can maybe help with creating a simple component but how would the switch work, i.e. when open would there be a pull to a third pin or to a voltage rail. when closed would there be a strong pull to a second pin or to a voltage rail?

The diagram here might help.
Image

There is a weak pull when open and a strong pull when closed both would likely need to be defined. You could maybe get away from the need to use a third IO pin for the open (default) state if your MCU device has internal pull up and pull down resistors you can enable.

A simple schematic of what you are doing might help.

Osta
Posts: 53
Joined: Thu Dec 10, 2020 1:12 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Button emulation relative to ports

Post by Osta »

Hi!!!
Sorry for the long silence - I was away.
This is for 8X8 keyboard. Moreover, the keyboard ports will switch to polling mode
at a certain time. The RX prot will be pulled up to the VSS by external resistors and the TX port
for the duration of the poll will go into the OUT state.

Post Reply