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.

OMAP3530 and GPIO

Other Parts Discussed in Thread: OMAP3530

Hello,

I am wondering if someone might be able to direct me a bit.  I am attempting to get a few of the lines on my OMAP3530 EVM board working as GPIO (some of the lines on the external expansion connector) but I seem to be having a bit of difficulty.  I am sure I am just missing something simple so I am hoping someone can just boot me in the right direction.

 

I am using WinCE and attempting to utilize the MMC2 data lines for standard GPIO so I have update platform.c (loader) as follows:

 

 

 

 

 

 

 

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT0, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT1, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT2, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT3, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT4, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT5, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT6, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

OUTREG16(&pConfig->CONTROL_PADCONF_MMC2_DAT7, (INPUT_DISABLE | PULL_INACTIVE | MUX_MODE_4));

 

The, I am simply trying to open the GPIO stream driver and toggle the pin as such:

hGPIO = GPIOOpen();

GPIOSetMode(hGPIO, GPIO_132, GPIO_DIR_OUTPUT);

GPIOSetBit(hGPIO, GPIO_139);

 

My problem is that I have a scope attached to the line on the connector but I cannot seem to get it to toggle.  What am I missing?

Cheers,

Matt

 

 

 

  • Hi Matt,

    That pin might need an external pull-up.

    Regards,

    Vitaly

     

  • Hi Vitaly,

    Should I need a pull up resistor if I am only using the pin as an output?  I could see the need if I was attempting to input data on those lines but I am simply trying to toggle them.

    Cheers,

    Matt

  • Hi Matt,

    I'm not sure about that particular pin. There are some pins with open drain which do require pull up to see something on the scope. Also I don't see where in your code you got the pConfig pointer. Is that part of xloader code? Any way you may want to look at the otg.cpp. That file should have an example of how dynamicaly reconfigure the pin to be a GPIO.

    Regards,

    Vitaly

      

     

  • Hi Matt,

    >GPIOSetMode(hGPIO, GPIO_132, GPIO_DIR_OUTPUT);
    >GPIOSetBit(hGPIO, GPIO_139);

    From your code, it looks you are setting GPIO132 as output, but trying to toggle GPIO 139. Which GPIO line are you monitoring on your scope ?

  • Hey Kazunobu,

    That was just my mistake in cut and pasting the code into the post.  I am actually setting from GPIO_132 upto GPIO_139 as outputs and then attempting to use all of them.  I just didn't post all that.  I have looked into the datasheet for the chip and it doesn't appear that these pins are open drain so pull ups shouldn't be necessary.

    At this point I am left wondering if it has something to do with clocks/power for the MMC2 (since those are the pins that I am attempting to take over).  I am really at a loss as to why I cannot get a simple set/clr working on any of those pines.

     

    Matt

  • Hi Matt,

    These pins are not open drain so external pull ups are not required. I'm hardware engineer and not familiar with the gpio driver, but do you have a way to read register values directly to verify they are configured correctly.

    Here are registers you may want to check.

    PADCONF

    CONTROL_PADCONF_MMC2_DAT0 (0x4800 215C) ~ CONTROL_PADCONF_MMC2_DAT6 (0x4800 2168)

    GPIO module settings

    Registers or sequences for controlling GPIO pins as output  are describes in "24.5.4 Data Input (Capture)/Output (Drive)" section in TRM (SPRUF98H–April 2010–Revised August 2010). gpio132 ~ gpio139 are GPIO5 group, so please read below registers for GPIO5.

    GPIO_OE (0x4905 6034), GPIO_DATAOUT (0x4905 603C), GPIO_SETDATAOUT(0x4905 6094), GPIO_CLEARDATAOUT(0x4905 6090), GPIO_WAKEUPENABLE(0x4905 6020), GPIO_IRQENABLE1(0x4905 601C), GPIO_IRQENABLE2(0x4905 602C)

  • You are calling the functions correctly. Which BSP version are you using?

    There is an existing bug in the GPIO driver in all versions of the BSP up to 6.14.1 if you try to make the call out of process.

    I posted a simple fix in a separate discussion thread.

    Also, do a debug build and make sure you are getting a valid handle (not null)  from the open call.

     

    DV