View Full Version : Servo Pulse period at 8mhz
Tom Gonser
- 9th October 2005, 20:47
Hi all:
I have been looking for information about what the period for Pulsout would be for an 8 mhz 16F88. I have a program that is working at 4mhz, but want to move it to 8mhz.
The servo I am using now responds now to pulsout from 90 to 250 but at 4MHZ...
At 8 mhz what would these values be? How does one think about this - I have no mental model for what is going on...
Thanks,
Tom
mister_e
- 9th October 2005, 20:56
multiply your value by 2
The resolution of PULSOUT is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the Period of the generated pulse will be in 10us increments. If a 20MHz oscillator is used, Period will have a 2us resolution. Defining an OSC value has no effect on PULSOUT. The resolution always changes with the actual oscillator speed.
Tom Gonser
- 9th October 2005, 21:01
And if NO Osc is used as with the 16F88 internal??? I am running at 4mhz now, and have seen mention of how to run at 20mhz.. BUT what about 8mhz..
does a '100' at 4 mhz = a 50 at 8mhz? Or is it a '200' ? or is it linear?
TG
mister_e
- 9th October 2005, 21:14
let's trim the above quote
If a 4MHz ... in 10us increments.
If a 20MHz ... 2us resolution.
So if you have '100' @ 4Mhz... you'll have '200' @ 8MHZ. Of course it's linear as the OSC definition don't change anything in the result.
It doesn't matter if you use the internal or the external one... must have some heartbeat somewher ;)
Dick Ivers
- 10th October 2005, 13:57
TG,
Don't forget to add:
DEFINE OSC 8 at the start of your program. This is needed to adjust other time dependent commands.
I also run my servos with 8 mhz. For PULSOUT do as MisterE says and multiply by 2. So, if your old servo range was 90 to 250 your new range will be 90*2 to 250*2. The servo will move the same number of degrees but with greater resolution.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.