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 support@ccsinfo.com

How do you set APFCON bits?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
picj1984



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

How do you set APFCON bits?
PostPosted: Wed May 25, 2011 4:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 25, 2011 5:18 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 25, 2011 5:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 25, 2011 6:25 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 15, 2011 7:34 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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