I have the XHC-HB04 MPG, with a combined Run/Pause/Resume button, which 
I find to be a smart layout.  Stop is a different button.

I set this up with, basically:
1.  halui.program.run = button & is_idle
2. halui.program.pause = button & is_running
3.  halui.program.resume = button & is_paused

This gave a stuttering where it started but might end up paused.  I 
thought I had a debouncing problem, but of course not-  the .run command 
happens quickly, then the is_running condition is true, so it issues 
.pause, then it's paused so it issues .resume, all with the same button 
press.  So it's stuck alternating pause/resume/pause/resume for as long 
as the button is pressed. Duh!

I have the same problem with Spindle On/Off.  Unless you try to "ninja" 
the button real super fast, it sets the spindle on-off-on-off-on-off and 
the state it ends up in is random.

So I need like an edge detector that provides only a pulse for one cycle 
when the button is pressed.  That seems simple enough, but I don't see 
any HAL construct which supports it.

I could do this:
http://www.allaboutcircuits.com/textbook/digital/chpt-10/edge-triggered-latches-flip-flops/

By using a Debounce as a delay element, "NOT" to invert the debounce 
output, and AND them together for a leading edge pulse.

That's technically correct, it should work, but I feel there must be a 
more direct solution that I'm missing and coming up with something 
convoluted and ridiculous.   Thoughts?

Danny


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to