Hi Matt,

On 01/23/2016 04:42 PM, Matthew Schinkel wrote:
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.
Could be an issue with the timer or with interrupt handling, or even the compiler.

I'm afraid the 16f1718 has no Timer3 and the only 16-bit timer it has is Timer1. I used that and the output is 990 Hz (with Fosc = 20MHz), close enough I would say..

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.
All midrange PICsS have an 8-bits Timer0 (except the brand new 16f18xxx).

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'll see what I can do.

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.
Seems a good idea ... next issue: find a volunteer!

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.

Reply via email to