For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.
operation at 300Hz will require all the calculated 50Hz values to be divided by 6.
In the Servo c code file, the following substitutions define a 2.5ms channel period. Eight of these make the 20ms cycle time. The values are based on the clock frequency and are used as a H:L pair to form a 16-bit value for one of the timer compare registers:
If you have a fixed clock frequency for this application, it should be possible to replace these substitutions with constant values (or combine the calculated values into an unsigned int, divide by 6, and re-split into H:L bytes).
The following substitution is the multiplier for the calculated position pulse values:
unsigned int MX_SERVO_CLK_COUNT = %j;
Replacing it with the line below should scale the pulses to the new frequency: