Quote:
Originally Posted by Matt Krass
I'm curious how that works, since the pins are supposedly connected straight to the user processor, how would the master processor disable that?
|
They aren't connected directly (which is why you can't use them as inputs). There is a switch that is controlled by the master that determines which processor gets to send its output to the pin. The call to
Setup_PWM_Output_Type() tells the master processor who's in the driver seat (icky pun intended). When your 'bot is disabled, the switch is flipped to the master, which provides the 1.5 ms neutral pulse.
Edit: Actually, Dave's explanation may be closer to the truth. If the master is capable of generating the PWM output, why do we have the Generate_Pwms() kludge to deal with. Still, the 1.5 ms PWM neutral pulse needs to get generated for safety reasons. If not the master, who?
Quote:
Originally Posted by Matt Krass
Also, how did you get around the interrupt-glitch thing? I'm missing something obvious when I look at the code...
|
The pulse doesn't glitch because once software sets up the timer and CCP hardware and says go, everything is done in hardware, which is oblivious to the interrupts firing-off in the background.
-Kevin