• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » WinCE » WinCE forum » OMAP3530 and GPIO
Share
WinCE
  • Forum
Options
  • Subscribe via RSS

Forums

OMAP3530 and GPIO

This question is answered
Matthew Carle
Posted by Matthew Carle
on Aug 16 2010 09:20 AM
Prodigy150 points

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

 

 

 

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Vitaly Andrianov
    Posted by Vitaly Andrianov
    on Aug 16 2010 10:48 AM
    Prodigy170 points

    Hi Matt,

    That pin might need an external pull-up.

    Regards,

    Vitaly

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Matthew Carle
    Posted by Matthew Carle
    on Aug 16 2010 10:57 AM
    Prodigy150 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vitaly Andrianov
    Posted by Vitaly Andrianov
    on Aug 16 2010 11:37 AM
    Suggested Answer
    Prodigy170 points

    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

      

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kazunobu Shin
    Posted by Kazunobu Shin
    on Aug 17 2010 14:36 PM
    Suggested Answer
    Expert6965 points

    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 ?

    Regards,
    Kazunobu Shin
    ---------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Matthew Carle
    Posted by Matthew Carle
    on Aug 17 2010 14:41 PM
    Prodigy150 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kazunobu Shin
    Posted by Kazunobu Shin
    on Aug 17 2010 15:42 PM
    Verified Answer
    Verified by Jatin Jain
    Expert6965 points

    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)

    Regards,
    Kazunobu Shin
    ---------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • DavidVescovi
    Posted by DavidVescovi
    on Aug 18 2010 19:25 PM
    Verified Answer
    Verified by Jatin Jain
    Genius4150 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use