View previous topic :: View next topic |
Author |
Message |
prayami
Joined: 22 Dec 2004 Posts: 78
|
PIC18LF4525 |
Posted: Mon May 23, 2005 4:38 pm |
|
|
Hi...
My program that calculates the input frequency using CCP2 i.e RC1 PIN
on PIC18F4525 works fine. But if we use PIC18LF4525 then it is showing
wrong frequency. Yes, I have set configuration bit for RC1 to be used as
CCP2.
Is there any different thing, we have to do to work with PIC18LF4525.
The Vdd we used is same for both no change in any voltage level.
Thanks..... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 23, 2005 5:31 pm |
|
|
You didn't tell us much. What voltage is the LF PIC running at ?
What crystal frequency is used for the LF PIC ? |
|
|
prayami
Joined: 22 Dec 2004 Posts: 78
|
|
Posted: Mon May 23, 2005 5:36 pm |
|
|
I used 5V supply voltage. And 10Mhz crystal with PLL so 40MHz clock
freq. I used same for both circuit.
Thanks... |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon May 23, 2005 5:49 pm |
|
|
Maybe it doesn't have anything to do with LF vs F but maybe it has to do with the rev of silicon. Read the errata on microchip's website. That's about all I can offer since you didn't post a test program. |
|
|
prayami
Joined: 22 Dec 2004 Posts: 78
|
|
Posted: Mon May 23, 2005 6:47 pm |
|
|
Here is the program that I have just tested to check output waveform
on PIN C5. What I find here, There is no output on PIC18LF4525. But On
PIC18F4525, it is fine.
Is there something differ in configuration bits..?
Quote: |
#CASE
#include <18F4525.h>
#fuses H4,NOWDT,NOPROTECT,NOLVP,BROWNOUT,PUT,NOPBADEN,NOXINST,NOMCLR
#use delay(clock=40000000)
int1 HighPulse=0;
unsigned int8 x;
#int_ccp2
void ccp2_isr()
{
if(HighPulse==0)
{
output_high(PIN_C5);
HighPulse=1;
}
else
{
output_low(PIN_C5);
HighPulse=0;
}//if(HighPulse==1)
}//#int_ccp2
void main() {
set_tris_c(0x9F); //C5-C6 output
setup_ccp2(CCP_CAPTURE_RE); //For AFM Module
enable_interrupts(INT_CCP2);
enable_interrupts(GLOBAL);
while(TRUE) {
x=10;
}//while(TRUE)
}//main
|
|
|
|
|