Capture on CCP1

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
waligator
Posts: 36
Joined: Mon Mar 12, 2012 9:14 pm
Has thanked: 5 times
Been thanked: 7 times
Contact:

Capture on CCP1

Post by waligator »

Hi all,

To begin to understand the function capture of the timer 1, I would at every rising edge on pin CCP1, my variable is incremented.

I will post the beginning of pragramme but never increment the counter.

Someone could help me.

Steve
Attachments
tmr1 CCP1 capture.fcf
(14 KiB) Downloaded 264 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Capture on CCP1

Post by Enamul »

Hi
I have tried couple of months back the capture function and can't mange to sort that. Not was quite sure why but will have a look again and let you know.
Enamul
University of Nottingham
enamul4mm@gmail.com

waligator
Posts: 36
Joined: Mon Mar 12, 2012 9:14 pm
Has thanked: 5 times
Been thanked: 7 times
Contact:

Re: Capture on CCP1

Post by waligator »

Yes, it must be a bad command. I can not find it. Precision, I use a 16F876A.

Steve

waligator
Posts: 36
Joined: Mon Mar 12, 2012 9:14 pm
Has thanked: 5 times
Been thanked: 7 times
Contact:

Re: Capture on CCP1

Post by waligator »

It's good, it works. :D I made a syntax error when the macro "capture" is called. :oops:

The problem is fixed and it works well as a pulse counter.
Attachments
tmr1 CCP1 capture.fcf
(14 KiB) Downloaded 307 times

ProtonLaser
Posts: 18
Joined: Wed Jan 23, 2013 7:07 pm
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Capture on CCP1

Post by ProtonLaser »

Yes but hae you tried capturing the timer value???

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Capture on CCP1

Post by medelec35 »

ProtonLaser wrote:Yes but hae you tried capturing the timer value???
I have done that for you in this post:
http://www.matrixmultimedia.com/mmforum ... 052#p46225

Martin
Martin

ProtonLaser
Posts: 18
Joined: Wed Jan 23, 2013 7:07 pm
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Capture on CCP1

Post by ProtonLaser »

Hi Martin,
Yes i tryed it and it did not capture the timers values.

**Tryed the version you proposed, worked great!!

Thank you again Martin for giving a solution!!

I will give the timer option again and come back.


Abel

Post Reply