View Single Post
  #8   Spotlight this post!  
Unread 13-06-2009, 22:34
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: Program digital IO to PWM?

Just started with the default code myself last night.

Did you call the functions in CustomPWM.c from anywhere in user_routines.c or user_routines_fast.c? Uncalled functions are pretty, but don't do anything. You should call these functions from either Process_Data_From_Local_IO in user_routines_fast.c or Process_Data_From_Master_uP in user_routines.c. Remember that the former will execute very quickly (on the order of a few hundred kilohertz), but the processing speed will fluctuate widely, and the latter will execute once every 18.5 ms. I don't know what kind of precision H-bridge application you're planning on running, but an 18.5 ms speed update rate should be plenty. Even though the update rate is "slow", the PWM speed is still quite fast at 40 kHz.