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.

TM4C1294KCPDT: How to Unlock PD7 Special Pin

Part Number: TM4C1294KCPDT

Hi,

  I am working with TM4C1294KCPDT controller coustom board . I Need to unlock the PD7 Special  pin  . Please Share me a code to unlock the pin.

Thanks in advance

Thanks & regards,

Rani

  • Jacobi,

        I have unlocked the PD7 Pin suucessfuly by set the below commands . But after that adding the unlock instruction i'm facing the problem that is others pins in the D ports are not working.

    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= 0x80;

    HWREG(GPIO_PORTD_BASE + GPIO_O_AFSEL) |= 0x400;
    HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) |= 0x80;
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;

    Please help me to short out this problem.

    Thanks in advance.

    Regards, 

      Rani 

  • Hello Rani,

    Once you do the unlock process with:

    Fullscreen
    1
    2
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= 0x80;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Just use GPIO driverlib calls for configuring the IO. Probably the issue is:

    Fullscreen
    1
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best Regards,

    Ralph Jacobi

  • Jacobi,

      Do you mean i need to initalise the GPIO pins after unlock proceess .Am i Correct? I did  initalization before  the unlock process.

    Best Regards,

    Rani 

  • Hello Rani,

    You would do the System Control Enable for the GPIO port first.

    Then you do the Unlock process for the pins.

    And then you configure the IO based on what you need for your application.

    For example:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    //
    // Enable the peripherals used by this example.
    //
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    //
    // Unlock the Port F Pin 0 GPIO as it defaults as a locked NMI pin.
    //
    MAP_GPIOUnlockPin(GPIO_PORTF_BASE, GPIO_PIN_0);
    //
    // Set the pin to use the internal pull-up.
    //
    MAP_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0,
    GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best Regards,

    Ralph Jacobi