Log in

View Full Version : Generate_pwms() Broken?


Larry Barello
12-01-2004, 18:52
Per the edu and frc guides, Generate_pwms() can be used on selected PWM outputs in case you want to update at a higher rate than the standard radio packet rate (26.2 ms for FRC).

Well, when I try that I find that every N'th pulse is missing and that seems to correspond to the main packet loop running (i.e. every 26ms or so). I think there is some sort of undesirable interaction between Generate_pwms() and the main packet driver.

This, of course, makes Generate_pwms(), totally useless as it is only reliable when called within the main packet loop (user_code or autonomous_code)

Anyone else notice this problem? Did I misunderstand what this function is for?

P.s. I want to be able to control my sensor array while the robot is disabled and need the PWM pulse output to drive the scanning servo. Perhaps the way around this is to use the PWM output in CCP mode and form the servo pulses manually? Anyone have a code snippet to generate a single shot pulse out of the CCP module?