MSPM0G1105: How to set GPIO pull-up/pull-down resistors

Part Number: MSPM0G1105
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I want to set pull-up/pull-down resistors for each GPIO pin, but I don't know how to do it.

I understand that it can be set with the PINCM register, but I don't understand how to set it for each GPIO pin.

I'm looking at the "MSPM0 G-Series 80MHz Microcontrollers Technical Reference Manual".

Hiroshi Yamada

  • Hi Hiroshi,

    I do not find a convenient way to configure all GPIO pins to pull-up/down by some one-step operation.

    But you could manually configure pull-up/pull-down resistor for each GPIO one by one in syscfg, just follow the steps below.

    Best Regards,

    Pengfei

  • If you want to do it programmatically, set up one in sysconfig and then dive down into the sysconfig-created source to see how it is done.

  • Hi Pengfel,

    Thank you for the information.

    Understood.

    So it's not mentioned in the manual?

    So I have to configure it with syscfg and check the configuration information myself, right?

    Best regards,

  • It is *mentioned* in the manual, but it is often easier to let the TI engineers wade through and figure it out, and use SysConfig to reap the fruits of their labours. Though I have found bugs in SysConfig generated code.

  • There is a function DL_GPIO_setDigitalInternalResistor() which does this, but it also sets all the other bits, including changing the pin to PF=1 (GPIO), so this function is probably not useful.

    ----------------

    Generally, you can do each pin using something like:

    > IOMUX->SECCFG.PINCM[pincmIndex] |= IOMUX_PINCM_PIPU_ENABLE ; // (Probably should explicitly clear IOMUX_PINCM_PIPD_ENABLE as well)

    where pincmIndex can be deduced from data sheet (SLASF11C) Table 6-1. For specific usages, sysconfig will generate #define-s referencing names of the form IOMUX_PINCMnn.

    -----------------

    The first things you'll notice about Table 6-1 are that (a) the set of indices isn't dense, i.e. some of the array entries aren't used (b) there are some pins you probably don't want to change. So I suspect you don't want to do this to all of the pins (e.g. with a simple for() loop), and how you decide says how to choose the set of IOMUX_PINCMnn-s.