This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: Regarding MSPM0 SDK

Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Dear TI, we have LP - MSPM0G3507(64-PIN MCU) and MSPM0G3507 (48-PIN LQFP/VQFN (have both package IC))  and we are using the updated SDK -- mspm0_sdk_2_00_01_00,

The problem we are facing is that , we are working on project in that we are using PA0 and PA1 PIN of 48-PIN LQFP/VQFN MCU for toggling but these Pin are NOT giving proper output ,

I attached the waveform of PA0 (in that I am toggle the PIN),  here you can see  and we have try on both LQFP/VQFN But output is same (apart from that other pin are working fine) . 

Same thing we try on LP - MSPM0G3507(64-PIN MCU) , on that MCU its working fine ,

Can  you please help us to troubleshoot , whether it is the issues of MCU or SDK ,

And please test the same in your end.

Best regards,

  • Hi,

    The PA0 and PA1 are open drain IOs. It requires external pull up resistors on the circuit. 

    Best regards,

    Cash Hao

  • Thank you for replay ,

    I have one more question regarding the same ,

    By SysConfig , I generate the code for PA0 and PA1  as output , But now I read the status of that PIN by configure it as INPUT but without using SysConfig or in run time , is it possible to do that. 

    Best regards,

  • Sure, just perform the appropriate driverlib calls.

  • Hello , thank you for replay,

    I am trying the same (or toggling the LED by set and reset  function , and below that every time trying to read the status of that PIN, but it is not giving me satisfied result.

    DL_GPIO_setPins(GPIOA, DL_GPIO_PIN_0);
     get_status = DL_GPIO_readPins(GPIOA, DL_GPIO_PIN_0);

    HAL_delay(1000);

    DL_GPIO_clearPins(GPIOA, DL_GPIO_PIN_0);

     get_status =  DL_GPIO_readPins(GPIOA, DL_GPIO_PIN_0)

    HAL_delay(1000);

    Please see the above code , 

    Please correct me how I can do that, (BTW  we can do that by some function and flags , but our vision is different )

    Best regards,

  • This works for me:

    #include "ti_msp_dl_config.h"
    
    int main(void) {
      uint32_t pinvalue;
      /* Power on GPIO, initialize pins as digital outputs */
      SYSCFG_DL_init();
    
      DL_GPIO_initDigitalInput(GPIO_LEDS_USER_LED_1_IOMUX);
    
      /* Default: LED1 and LED3 ON, LED2 OFF */
      DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_2_PIN);
      DL_GPIO_setPins(GPIO_LEDS_PORT,
                      GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_LED_3_PIN);
      while (1) {
        /*
         * Call togglePins API to flip the current value of LEDs 1-3. This
         * API causes the corresponding HW bits to be flipped by the GPIO HW
         * without need for additional R-M-W cycles by the processor.
         */
    
        delay_cycles(10000000);
        DL_GPIO_togglePins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN |
                                               GPIO_LEDS_USER_LED_2_PIN |
                                               GPIO_LEDS_USER_LED_3_PIN);
    
        pinvalue = DL_GPIO_readPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
    
        if (pinvalue != 0) {
          DL_GPIO_clearPins(GPIO_MAINLED_PORT, GPIO_MAINLED_RED_LED_PIN);
        } else {
          DL_GPIO_setPins(GPIO_MAINLED_PORT, GPIO_MAINLED_RED_LED_PIN);
        }
      }
    }

    Some notes:

    The input for

    DL_GPIO_initDigitalInput(GPIO_LEDS_USER_LED_1_IOMUX);
    can be found in the ti_msp_dl_config.h file.
    It is next to the
    GPIO_LEDS_USER_LED_1_PIN
    definition. (right click on that and hit "goto definition")
    DL_GPIO_readPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN); returns "0" if all are clear and the bit for the set pins
    if any are set, so do not expect a simple 1/0.
    That is why I use "!= 0" to check, since I am only checking one pin.
    To use the pin value, you need to & it with the GPIO_LEDS_USER_LED_1_PIN.
  • BTW, the example code for showing how to read the input is modified from the

    gpio_toggle_output.c

    example in Resource Explorer Driverlib examples.