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.

TM4C1294NCPDT: PL6 and PL7 misbehaving

Part Number: TM4C1294NCPDT

I am using PORTL pins 2,3,6,7  as GPIO output with OD , 2ma strength

//PORT L
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOL))
{
}

GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, GPIO_PIN_2); // open drain 2ma
GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, GPIO_PIN_3); // open drain 2ma
GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, GPIO_PIN_6); // open drain 2ma
GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, GPIO_PIN_7); // open drain 2ma

GPIOPadConfigSet(GPIO_PORTL_BASE,GPIO_PIN_2,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_OD);
GPIOPadConfigSet(GPIO_PORTL_BASE,GPIO_PIN_3,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_OD);
GPIOPadConfigSet(GPIO_PORTL_BASE,GPIO_PIN_6,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_OD);
GPIOPadConfigSet(GPIO_PORTL_BASE,GPIO_PIN_7,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_OD);

Surprisingly the pins 2 and 3 behave as expected but Pins 6 and 7 are behaving as if they are NOT Open Drain and also when I output 0 or 1 to these pins, the actual output on the pins (pin 93 and pin94) are inverted.

As I am using Ethernet , I have this function

  // configure Ethernet pins
PinoutSet(true, false);

According to me , this should not disturb PL6 and PL7 as USB is disabled.

There is no RTOS used in the project and CCS version is 8.3.1

Can someone help please.

  • After going through teh data sheet I found that PL6 and PL7 cannot be programmed as Open Drain. This is understood but why the output on the Pin is opposite of what we write with GPIOPinWrite function as below:

    MAP_GPIOPinWrite(GPIO_PORTL_BASE, GPIO_PIN_6, GPIO_PIN_6); <-- The voltage at pin 94 (PL6) is observed to be 0V
    MAP_GPIOPinWrite(GPIO_PORTL_BASE, GPIO_PIN_6, ~GPIO_PIN_6); <--- The voltage at pin 94 (PL6) is 3V.

    My undestanding is that the voltages at the pin 94 should be the other way, ie 3V for the top line and 0V for the bottom line above.

    I have put a break point in the code and observed GPIO_DATA register and it reflects correctly what is written to that port pin.

    What is reason for this behaviour? Am I missing some thing?

  • Hi,

      I cannot reproduce your result. See below simple code I run. I don't have a scope with me right now. I use the logic analyzer. In the code I make high phase very short compared to the low phase. I do not see any inversion. Are you using the LaunchPad or your custom board. On the LaunchPad I probe the TP6 test point for PL6. Please make sure you don't have any logic inversion on your own board. 

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    #include "driverlib/rom_map.h"
    
    
    //*****************************************************************************
    //
    // The error routine that is called if the driver library encounters an error.
    //
    //*****************************************************************************
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
    }
    #endif
    
    //*****************************************************************************
    //
    // Main 'C' Language entry point.  Toggle an LED using TivaWare.
    //
    //*****************************************************************************
    int
    main(void)
    {
        uint32_t ui32SysClock;
    
        //
        // Run from the PLL at 120 MHz.
        //
        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_PLL |
                                           SYSCTL_CFG_VCO_480), 120000000);
    
        //
        // Enable and wait for the port to be ready for access
        //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
        while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOL))
        {
        }
        
        //
        // Configure the GPIO port for the LED operation.
        //
        GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, (GPIO_PIN_6|GPIO_PIN_7));
    
        //
        // Loop Forever
        //
        while(1)
        {
            //
            // Turn on the LED
            //
            GPIOPinWrite(GPIO_PORTL_BASE, (GPIO_PIN_6|GPIO_PIN_7), GPIO_PIN_6|GPIO_PIN_7);
    
            //
            // Delay for a bit
            //
            SysCtlDelay(ui32SysClock/10000);
    
            //
            // Turn on the LED
            //
            GPIOPinWrite(GPIO_PORTL_BASE, (GPIO_PIN_6|GPIO_PIN_7), 0);
    
            //
            // Delay for a bit
            //
            SysCtlDelay(ui32SysClock/100);
        }
    }