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

How to setup a portb weak pullup

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



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

How to setup a portb weak pullup
PostPosted: Sat Oct 21, 2006 3:01 am     Reply with quote

for the 18f2525 it says in the data sheet
INTCON2<7> can be cleared to turn on the portb pullups and can be set by individual port latches.
Can anyone tell me where the port latches are located?

Thanks in advance
Ttelmah
Guest







PostPosted: Sat Oct 21, 2006 4:52 am     Reply with quote

The instruction - 'PORT_B_PULLUPS(TRUE)', clears this bit, to enable the pullups.
The pullups are only enabled, if the pin is set as an input, which is controlled by the TRIS instruction, or (if using 'standard_io'), by simply reading the register.
The actual line in the data sheet you are reading (register 9-2), is misleading, and is corrected in section 10-2 of the sheet. It is the TRISD register setting, not the data latch setting that controls the individual pull-ups.
The data latch, is what you talk to, when you output data.

Best Wishes
Eugeneo



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

PostPosted: Sat Oct 21, 2006 3:21 pm     Reply with quote

Thank you for that info.

I guess that means all inputs are pulled up when the pull ups are enabled and all outputs are disabled automatically.

Is there any way of setting an individual pullup to be off? I need ext(B0) and ext1(b1) to floating and these are going to be inputs. I need B2-7 to be pulled up.

It looks like I may need a resistor sip.
Ttelmah
Guest







PostPosted: Sun Oct 22, 2006 2:40 am     Reply with quote

Not on this chip.
Some of the smaller chips allow the pullups to be individually selected. This one doesn't. However, remember they are very low current (50uA each), so will typically not matter if enabled on pins that don't need them.

Best Wishes
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