A generic 32 bit counter

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: A generic 32 bit counter

Post by Coccoliso » Mon May 29, 2017 3:38 pm

Ok Jerry!

Jerry Messina
Swordfish Developer
Posts: 1245
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: A generic 32 bit counter

Post by Jerry Messina » Tue May 30, 2017 3:28 pm

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.

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: A generic 32 bit counter

Post by Coccoliso » Wed May 31, 2017 6:32 am

Hi Jerry

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

Post Reply