Glug.. help ! glug glug... I'm drowning...... this is way over my head
As far as I recall Darrels routines are software PWM and not Hardware ? However having said that I have not tried all channels at the same time to control two independant tracks.....
On the subject of frequencies... when using a 4 Mhz xtal the rate at which the pulses are sent is quite noticeable at slow speed as each pulse is sent causes the model to "jump" at each step. Using a 20Mhz Xtal this is less noticable. When we were trying different settings, higher frequencies (estimated at around a few Khz ) were produced and the armature sang as the model made its way down the track.
Steve hit on the subject of a frequency higher than the ear can hear, but I'm wondering if these pulses were sent at say 30Khz, the loco would start to see them as almost a constant voltage level. Its a bit irrelevent as under the settings in Darrels code, I can't get a frequency higher than 260 hz with two channels when running the 16f767 with a 20 mhz xtal.
Bookmarks