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.

PB7 not working as GPIO

Other Parts Discussed in Thread: EK-TM4C123GXL

I just tried simple blinking exercise on PORTB on the TIVA C Series Board.
Every pin on the port works except PB7 which does not turn up.

Code:

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
int main(void)
{
    SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_7|GPIO_PIN_6);

    while(1)
    {

        GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_7|GPIO_PIN_6,0xc0);
        SysCtlDelay(200000);
        GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_7|GPIO_PIN_6,0x00);
        SysCtlDelay(200000);
    }



}

When this code runs, PB6 starts blinking but PB7 does not even turn on once.

What might be the problem?
Is there any alternate function for this pin(PB7), which this pin gets configured to, at every power up?
Do I need to disable any such alternate function?

Or is there some fault in hardware?

  • Pranjal,

    I've tested your code on my Tiva C LaunchPad (EK-TM4C123GXL) and it works.  I can see both pins PB6 and PB7 toggle.  How are you measuring the two pins?  Are you sure you are monitoring the correct pin?  Try stepping through the code and monitoring the GPIO data register to see if that changes.

    -Rebecca