VESC / Flip Flop Help

Thread Starter

benha

Joined Jan 4, 2011
49
Hello!

I'm working on a project where I need to toggle a VESC-type ESC between off and "on" (no variable throttle) with a momentary button. One press on. Another press off.

I've designed the following circuit. The idea is to use an SN54HC112 flip flop, wired with a Power-On-Reset in "toggle" mode, and take the output from that to the ADC input to the ESC. One press and it goes to the full circuit voltage (3.3V) another press and it goes back to 0V. Then in the VESC programming utility I can establish what actual output power I want to map to "on."

Sounds good, but it doesn't seem to be working. When I breadboard this circuit I get a "blip on the ADC out line when I press the button, but it doesn't toggle between high and low the way I would expect. It pretty much stays at a middling voltage the whole time.

Any thoughts on what I'm doing wrong? (I'm very much an electronics novice, so this is likely me just being ignorant...)

Thanks!
-Ben

 

AlbertHall

Joined Jun 4, 2014
8,504
The 74LS112 won't work on 3.3V.
If you have a switch feeding a clock input you need to debounce it otherwise you will get multiple clocks as the switch bounces.
 

danadak

Joined Mar 10, 2018
3,607
You have not only debouncing as an issue but slow rise/fall time signals
into CMOS logic that is a bad idea. Eg. the reset pin and 10 uF cap hung off
it.

http://www.ti.com/lit/an/scba004d/scba004d.pdf


One of the best ways to do this is with ATTINY85 micro, where you can
do the debounce in code and create glitch free power up and insure fairly
accurate pulse widths, logic output.

Use gui block programming to create the functionality. Post # 9 here -

https://forum.allaboutcircuits.com/threads/push-button-long-press-on-off-dual-function.130963/#post-1423271


Regards, Dana.
 

marcf

Joined Dec 29, 2014
257
As noted, in post #2, according to the spec sheet for this part the minimum power supply voltage for this part is 4.5V.

Please read this: https://www.ti.com/lit/ds/symlink/sn74ls112a.pdf

If you change your power source to 5V, please be aware that the C(lock) input to the 74LS112 pin 1, is a negative edge triggered input.

Your drawing leaves this input floating.

C(lock) should be held hi with a pull-up resistance and set low when the closing of SW1 pulls the input low.

To prevent bounce, a cap, strategically placed would also be a very good idea.
 
Top