Page 2 of 2

Re: A generic 32 bit counter

Posted: Mon May 29, 2017 3:38 pm
by Coccoliso
Ok Jerry!

Re: A generic 32 bit counter

Posted: Tue May 30, 2017 3:28 pm
by Jerry Messina
I updated the code and put it on the wiki under Timer32 in the User modules.

You could use the same basic code by replacing the TMR0 code with the TMR/PWM code you have if you need a different clock freq.

While I was doing that I tried a number of things to try and get a 32-bit counter purely in hardware without using interrupts, but I could never come up with a method of chaining the TMR/CCP modules together to make it work.

I think you'd need to have a Compare mode that just produced a Terminal Count single-pulse instead of the output SR flip-flop circuit that the pic18 CCP has.

Re: A generic 32 bit counter

Posted: Wed May 31, 2017 6:32 am
by Coccoliso
Hi Jerry

I've already done a CTRL-C and put it in UserLibrary.
THANKS !