• 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 » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » LM3S8962 PB7/TRST
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS

LM3S8962 PB7/TRST

LM3S8962 PB7/TRST

This question is not answered
Ben Roberto
Posted by Ben Roberto
on May 01 2012 17:13 PM
Prodigy170 points

On the LM3s8962 can PB7 be used as a standard GPIO pin?

I've gone through the steps to unlock the pin and initialized the pin to be an output:

//-----------------------------------------------------
    //unlock?
    HWREG(GPIO_PORTB_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTB_BASE + GPIO_O_CR) = 0x80;
    HWREG(GPIO_PORTB_BASE + GPIO_O_AFSEL) &= 0x7f;
    HWREG(GPIO_PORTB_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTB_BASE + GPIO_O_CR) = 0x00;
    HWREG(GPIO_PORTB_BASE + GPIO_O_LOCK) = 0;
    
    //-----------------------------------------------------
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);                     

    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,
                          GPIO_PIN_7);

    GPIOPadConfigSet(GPIO_PORTB_BASE,
                     GPIO_PIN_7,
                     GPIO_STRENGTH_2MA,   GPIO_PIN_TYPE_STD_WPU);

As a test I use a simple timer ISR routine to toggle the pin:

    count++;
    if (count > DEBUG) // 250mSec
    {
        count = 0;
        if (toggle)
        {
            GPIOPinWrite(DEBUG_GPIO_BASE, DEBUG_0, DEBUG_0); // pin HIGH
            GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_7); // pin HIGH
            toggle = 0;            
        }
        else    
        {
            GPIOPinWrite(DEBUG_GPIO_BASE, DEBUG_0, 0); // pin LOW
            GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, 0); // pin LOW
            toggle = 1;
        }

As a sanity check DEBUG_O was initialized to PORT G / Pin 0 and works correctly.

Any suggestions?

-- Ben


Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • David Racine
    Posted by David Racine
    on May 02 2012 13:08 PM
    Expert5350 points

    Ben,

    Are you able to step through your unlock sequence and verify that these registers are indeed changing the way you want? Also why do you write the LOCK key twice?Also if you configure the pin out of its JTAG function too quickly (at the beginning of user code), you may not be able to connect with a debugger as it will not have time to "grab" the device before this configuration takes place and will essentially be locked out. To reverse this perform a "Debug Port Unlock" in LM Flash Programmer.

    Give this code a try:

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); //make sure you enable the port before trying to write to it

    HWREG(0x40005000 + 0x520) = 0x1ACCE551; //key
    HWREG(0x40005000 + 0x524) = 0xff; //CR
    HWREG(0x40005000 + 0x420) = 0x00; //alternate function
    HWREG(0x40005000 + 0x520) = 0; // LOCK

    .

    .

    .

    -Dave


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ben Roberto
    Posted by Ben Roberto
    on May 03 2012 09:08 AM
    Prodigy170 points

    Dave,

    The double lock came from the example code in gpio_jtag.c

    I tried your code with mixed results.  The PB7 would toggle but not to full voltage range.  The signal would swing  from 3.3V to 2.9V.

    I set up the port as GPIO_PIN_TYPE_STD_WPU, GPIO_PIN_TYPE_STD_WPD and GPIO_PIN_TYPE_STD with the same results.

    -- Ben

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • cb1_mobile
    Posted by cb1_mobile
    on May 04 2012 09:05 AM
    Guru23720 points

    Prefer your unlock code (with its clear derivation) to that proposed.

    Your code is precisely (almost) how we unlocked a different Stellaris - which is listed (somewhere) as Dust Devil Class.  This class issue adds great complication - our code used this, "GPIO_LOCK_KEY_DD," as the, "lock key." 

    If our code lacked the _DD - part never unlocked - suffered "always high" fate - much similar to your report.

    This holds true only if yours is Dust Devil or equivalent class - this class "look-up" should be instant, identified link - instead "buried" somewhere - for some (questionable) reason...  (good luck).   (obstruction/road-blocks - not ideal means to boost sales...  even world class firms "hiccup!")

    Enough soap-box (head healing from prior banging) - sense is that you may never be "unlocking" - thus cannot drive pin as GPIO.  You may wish to check/verify this theory by review of the various GPIO Registers for your MCU - both "pre & post" your attempted "unlock."  I would choose a different Port B pin initially - set it up as your desired output.  Then review/record key GPIO Registers: (should note AFSEL = 0, DIR = 1, ODR =0, DEN = 1) for successful GPIO Output.  Once confirmed - log these same registers/values (for Port_B7) prior to "unlock."  Then - execute the unlock and see if you achieve the "normal/customary" readings - presented above...   Good luck...

    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