A generic 32 bit counter
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: A generic 32 bit counter
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.
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
Hi Jerry
I've already done a CTRL-C and put it in UserLibrary.
THANKS !
I've already done a CTRL-C and put it in UserLibrary.
THANKS !