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

DSPIC33 Pull-Up Resistors

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



Joined: 08 Sep 2008
Posts: 38

View user's profile Send private message

DSPIC33 Pull-Up Resistors
PostPosted: Wed May 10, 2017 11:42 am     Reply with quote

Is there any way to set the pull-up resistors on a DSPIC33EP512MC806 ?
Besides writing directly to the SFR?
Using PCWHD and port_b_pullups(TRUE); does not compile.

Is there a manual that covers this?
Am I missing some documentation for the PCWHD?
newguy



Joined: 24 Jun 2004
Posts: 1900

View user's profile Send private message

PostPosted: Wed May 10, 2017 11:55 am     Reply with quote

This is from a different dsPIC's header file:

Code:
////////////////////////////////////////////////////////////////// I/O
// Discrete I/O Functions: SET_TRIS_x(), OUTPUT_x(), INPUT_x(),
//                         SET_PULLUP(), INPUT(),
//                         OUTPUT_LOW(), OUTPUT_HIGH(),
//                         OUTPUT_FLOAT(), OUTPUT_BIT()
// Constants used to identify pins in the above are:

#define PIN_A0  5648
#define PIN_A1  5649
#define PIN_A2  5650
...


And from the manual:
Code:
Syntax:
 set_Pullup(state [, pin])
 
Parameters:
 Pins are defined in the devices .h file. If no pin is provided in the function call, then all of the pins are set to the passed in state. 

State is either true or false.


This is from v4.141. Just search the help file for "pullup".
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed May 10, 2017 12:36 pm     Reply with quote

And the reason for the different syntax, is that the chips in this family, support both pull up, and pull down. Hence the 'state' in the 'set_pullup' function.
Ranfo



Joined: 08 Sep 2008
Posts: 38

View user's profile Send private message

PostPosted: Thu May 11, 2017 7:16 am     Reply with quote

Thanks newguy.
set_Pullup(state [, pin]) is what I was looking for.
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