How to configure TMR1 in dsPIC to count pulses

Status
Not open for further replies.

pic.programmer

Advanced Member level 3
Joined
Aug 19, 2015
Messages
773
Helped
141
Reputation
284
Reaction score
140
Trophy points
43
Activity points
7,531
I want to know how to configure TMR1 in dsPIC33FJ12MC202 to count pulses. I am trying to make a frequency counter. The dsPIC will run at 8 MHz x 4xPLL = 32 MHz. I will be using Timer2 to generate exact 1 sec delay. The Timer1 have to count the pulses on T1CK pin during 1 sec and display it on LCD. I have done some coding but I am not getting exact value. For 500 KHz it displays as 487.x KHz. I am attaching my mikroC PRO dsPIC project and Proteus simulation file.
 

Attachments

  • Frequency Counter.rar
    84.5 KB · Views: 112

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…