Hi all, I am seeing different behavior between PD6 and PD7 on DK-TM4C123G launcher pad and hopefully someone can shed some light on why. I am running the code attached to this post which is really the blinky example project without some minor modification, when I use PD6 as the GPIO pin, I can see that its output toggles between HIGH and LOW when the code runs, however when I change the GPIO pin to PD7, its output always stay at LOW, why?
Here is the code:
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#define TEST_GPIO_PORT GPIO_PORTD_BASE
#define TEST_GPIO_PIN GPIO_PIN_7
#define SYSCTL_PERIPH_PORT SYSCTL_PERIPH_GPIOD
//*****************************************************************************
//
//! \addtogroup example_list
//! <h1>Blinky (blinky)</h1>
//!
//! A very simple example that blinks the on-board LED.
//
//*****************************************************************************
//*****************************************************************************
//
// Blink the on-board LED.
//
//*****************************************************************************
int
main(void)
{
volatile uint32_t ui32Loop;
//
// Enable the GPIO port that is used for the on-board LED.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_PORT);
//
// Check if the peripheral access is enabled.
//
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_PORT))
{
}
//
// Enable the GPIO pin for the LED (PG2). Set the direction as output, and
// enable the GPIO pin for digital function.
//
GPIOPinTypeGPIOOutput(TEST_GPIO_PORT, TEST_GPIO_PIN);
//
// Loop forever.
//
while(1)
{
//
// Turn on the LED.
//
GPIOPinWrite(TEST_GPIO_PORT, TEST_GPIO_PIN, TEST_GPIO_PIN);
//
// Delay for a bit.
//
for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
{
}
//
// Turn off the LED.
//
GPIOPinWrite(TEST_GPIO_PORT, TEST_GPIO_PIN, 0);
//
// Delay for a bit.
//
for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
{
}
}
}
Thanks!
Richard