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.

TDA2EXEVM: GPIO configuration

Part Number: TDA2EXEVM
Other Parts Discussed in Thread: TPS3851

Hi,

We are using TPS3851 External watchdog with TDA2Ex.

As per the TDA2Ex_TRM, the pin connected to WDI is a multiplexed pin.

So, we need to make the pin as gpio first. And then we need to configure gpio4_17 as output.

We want to toggle the WDI pin through gpio4_17.

Please let us know the procedure to configure the multiplexed pin as gpio, make it as output and toggle the WDI pin.

Regards,

Ashish

  • Hi Ashish,

    For GPIO functionality you can check the PDK GPIO example: <vsdk>\ti_components\drivers\<pdk>\packages\ti\csl\example\gpio\gpio_toggle
    Can you please let me know which section of the TRM you are referring to "As per the TDA2Ex_TRM, the pin connected to WDI is a multiplexed pin.".

    Regards,
    RIshabh
  • Hi Rishabh,

    Thank you for the reply.

    We have set the value of register 'CTRL_CORE_PAD_MCASP1_AXR11' as 0x0000000E as the WDI pin is connected to gpio4_17 and we want to use it for External watchdog configuration. Then we configured the 'MCASP_PFUNC', MCASP_PDIR and MCASP_PDOUT to 0x00000800 to use AXR11. The sequence of configuration is as described before. This sequence is not working for us.

    FYI, We are directly writing the value to register address using 'HW_WR_REG32'.

    Regards,
    Ashish
  • Hi Ashish,

    You are muxing AXR11 pin to a GPIO pin. That means now you can configure it as output and toggle its state (high/low) from the GPIO4 module, changing bit 17 (because of the gpio4_17 pin).

    Using registers:

    GPIO_OE[17] = 0  --> pin is output

    GPIO_SETDATAOUT[17] = 1   --> if you wish to output high level

    GPIO_CLEARDATAOUT[17] = 1   --> if you wish to output low level

    See more details in TRM Section 27.5 General-Purpose  Interface Programming Guide. You may need to start GPIO clock and do some basic stuff like resetting GPIO module or other as described in the TRM.

    Regards,

    Stan

  • Hi Ashish,

    As a side note, you can always use the Pad Configuration Tool (PCT) and determine these registers/setting easily in a user-friendly GUI.

    Thanks,
    Alex

  • Hi Ashish,

    In additional to what Stan said you should ensure that GPIO APIs are called in a correct sequence to avoid issues. You can refer to gpio interrupt app at the same location I had shared previously.

    Regards,
    Rishabh
  • Hi Rishabh/Stan,

    We have followed your suggested steps and now able to set the WDI to high, but still we are facing issue in toggling WDI .
    Can we have a small webex session, please let us know your convenient time.

    Thanks and regards,
    Ashish Harit
  • Hi Rishabh/Stan,

    We have followed your suggested steps and now able to enable the Watchdog timer, but still we are facing issue in toggling WDI pin (Refreshing Timer).
    Can we have a small webex session tomorrow 23rd Jan?

    Please let us know your convenient time.

    Thanks and regards,
    Ashish Harit
  • Hi Ashish,

    Can you share the GPIO code you are using to toggle WDT pin.

    Regards,
    Rishabh
  • Hi Rishabh,

    Before Toggling we have made SET pin HIGH to enable Watchdog-

    Bsp_platformSetPinmuxRegs( (UInt32) 14U, (UInt32) CTRL_CORE_PAD_MCASP1_AXR12, BSP_PLATFORM_IOPAD_CFG_DEFAULT);
    GPIODirModeSet(SOC_GPIO4_BASE,18,GPIO_DIR_OUTPUT);
    GPIOPinWrite(SOC_GPIO4_BASE,18,1);

    The WatchDog Timeout is happening now with the above code.

    Below is the code we are using for toggling the WDI pin-

    FUNC(void, PM_GLOBAL_CODE) PM_Ext_Toggle_Watchdog(void)
    {
    if(TM_READ_TIMER_M(EXT_WDG_TIMER) == ZERO) //Check the timer value if Zero
    {
    TM_START_TIMER_M(EXT_WDG_TIMER,10U); //restart the timer and then toggle

    if(GPIOPinRead(SOC_GPIO4_BASE,17) == 1)
    {
    HW_WR_REG32(0x4805913C,0x00); //GPIO_DATAOUT register low
    GPIOPinWrite(SOC_GPIO4_BASE,17,0); //GPIO pin 4_17 low (connected to WDI)
    }
    else
    {
    HW_WR_REG32(0x4805913C,0x01); //GPIO_DATAOUT register high
    GPIOPinWrite(SOC_GPIO4_BASE,17,1); //GPIO pin 4_17 high (connected to WDI)
    }
    }
    }

    We have trouble with toggling the WDI pin.

    Please let us know if you have any suggestions.

    Thank and Regards,
    Ashish
  • Hi Ashish,

    I see that for the function GPIODirModeSet and GPIOPinWrite you are passing the pin number as 18 at the beginning.

    Can you correct it and check?

    Regards,
    Prasad

  • Hi Prasad,

    Yes. Those function calls are for gpio4_18 which is connected to SET pin of TPS3851. We need to set it HIGH to start the External WatchDog Timer.

    Regards,
    Ashish
  • Hi,

    Can you remove the direct reg write to Dataout register 0x4805913C?
    Use only the GPIOPinWrite API.
    Have you done the GPIODirModeSet and the pinmux for the GPIO4_17?

    Regards,
    Prasad