lpcware

LPCOpen 1.03 SCU I/O mode definition error

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by wlamers on Wed Aug 07 10:50:36 MST 2013
This is probably already solved in version 1.04 of LPCOpen or elsewhere discussed, but to be sure I mention it here.

The SCU function mode definitions (pull-up pull-down, repeater etc) in the header file scu_18xx_43xx.h are incorrectly defined. The confusion is probably caused by the fact that disabling the internal pull-down mosfet requires setting bit 4 high instead of low (EPUN, see table 134-136 starting on page 299 of revision 1.6 of the UM).

Replace the following definitions:


#define SCU_MODE_MODE_INACT        (0x0 << 3)/*!< Disable pull-down and pull-up resistor at resistor at pad */
#define SCU_MODE_MODE_PULLDOWN     (0x1 << 3)/*!< Enable pull-down resistor at pad */
#define SCU_MODE_MODE_PULLUP       (0x2 << 3)/*!< Enable pull-up resistor at pad */
#define SCU_MODE_MODE_REPEATER     (0x3 << 3)/*!< Enable pull-down and pull-up resistor at resistor at pad (repeater mode) */



With these:


#define SCU_MODE_MODE_INACT        (0x1 << 4)       /*!< Disable pull-down and pull-up resistor at pad */
#define SCU_MODE_MODE_PULLDOWN     (0x3 << 3)       /*!< Enable pull-down and disable pull-up resistor at pad */
#define SCU_MODE_MODE_PULLUP       (0x0 << 4)       /*!< Keep pull-up resistor at pad (reset value) */
#define SCU_MODE_MODE_REPEATER     (0x1 << 3)       /*!< Enable pull-down and pull-up resistor at pad (repeater mode) */

Outcomes