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.

configuring UART1 as gpio

Hi,

I am working for AM/DM37x platform on Windows EC7.  I am using "BSP_WINCE_ARM_A8_02_30_00_Source" as AM37x BSP.  I need to take out the gpio's 148 to 151 for our development purpose.  But these pins already used for UART1.  To use these pins as gpio's I did the following changes in bsp_padcfg.h file;

//#define UART1_PADS \
//PAD_ENTRY(UART1_TX, INPUT_DISABLED | MUXMODE(0)) \
//PAD_ENTRY(UART1_RX, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(0)) \
//PAD_ENTRY(UART1_RTS, INPUT_DISABLED | MUXMODE(0)) \
//PAD_ENTRY(UART1_CTS, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(0)) \

and added as gpios in the following code;

#define GPIO_PADS_37XX \
PAD_ENTRY(UART1_TX, INPUT_ENABLED | MUXMODE(4)) /* GPIO 148: TRF7970 irq by KPH */ \
PAD_ENTRY(UART1_RX, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) /* GPIO 151: TRF7970 EN by KPH */ \
PAD_ENTRY(UART1_RTS, INPUT_DISABLED | MUXMODE(4)) /* GPIO 149: TRF7970 MOD by KPH */ \
PAD_ENTRY(UART1_CTS, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) /* GPIO 150: TRF7970 ASK/OOK by KPH */ \

Please let know that this change itself is enough or should I modify in other files too.  Becuase I am seeing the UART1_PADS used in other files also.  Should I comment those....

Please share your valuable thoughts.

Regards,

Karthick

  • Dear Karthick,

    Greetings!!!

    I dont have the data sheet for the TI AM37xx, but I can suggest you that if the mode(4) is mentioned for GPIO mode then, its 100% correct. 

    But now you cannot use the same pins for UART1. If you want to use UART1 then you have to use another signals for UART1.

  • Hi Partap, thank you for the prompt reply. Your reply really had a great msg to resolve my issue.
    I agree with you that if I take over UART1 pins to act as GPIOs then I have to give it up UART1. To avoid that now I configured as followed in bsp_padcfg.h file;
    #define UART1_PADS \
    PAD_ENTRY(MMC1_DAT0, INPUT_DISABLED | MUXMODE(4)) \
    PAD_ENTRY(MMC1_DAT1, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) \
    PAD_ENTRY(MMC1_DAT2, INPUT_DISABLED | MUXMODE(4)) \
    PAD_ENTRY(MMC1_DAT3, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) \

    and hooked UART1 pins as GPIO's as stated below;
    #define GPIO_PADS_37XX \
    PAD_ENTRY(UART1_TX, INPUT_ENABLED | MUXMODE(4)) /* GPIO 148: */ \
    PAD_ENTRY(UART1_RX, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) /* GPIO 151: */ \
    PAD_ENTRY(UART1_RTS, INPUT_DISABLED | MUXMODE(4)) /* GPIO 149: */ \
    PAD_ENTRY(UART1_CTS, INPUT_ENABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4)) /* GPIO 150: */ \

    Will it be perfect that now UART1 can also work......or anything more to be updated. Also I would like to know where can I get the details whether GPIO148 to GPIO151 had open drain or not...to enable the pullups for corresponding pins.

    Regards,
    Karthick
  • Hi Karthick,

    Greetings!!

    Your thread is resolved but at the end you have some doubt. Not an issue.
    For mentioned GPIO, you have to check in the board schematic that it is used some where or not....
  • Thanks. In schematics I don't see any information related to open drain for the particular gpios.

    please help where can I get the info.

    Regards,
    Karthick
  • Hi Karthick,

    You can configure it either pullup or pulldown from the Pinmuxing file and I can see that you have already done this. Open drain state does not related to this thing. It's just a floating state or unknown state....
  • thanks for that info.