I have an H-Bridge that can run under joystick control or R/C Transmitter Control.
While running under R/C Transmitter Control, I want the PWM to go to zero if the transmitter is accidentally shutoff or batteries go dead (i.e loss of good pulse signal from the receiver.
I have attached the code I'm working with below. Using a 16f877A@20MHZ.
Right now, when you shutoff the transmitter, the motor goes wild. Full speed to zero speed and back and forth. My last attempt to solve this was to add the line "if duty0>260 then duty0=0" just before the jump to genpwm2: which runs the HPWM command. Note, duty0=255 is max duty cycle. I'm working in the LOOP2: section of the code only right now.
Thanks,
John
Bookmarks