Hi Rob, sounds like there is a difference with the PIC timer. Try sample 18f4620_timer3.jal on your PIC to see if you get the expected 1khz signal.
I remember now that I tried timer0 on 16 bit mode with the servo library and got incorrect results. I never got around to troubleshooting. Normally timer0 is 8 bit on 18f4620/18f4550. I wonder if you are having a similar issue. I can take a look at this again. T0CON_T08BIT = 0 sets the timer to 16 bit. I'll try with my above timer sample. I've always been able to troubleshoot without reading assembler. The math in JAL is tricky enough with this lib. Use your serial port to output values, and check the math against it. I've wondered if we need a timer library to provide a similar API for all timers. This lib would mostly just contain aliases for each timer. Matt. On Saturday, January 23, 2016 at 9:00:26 AM UTC-5, RobH wrote: > > > Hi guys, > > Addition to my previous message about servos. > > On 01/23/2016 11:07 AM, Rob Hamerling wrote: > > > > I may try another PIC type later. > > > With 18F2620 and 16f876a, which are both similar to the Jallib samples > with 18f4620 and 16f877a. > All timings are correct, both with a 20MHz resonator, and the 18f2620 > also with internal oscillator at 8 MHz! > Then I tried a 16f1933 at 20MHz: same (wrong) pulse widths as the > 16f1718, but now the pulse cycle is close to 20 ms. > So it looks like the servo library doesn't work flawlessly with enhanced > midrange PICs. It will probably require assembler code analysis to > figure out the differences, another field of little experience for me! > > Regards, Rob. > > - > *Rob H*amerling - http://www.robh.nl > -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/jallib. For more options, visit https://groups.google.com/d/optout.
