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

pull-ups 12c509

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



Joined: 08 Apr 2005
Posts: 1

View user's profile Send private message

pull-ups 12c509
PostPosted: Fri Apr 08, 2005 2:16 pm     Reply with quote

Hi
I'm using for the first time the 12c509 with pcw compiler 3.15
How can I manage the pull-ups on this chip.
On help there is write that the port_b_pull_up command is available only for 16 & 14 bit micro.

How can I use this function on this pic?

Tnx
Mario Embarassed
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Apr 08, 2005 2:44 pm     Reply with quote

If you look at the datasheet, the OPTION register bit 6 enables/disables the GP0,GP1/GP3 pullups.

Load the W register with your desired bit configuration for the OPTION register then use the assembly OPTION instruction to transfer it to the OPTION register similar to the following:

#asm
movlw 0x40
OPTION
#endasm

BTW< beware that other instructions that use the OPTION register will overwrite the OPTION register, so you will need to set all the bits at one time manually. For example a setup_timer() command will overwrite the OPTION bits. So use the datasheet,plan ahead and set them all with one command.
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