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.

UNLOCK NMI PIN

Other Parts Discussed in Thread: SW-TM4C, EK-TM4C123GXL

HI 

AM TRYIG TO UNLOCK PF0 PIN IN TM4C1230D5PMI

USING THIS STEPS IS THIS CORRECT

HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
HWREG(GPIO_PORTF_BASE + GPIO_O_CR) = 0x80

HWREG(GPIO_PORTF_BASE + GPIO_O_AFSEL) |= 0x400;

HWREG(GPIO_PORTF_BASE + GPIO_O_DEN) |= 0x80;

HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;

  • Hi Shyam,

       It seems you are setting PFO to function as U1RTS. Here below are my recommended unlocking steps. I have not tried this. So, I am not sure. 

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

    HWREG(GPIO_PORTF_BASE + GPIO_O_AFSEL) |= 0x400;

    HWREG(GPIO_PORTF_BASE + GPIO_O_DEN) |= 0x80;

    HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;

    -kel

  • Use of "0x80" in the attempt to unlock PX0 is doomed!  (that potentially unlocks PX7)

    Use of "0x01" targets PX0.

     

  • If you download the TivaWare for C Series (SW-TM4C) (found here: http://www.ti.com/tool/sw-tm4c) and take a look at the gpio_jtag.c example (found in examples/boards/ek-tm4c123gxl/gpio_jtag.c), you will see how the GPIO_LOCK mechanism is used for JTAG pins on GPIO Port C.

    You will simply need to alter the port and bit to use Port F, and Bit 7 for your application.

    --Bobby

  • Bobby Bradford said:
    Port F, and Bit 7 for your application.

    Or not!  Poster sought PF0 - which is not Bit 7.  (Bit 7 likely sprang from the unlock of PD7 - "also NMI blessed" - but the issue here is PF0 - and that targets Bit 0...)

    Stand by earlier (cb1) post identifying Bit 0 as the "real" target...  (which latest post appears to contradict...)

  • @cb1,

    You are correct. 0x01 targets Px0. In my haste, I forgot to check the other details. The unlocking should be as below.

    HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0x01;
    HWREG(GPIO_PORTF_BASE + GPIO_O_AFSEL) |= 0x400;
    HWREG(GPIO_PORTF_BASE + GPIO_O_DEN) |= 0x01;
    HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;

    @shyam

    Do you really intend to set PF0 as U1RTS? 

    -kel

  • You are correct.  I mixed up references from several posts.  It should be bit 0.

    --Bobby