Implement footswitch to microcontroller I/O pin.

Thread Starter

Bellows

Joined Jan 20, 2018
16
(This post has been corrected a) to attach the correct datasheet for the latch and b) to correct its description in the writeup below: It is not TTL; rather it is a CMOS latch.)

I want to implement footswitches to replicate the function of two panel-mounted momentary push button switches in a musical instrument midi controller. But these switches do not switch a power supply level to the I/O pin of the microcontroller. Instead, both panel-mounted switches connect the same Q output of a CMOS latch, each through a forward biased diode, to a distinct I/O pin of a microcontroller. See schematic attached. (And, those two inputs might have a light FET pullup to VCC depending on how the microcontroller is configured.)

I am thinking that an open collector and emitter bipolar transistor which parallels each of the panel switches could be switched on via a TTL inverter/buffer when the input to the TTL inverter is connected to ground via the footswitch.

I plan to use two vacant pins on an existing dsub 25 connector to bring out the inputs to the two inverter/drivers to turn on the open collector/open emitter transistor. There is no VCC available at the dsub 25. So, the inverter/drivers would be mounted inside the equipment with the microcontroller and panel switches. But the existing connector already connects to several other footswitches which ground other inputs of the microcontroller. These are straight forward direct inputs to other microcontroller I/O pins. So, VSS is brought out through the connector. And, it would be easy to drive the inverter inputs to ground. But the bipolar switch transistors must remain off when the inverter inputs float.

As a former MOS chip designer, I am unfamiliar with bipolar/TTL design, so I am looking for validation of this design approach and help with the identification of a commercially available inverter/buffer - or with the design of one from discrete components. Then I would build two of these, i.e. one for each switch I will bypass with an external footswitch to ground.

Microprocessor is PIC16C74, I/O pins involved RB2 and RB5.

Specs are complex, but according to the uP datasheet, looks like min VIH is ~2.0-2.05V and max VIL is ~0.8V

Latch 74HC573B1, Q output is the subject output to be switched.

Max VOL 0.1V and Min VOH=1.9V, both @IO=20uA or as much as 7.8mA, depending on VCC.



  • *An alternate approach might be to bring the output of the latch itself out through the dsub 25 connector to be switched across the internal panel mounted switches. This would be a 10’ wire (20’ round trip) and would be in effect a large capacitive load on the latch and possibly a significant IR drop (say, #22 or 24 AWG wire) to parallel each of the panel switches. But, this would require a third pin, i.e. one for the Q output of the latch and one each for the opposite pole of each panel mounted switch. So, it would require adding a connector to the equipment housing. But, would be simpler in design than the two inverter design. If this were a practical approach, I could mount an additional connector with sufficient pins, but, I suspect that such a long wire would be too much load on the latch. Moreover, I cannot afford to risk any damage to the equipment internal circuitry as the equipment is obsolete and I would not be able to procure components like the microcontroller and I don’t have the flash coding for the application.
 

Attachments

Last edited:

Thread Starter

Bellows

Joined Jan 20, 2018
16
It seems that you attached the wrong file with 74hc57831.
Yes, Scott. Thank you. I have now replaced the attachment with the correct datasheet info. AND, IT IS A CMOS LATCH, NOT TTL. My apologies.
It looks like the latch can provide up to 35mA...maybe enough to drive the microcontroller input directly over an external footswitch.

(I don't grasp exactly what the purpose of the diode on the microcontroller input is. Seems that the latch Q output will only have an impact on the I/O pin if it is high. If the Q latch output is low, the microcontroller input pin floats (or is pulled up by the internal FET, in which case it will go high on its own volition?), but can never to lower than one diode drop below ground.
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,065
Why you called 74HC573 as 74hc57831, I can't googled any info about 74hc57831.

If the two inverters that you used are CMOS then you need to add two 10K to pull up in their input where they connected to Pin#19 and Pin#23 of the DSUB25 connector, you can't let the CMOS input as floating status.

You have a multiplexer circuit on the Output of 74HC573, so when you using them should be very carefully, otherwise it may easy to damage the components, something like when you want to use the footswitches then the Output of 74HC573 should be disable first, and when you want to use 74HC573 then you should be make the Pin#19 and Pin#23 of footswitches OFF first.

Edit :
The Input (RB2, RB5) of Pic should be using a 10K to pull down.
 

Attachments

Thread Starter

Bellows

Joined Jan 20, 2018
16
I see. Sorry....I interpreted the 'B' in B1 as an '8' and also transposed the 3 and 8. It should be 573B1. B1 is a DIP packaging designation. I corrected the part number in my writeup as well as the name of the datasheet file, but the datasheet is the same. It was correct.

But, that aside, your description is a bit to succinct for me to understand. Maybe I don't understand. Can you elaborate? Where is the CMOS inverter you propose?

Of course, I cannot know when or under what conditions the latch is energized, so I cannot multiplex. And, I cannot connect an inverter directly to the anode of the diode. As you say, it will conflict with the latch output.

My footswitch simply needs to switch the output level from the Q output of the latch - whatever it happens to be, i.e. high or low, at any given time, - to the input of the PIC, just as the panel switch would do if I pressed it. So, I simply need to bypass/parallel the panel switch with a transistor I can turn on or off with the panel switch. In that case, my foot switch will do exactly what the panel switch does at any point in time.

I also write about bringing out the Q output itself through a connector and send it back to the PIC through a foot switch. But, I suspect this might be too big a load on the latch??? Or the capacitive load may screw up the timing of the latch, or load it with too much capacitance, or damage the latch or the microcontroller?

(As for the 10K pull down, I'll have to look to see if that's already present. I suspect it must be already present.)
 

ScottWang

Joined Aug 23, 2012
7,065
But, that aside, your description is a bit to succinct for me to understand. Maybe I don't understand. Can you elaborate? Where is the CMOS inverter you propose?
You have labeled as new circuit board with two drivers, they have two inverters and two bjt (I reread the third paragraph in your first post, it seems that you used the TTL inverters then no needs to add the 10K pull up resistors).

I also write about bringing out the Q output itself through a connector and send it back to the PIC through a foot switch. But, I suspect this might be too big a load on the latch??? Or the capacitive load may screw up the timing of the latch, or load it with too much capacitance, or damage the latch or the microcontroller?
I can't see any load in the path, if you worried about the load current, how is the resistance?

Normally the internal I/O pull up resistance of input of MCU is 100K or more.
 
I had trouble following, but if this is related great.

I've found the best interface to "unknown" buttons is an opto-FET. Generally, you don;t need a "full-on" type of contact closure to work. 200 to 500 ohms might be fine. The VTL-5C1, now obsolete, is a big device, but it has leads. There are photomos and optomos devices, typically called "OPTOMOS or "PHOTOMOS" relays" that only need 1 mA of current to fully turn it them on.

With bipolar transistors, you have to worry about leakage currents. If it's part of a matrix scan system, that makes it difficult too.

In one interface I did, I put an LM334 current regulator and a diode in the device. I'm not sure if the diode was 100% necessary, but it was quick and dirty and it gave me reverse polarity and signal operation from x to 32 V or so. I was using 12 VDC. Not sure of the low limit required.

Now, there is an analog devices part and you can do the polarity thing with a lower voltage drop with FETs.
 
Top