CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Please I need help with Capture Mode PIC16F
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 11, 2009 9:34 pm     Reply with quote

A 10 Hz signal has a period of 100 ms. How can you capture the signal
if it's only on for 32 ms ? That's only about 1/3 of a cycle.

A 5 Hz signal has a period of 200 ms. If it's only on for 32 ms, that's
only 1/6 of a cycle.

You can't use the CCP to capture fractions of a cycle.
Help
Guest







CCP on multiple input
PostPosted: Mon Oct 12, 2009 12:26 am     Reply with quote

PCM: Those 10 & 5 are only examples I have put to explain what I need; yes you are right about these values but it does not matter for me as long as I can get the CCP to work on two signals for certain duration. How to put it in code in simple form? Was I clear on my descriptions?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 12, 2009 12:41 am     Reply with quote

Without accurate information there is no way to tell if it will work.
Help
Guest







CCP with multi input
PostPosted: Mon Oct 12, 2009 10:24 am     Reply with quote

Why?
Is not CCP1 needs only a complete period to give a measure (2 rise / 2 falls) then how we could design ccp to grab one period although it should be set off after 1 sec. What is the time calculation needed for CCP? basically if I get measurement of different sensor in every 1 sec will be enough. I did turn on timer0 which stopped and started ccp but the result was similar.
help
Guest







help
PostPosted: Mon Oct 12, 2009 10:26 am     Reply with quote

thank you for the prompt followup, by the way.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 12, 2009 10:31 am     Reply with quote

Quote:
What is the time calculation needed for CCP?

I gave you 3 links in the 1st page of this thread that show how to setup
the CCP to do frequency capture.
help
Guest







CCP with multi input
PostPosted: Mon Oct 12, 2009 2:32 pm     Reply with quote

PCM:
Yes you gave me three links. the code I showed you from where then and I do not have problem capturing input but to control this capture is what I have the problem with. Do you know if the issue I explained is hard to solve?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 12, 2009 6:11 pm     Reply with quote

Make a program and test it. Use two boards. On one board, create
an output signal that is 5 Hz, by using delay_ms() statements.
Run it for 5 cycles. This will be 1 second duration. Then, go to
another loop that creates a 10 Hz signal. Run it for 10 cycles. This
will be 1 second duration. When done with that, go to the top and
start over again with the 5 Hz signal generation. Verify that the correct
square wave signals are output from the board on an i/o pin.
Now you have a board to create your test signals.

Next, make another board with the frequency capture program running
on it. Display the output of the board with RS232 on a terminal window
on your PC.

Connect the two boards together. The test signals from the 1st board
will go to the CCP1 input on the 2nd board.

You now have a test environment to debug and check your code on
the frequency capture board.
help
Guest







ccp om multi
PostPosted: Tue Oct 13, 2009 1:14 am     Reply with quote

PCM: do you have snippet of code that capture ccp for 1 sec then stops, consider one input signal only.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 13, 2009 1:17 am     Reply with quote

Use the code in the links that were posted on the first page of this thread.
Then just disable the #int_ccp1 interrupt when you are done.
Or leave it running, but don't do anything with the result.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group