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 CCS Technical Support

PIC 18F452 problem

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



Joined: 26 Apr 2004
Posts: 2

View user's profile Send private message

PIC 18F452 problem
PostPosted: Mon Apr 26, 2004 12:49 pm     Reply with quote

I am using PIC 18F452 with CCS v3.179. I haven't been able to get PIN_A4 and PIN_A6 to high. What am I doing wrong?
fpgeh



Joined: 07 Sep 2003
Posts: 19
Location: Vancouver, BC

View user's profile Send private message

PostPosted: Mon Apr 26, 2004 1:07 pm     Reply with quote

Pin A4 is an open drain pin. This means it can only drive low. To get the pin high, you will need a pullup reistor to Vcc.

As for pin A6, I'm not sure what the porblem could be. The datasheet does say that on a Power-On Reset pins A4 and A6 are configured as inputs, the rest of port A as outputs.
fpgeh



Joined: 07 Sep 2003
Posts: 19
Location: Vancouver, BC

View user's profile Send private message

PostPosted: Mon Apr 26, 2004 1:08 pm     Reply with quote

Sorry, to correct. On Power-On reset, Pins A4 and A6 are configured as digital inputs, the rest as analog inputs.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 26, 2004 1:35 pm     Reply with quote

Quote:
I am using PIC 18F452 with CCS v3.179. I haven't been able to get PIN_A4 and PIN_A6 to high. What am I doing wrong?

According to the 18F452 data sheet, to get Pin A6 configured as an
i/o pin, you must use the RC_IO or EC_IO oscillator option.

So in your #fuses statement must use one of those two options,
instead of HS or XT, etc.
dijuka



Joined: 26 Apr 2004
Posts: 2

View user's profile Send private message

PostPosted: Mon Apr 26, 2004 3:30 pm     Reply with quote

Thank you for helping out.
Birdasaur



Joined: 07 Oct 2003
Posts: 29

View user's profile Send private message

PostPosted: Fri Aug 06, 2004 9:24 am     Reply with quote

After changing the Fuse statement appropriately, how would we access PIN_A6?

add a manual define to your file like

#define PIN_A6 31750

??

I ask because it isn't really available anywhere in the header file that I see and wouldn't compile otherwise.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 10:50 am     Reply with quote

That would be one way. You can always manipulate the bits in the registers also.
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