On Apr 10, 8:56 am, Rob Hamerling <[email protected]> wrote:
> the 16-bits core has a bit T08BIT in T0CON to
> configure Timer0 as 8- or 16-bits timer/counter. So you could indeed use
> "if defined(T0CON_T08BIT)", why do you think this might not be 'clean'
> enough? And you'll have to set or reset this bit to make sure Timer0 is
> configured properly.
> Nevertheless only the 18Fs have a 16-bits Timer0, and as far as I know
> all 18Fs have it. So a check on cpu type would be sufficient, but if
> that is 'cleaner'....
>

Hi Rob,

Thanks for your help on this.  I hadn't noticed the target_cpu /
PIC_16 feature before now.  I may try that, or use T08BIT which is
specific to the problem at hand.

What I'm going for is non-blocking delays in the range of 50mS to 2 or
3 seconds, for some error-blink sequences for CANbus.  The chips are
all 18F, such as 18F2585.

If my back-of-envelope calculations are correct, with a 20MHz crystal,
and timer0 in 8-bit mode, the longest period (timer overflow) is 13mS,
and with the other timers: 1,2,3, the biggest prescaler is only 8, so
I can only get about 100mS period. If timer0, in 16-bit mode with 256
prescaler really works, I should be able to get almost 3.5 seconds
before overflow.  I'll give it a try.

If I can use the timer in such a fashion, I won't be quite so
dependent on other parts of the application yielding the cpu so often.

Thank you,

William

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to