CC2340R5: High drive IO configuration

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Hello,

What's the recommended drive strength (IOSTR) setting when using the 8 mA drive current setting?

Screenshot 2026-06-17 134206.png

Is the recommendation to use the max drive strength? Or should you just leave it in Auto?

Munan

  • Hello Munan Xu,

    We should be able to set this in sysconfig in the GPIO section under output strength. 

    Thanks,
    Alex F

  • Hi Alex,

    Yes this is possible to configure a pin with drive strength using sysconfig, but it is also important to actually write out what the recommended settings are for this since not every customer is using sysconfig, and then it requires everyone who looks at this post now to go into sysconfig and configure a GPIO to see what it spits out.

    For what it's worth, Sysconfig seems to leave IOSTR on "auto" as a default unless you ask it to reduce the slew rate:

    Which also if you look at the TRM description of this feature:

    It's not really clear which one ends up controlling the current sourcing or sinking capability of the pin. Sysconfig seems to imply that IOSTR is just controlling the slew rate, but the TRM seems to imply that to actually get 8-10 mA out of a high drive pin across any supply voltage situation (whether or not that is advised is up to the user to decide) you would need to override the auto setting for IOSTR and set it to maximum. Or is the TRM saying that somehow the auto setting automagically does this for you?

    Thoughts?

    Munan

  • Also I just realized further down that list there is yet another field for slew control, so I don't think the sysconfig tool ever touches drive strength, just drive current. So then the question really is just what is the difference between the two bitfields IOSTR and IOCURR

    Munan

  • Hello,

    The actual file that has the sysconfig related defines is GPIOLPF3.h, in this find:
    #define GPIO_CFG_DRVSTR_LOW_INTERNAL  (IOC_CONFIG_DRIVE_STRENGTH_2MA)
    #define GPIO_CFG_DRVSTR_MED_INTERNAL  (IOC_CONFIG_DRIVE_STRENGTH_4MA)
    #define GPIO_CFG_DRVSTR_HIGH_INTERNAL (IOC_CONFIG_DRIVE_STRENGTH_8MA)

    Sysconfig abstracts it:

    Setting sysconfig GPIO to strength to medium sets the ti_drivers_config.c GPIO to GPIO_CFG_OUT_STR_MED

    which then is abstracted to 

    #define GPIO_CFG_OUT_STR_LOW  GPIO_CFG_DRVSTR_LOW_INTERNAL
    then you can find in the ioc.h file this:
    //! \hideinitializer Manual mode, 8 mA drive strength
    #define IOC_CONFIG_DRIVE_STRENGTH_8MA (IOC_IOC12_IOCURR_CUR_8MA)
    //! \hideinitializer Manual mode, 4 mA drive strength
    #define IOC_CONFIG_DRIVE_STRENGTH_4MA (IOC_IOC12_IOCURR_CUR_4MA)
    //! \hideinitializer Manual mode, 2 mA drive strength
    #define IOC_CONFIG_DRIVE_STRENGTH_2MA (IOC_IOC12_IOCURR_CUR_2MA)
    // Automatic mode is not supported on this device
    #undef IOC_CONFIG_DRIVE_STRENGTH_AUTO
     
    The above shows our four modes (including automatic) which means this should be IOSTR which also happens sets the current (IOCURR), so yes sysconfig does set the drive strength. 

    You can likely also set the register directly using:

    //*****************************************************************************
    //
    // API Functions and prototypes
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    //! \brief Set the configuration and mux option for a specific DIO.
    //!
    //! \param dioNumber specifies the DIO to configure (0-25).
    //!
    //! \param config The configuration to apply. This is a bitwise OR of
    //!  - One of the \ref ioc_config_drive_strength_options
    //!    "IOC Config drive strength options"
    //!  - One of the \ref ioc_config_slew_rate_options
    //!    "IOC Config slew rate options"
    //!  - One of the \ref ioc_config_pull_control_options
    //!    "IOC Config pull control options"
    //!  - One of the \ref ioc_config_edge_detection_options
    //!    "IOC Config edge detection options"
    //!  - One of the \ref ioc_config_standby_wakeup_options
    //!    "IOC Config standby wakeup options"
    //!  - One of the \ref ioc_config_shutdown_wakeup_options
    //!    "IOC Config shutdown wakeup options"
    //!  - One of the \ref ioc_config_io_invert_options
    //!    "IOC Config IO invert options"
    //!  - One of the \ref ioc_config_io_mode_options "IOC Config IO mode options"
    //!  - One of the \ref ioc_config_input_buffer_options
    //!    "IOC Config input buffer options"
    //!  - And one of the \ref ioc_config_hysteresis_options
    //!    "IOC Config hysteresis options"
    //!
    //! \param mux Selects the function of the DIO. It must be one of the following:
    //!  - \ref IOC_MUX_GPIO
    //!  - \ref IOC_MUX_DTB
    //!  - \ref IOC_MUX_ANALOG
    //!  - \ref IOC_MUX_PERIPH_FUNC1
    //!  - \ref IOC_MUX_PERIPH_FUNC2
    //!  - \ref IOC_MUX_PERIPH_FUNC3
    //!  - \ref IOC_MUX_PERIPH_FUNC4
    //!  - \ref IOC_MUX_PERIPH_FUNC5
    //
    //*****************************************************************************
    __STATIC_INLINE void IOCSetConfigAndMux(uint32_t dioNumber, uint32_t config, uint32_t mux)
    {
        // Check the arguments.
        ASSERT(dioNumberLegal(dioNumber));
        ASSERT((config & IOC_CONFIG_ALL_M) == config);
        ASSERT((mux & IOC_IOC0_PORTCFG_M) == mux);
    
        // Set the config and mux option for the specified DIO.
        HWREG(IOC_BASE + IOC_O_IOC0 + dioNumber * IOC_REG_SPACING) = config | mux;
    }

    Best,
    Alex F