At 02:47 PM 5/21/97 +0200, you wrote: >Jason E. Brown writes: >> Let me know what you think [about the ESC code]..... > >One thing I have noticed is that the PWM frequency will be about 20 >Hz, with a 4 MHz oscillator. You count 100 timer0 timeouts for each >pulse cycle. There is a table of values that returns the length of the >high part of the cycle but instead of using 100 separate pulse high >times there are actually only about 30 returned by the table >lookup. This means that you could use 32 separate duty cycles and >count only 32 timer0 timeouts instead of 100 and it would give exactly >the same duty-cycle resolution but increase the PWM frequency by a >factor of 3. > >Even still, I was under the impression that it would be desirable to >have a PWM frequency in the kiloHertz range and that only 16 or >perhaps 8 distinct duty cycles would be needed (at least for RC >cars). Can anyone comment on this? Does anyone know what the time >constant of an RC motor is? > >Mal Goris >-- >http://www.nfra.nl/~mgoris/ yeah, It was a bit too slow.. That (plus many other reasons) is why I scrapped that approach.. I am now working on a single motor driver... Better resoulution and less buggy. Now instead of using TMR0 interrupts to update the motor, (too many timing problems) I am using interrupt change on PORTB.. When the RC pulse comes in, tmr0 is reset and a flag is set. It then returns to the main loop, when pilse goes low tmr0 is put in a timing varable then direction and speed are calculated and updated to the motor.. So far this is working much better... Thanks for your input... Jason E. Brown Other Worlds 3801 Dayton Blvd Chattanooga TN 37415 (423)870-1074 othrwrld@cdc.net = business. jebrown@cdc.net = me.