View previous topic :: View next topic |
Author |
Message |
picj1984
Joined: 01 Mar 2010 Posts: 73
|
How do you set APFCON bits? |
Posted: Wed May 25, 2011 4:59 pm |
|
|
Hey guys,
I'm sure this information has to be somewhere, but I just can't seem to find it anywhere.
I'm using a PIC16F1825, compiler version 4.121.
I need to set the 0 bit of APFCON1 register to 0. That is all. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 25, 2011 5:18 pm |
|
|
This is one way (probably the easiest way) to do it:
Code: |
#include <16F1825.h>
#fuses HS, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=20000000)
#byte APFCON1 = getenv("SFR:APFCON1")
#bit CCP2SEL = APFCON1.0
//==========================================
void main()
{
CCP2SEL = 0;
while(1);
} |
|
|
|
picj1984
Joined: 01 Mar 2010 Posts: 73
|
|
Posted: Wed May 25, 2011 5:59 pm |
|
|
Thank you SO much. I thought this would fix my problem, but it's not.
I've done some more research on my problem, and I believe that my problem is that FOSC<2:0> is not set to 100, like it needs to be (I've got an input on A5 that I believe my PIC thinks is a clock input).
I tried the INTRC_IO but that doesn't seem to be working either.
So... my next question is... how do I set FOSC<2:0> to 100? |
|
|
picj1984
Joined: 01 Mar 2010 Posts: 73
|
|
Posted: Wed May 25, 2011 6:25 pm |
|
|
Nevermind, I don't think that's the problem. I believe I'll need to start a new thread if I need any additional help.
Thx |
|
|
ljbeng
Joined: 10 Feb 2004 Posts: 205
|
|
Posted: Thu Sep 15, 2011 7:34 am |
|
|
I have a 16f1825 and I cannot get the ICD-U64 to program or read the correct ID (It read 2FE1). Is there something special I am missing?
Thanks. |
|
|
|