wp100
Advanced Member level 6
- Joined
- May 15, 2009
- Messages
- 3,051
- Helped
- 884
- Reputation
- 1,783
- Reaction score
- 733
- Trophy points
- 113
- Location
- Prime Meridian
- Activity points
- 0
Hi,
Have not actually run your code, but couple of things -
You have Configed it for the internal osc but ideally also use the OSCCON register to set the frequency - ok it defaults to 4 meg but it adds clarity for the delays.
For some reason you setup ANSEL with IORWF ?? then start the ADC with ADCON0, followed a couple of intructions later by Clearing ANSEL ..? - not sure why.
If your servo is going mad at that voltage then its an ideal time to use debugger to see whats happening - but don't think it available on that chip.
You could run Sim, but instead of the ADC just input the binary value for 0.95v and see what happens when thats passed to your delay values.
Have not actually run your code, but couple of things -
You have Configed it for the internal osc but ideally also use the OSCCON register to set the frequency - ok it defaults to 4 meg but it adds clarity for the delays.
For some reason you setup ANSEL with IORWF ?? then start the ADC with ADCON0, followed a couple of intructions later by Clearing ANSEL ..? - not sure why.
If your servo is going mad at that voltage then its an ideal time to use debugger to see whats happening - but don't think it available on that chip.
You could run Sim, but instead of the ADC just input the binary value for 0.95v and see what happens when thats passed to your delay values.