View previous topic :: View next topic |
Author |
Message |
Ranfo
Joined: 08 Sep 2008 Posts: 38
|
DSPIC33 Pull-Up Resistors |
Posted: Wed May 10, 2017 11:42 am |
|
|
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: 1911
|
|
Posted: Wed May 10, 2017 11:55 am |
|
|
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: 19587
|
|
Posted: Wed May 10, 2017 12:36 pm |
|
|
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
|
|
Posted: Thu May 11, 2017 7:16 am |
|
|
Thanks newguy.
set_Pullup(state [, pin]) is what I was looking for. |
|
|
|