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

PIC18F45K40 PORTD pullups

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



Joined: 19 Feb 2017
Posts: 4

View user's profile Send private message

PIC18F45K40 PORTD pullups
PostPosted: Sun Feb 19, 2017 4:50 pm     Reply with quote

Hello!

I’m trying to set the internal pull-ups on PORTD in a PIC18F45K40. In the other ports I used port_x_pullups(), but in PORTD this function is not implemented. Verifying the PIC datasheet I found that PORTD have internal pull ups. How I can set this pull-ups?

Thanks
_________________
Ricardo
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Feb 19, 2017 5:06 pm     Reply with quote

Always post your compiler version......
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 19, 2017 5:11 pm     Reply with quote

Add this code above main(). Then you can use the function.
Code:
#byte WPUD = getenv("SFR:WPUD")
#define port_d_pullups(x) WPUD = x

Usage:
Code:

port_d_pullups(0xFF);  // Enable pull-ups on all PortD pins

Also, this needs to be reported to CCS support so they can add it.
RicSToz87



Joined: 19 Feb 2017
Posts: 4

View user's profile Send private message

PORTD Pull-ups
PostPosted: Mon Feb 20, 2017 5:17 am     Reply with quote

SOLVED!!
Thanks PCM!
_________________
Ricardo
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