View previous topic :: View next topic |
Author |
Message |
K M Saravanan
Joined: 08 Nov 2016 Posts: 8 Location: India
|
ECCP in pic18f47j53 |
Posted: Tue Nov 29, 2016 10:54 pm |
|
|
Hi to all,
How can i declare Eccp and how to use this pin to calculate pulse raise and fall time.
Advance thanks to all.. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 30, 2016 12:29 am |
|
|
Get a text search utility program (or use Windows search), and search
all the files in the CCS compiler Examples directory for this word:
I did this, using Examine32 (a text search program). I got the output
shown below. In the 2nd file, I get an answer. See below in bold.
I assume you meant to measure a pulse width, and not the rise and fall
times of the edges, which might be only nano-seconds in duration.
Quote: |
c:\program files\picc\examples\ex_ccp1s.c 12/30/2013 11:07:48 AM 4477
//// to generate a single pulse of a predefined time in response ////
delay_ms(1000); // Debounce - Permit only one pulse/sec
delay_ms(1000); // Debounce - Permit only one pulse/sec
c:\program files\picc\examples\ex_ccpmp.c 12/30/2013 11:06:58 AM 3397
//// measure a pulse width. ////
//// Connect a pulse generator to pin C2 and pin C1 ////
long rise,fall,pulse_width;
pulse_width = fall - rise; // CCP_1 is the time the pulse went high
} // CCP_2 is the time the pulse went low
// pulse_width/(clock/4) is the time
printf("\r%lu us ", pulse_width/5 );
c:\program files\picc\examples\ex_cust.c 8/5/2016 8:53:36 AM 4046
void pulse_B0() {
void send_pulses() {
pulse_B0();
send_pulses();
c:\program files\picc\examples\ex_linbus_slave.c 6/12/2007 5:06:20 PM 5038
else // DEBUG Pulse on RC5
c:\program files\picc\examples\ex_pgen.c 2/19/2005 9:46:42 AM 3076
//// and the other the low time of the pulses. If a switch is in ////
//// then issue a single pulse. ////
c:\program files\picc\examples\ex_pulse.c 8/5/2016 8:53:36 AM 4205
//// EX_PULSE.C ////
//// This program uses the RTCC (timer0) to time a single pulse ////
//// Connect pulse generator to pin B1 ////
c:\program files\picc\examples\ex_pwm.c 8/5/2016 8:53:36 AM 4544
set_pwm1_duty(value); // This sets the time the pulse is
c:\program files\picc\examples\ex_sk_ultrasonic.c 9/1/2016 10:16:22 AM 3432
//// This module uses sonar to detect distance by sending a pulse and ////
//The sensor is triggered by a HIGH pulse of 10 or more microseconds.
//Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
c:\program files\picc\examples\ex_sk_ultrasonic_ccp.c 9/15/2016 9:49:26 AM 4195
//The sensor is triggered by a HIGH pulse of 10 or more microseconds.
//Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
c:\program files\picc\examples\ex_smt_period_duty.c 6/15/2016 10:38:20 AM 3690
SignalDuty = smt1_read(SMT_CAPTURED_PULSE_WIDTH_REG); //read captured duty |
|
|
|
K M Saravanan
Joined: 08 Nov 2016 Posts: 8 Location: India
|
|
Posted: Wed Nov 30, 2016 12:49 am |
|
|
Thanks for your reply.
I checked the data sheet and I am not getting the pin of ECCP1.
ECCP1-ECCP3 is a remappable pin. How can I declare the pin ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Wed Nov 30, 2016 1:53 am |
|
|
Look at the sticky at the top of the forum. Third one down. |
|
|
K M Saravanan
Joined: 08 Nov 2016 Posts: 8 Location: India
|
ECCP in pic18f47j53 (Solved) |
Posted: Thu Dec 01, 2016 4:55 am |
|
|
Thanks to all.
I check the example files (EX_PinSelect2),
Thank you. |
|
|
|