View previous topic :: View next topic |
Author |
Message |
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
pic16f873 CCP feature |
Posted: Sun Jul 26, 2009 4:59 am |
|
|
I am trying to make a project but I need some sample program to understand CCP feature of pic16f873 and ADC of this micrcontroller
Capture
Compare
PWM
CCP |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 26, 2009 2:26 pm |
|
|
Get a "text search" program such as Examine32, or maybe another
program that is free. Set it to search the CCS Examples directory.
Search for the function that is used to setup the CCP module, which is:
setup_ccp1. Run it, and you will get results like these:
Quote: |
c:\program files\picc\examples\ex_ccp1s.c 1/7/08 11:24:54 AM 4477
setup_ccp1(CCP_COMPARE_CLR_ON_MATCH); // Configure CCP1 in COMPARE mode
setup_ccp1(CCP_COMPARE_SET_ON_MATCH); // Configure CCP1 to set
setup_ccp1(CCP_COMPARE_CLR_ON_MATCH); // Configure CCP1 in COMPARE
c:\program files\picc\examples\ex_pwm.c 10/10/07 9:44:58 AM 7447
setup_ccp1(CCP_PWM); // Configure CCP1 as a PWM
c:\program files\picc\examples\ex_ccpmp.c 8/3/05 11:41:20 AM 3379
setup_ccp1(CCP_CAPTURE_RE); // Configure CCP1 to capture rise
setup_ccp2(CCP_CAPTURE_FE); // Configure CCP2 to capture fall
c:\program files\picc\examples\ex_react.c 5/12/09 10:04:04 AM 4881
setup_ccp1(CCP_CAPTURE_RE);
setup_ccp1(CCP_CAPTURE_FE); |
This shows 4 filenames (and their directory location) that setup the CCP.
Also, for more examples, you could search on my name in the CCS
search page, and search for these terms:
Quote: | Tachometer
set_pwm1_duty
read_adc volts |
On the last one, set it to: Search for all terms |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sun Jul 26, 2009 2:29 pm |
|
|
ok as far as you say -
but WHICH feature do you need ?
Capture compare for event duration / freq measurement ?
OR?
PWM generation ?
OR?
fixed frequency generation ?
what you ask is WAY too broad
what are you trying to DO ?
more specificity would be required to know how to craft an answer
that you would understand. |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Wed Jul 29, 2009 8:46 am |
|
|
asmboy wrote: | ok as far as you say -
but WHICH feature do you need ?
Capture compare for event duration / freq measurement ?
OR?
PWM generation ?
OR?
fixed frequency generation ?
what you ask is WAY too broad
what are you trying to DO ?
more specificity would be required to know how to craft an answer
that you would understand. |
I am trying to built a Ultrasonic Range meter and I need to understand more about capture feature of this mc.
Thanks. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
|
|