View Single Post
  #7   Spotlight this post!  
Unread 15-01-2007, 18:17
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: PWM 13-16 Replacement Code Beta Test

Quote:
Originally Posted by Matt Krass View Post
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 View Post
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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 15-01-2007 at 18:23.