Author Topic: CAPTURE with pic 16F1829  (Read 458 times)

0 Members and 1 Guest are viewing this topic.

Offline nikoso40@yahoo.comTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
CAPTURE with pic 16F1829
« on: September 15, 2021, 11:54:38 am »
   Hi all
  I hope you all keeping well. I have stuck :palm: with capture mode in this pic. I am not posting any code yet because maybe is no necessary at this point. I am trying to implement a frequency counter with this method. The code is very simple nothing too fancy. My question is if anyone has the knowledge to tell me how to set the proper registers. I think my mistake is there. I am compiling the code with no problem but the code stacks in main waiting a flag from the  capture interrupt which never getting high. Checking the code with breaking points is not even getting into the ISR. This is the reason i think that the mistake is in the CCP setup and the timer.
I will appreciate if someone can come up with an idea. If code is needed please let me know.
Thank you your time
Nik
 

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3476
  • Country: us
Re: CAPTURE with pic 16F1829
« Reply #1 on: September 15, 2021, 12:06:53 pm »
I have done that same thing.  Language = MPASM, which might not help much.  No time to find and post the entire code.  Will be back about 1300 EDT (USA). But, please show your code regardless of how basic you think it is.

Are you trying to simulate it?  Some chips do not simulate (MPLAB 8.92) that function with all programmers/debuggers.  Be sure to check whatever device you are using.
 

Offline nikoso40@yahoo.comTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
Re: CAPTURE with pic 16F1829
« Reply #2 on: September 15, 2021, 07:00:19 pm »
   Hi
Thanks for the answer. i send the code ziped file. I have done the frequency counter on the same pic with timers and debugg with mplab and xc8 compiler with no problem. Now i am trying to learn the basics at least for capture module. I have already experimended on PWM so left me the capture and compare just you know the basics such as the setting of the registers. I think that in that point is the mistake something not doing well in the registers.
Any way if you can help will be nice. If you have the same project in asm i can read it easy. Basicly i need the user.h or the registers settings.

Best regards
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf