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.

CCS/EK-TM4C123GXL: I don't Know why my output waveform is not correct

Part Number: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi, I'm Sung Min.

I don't Know why my output waveform is not correct

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/adc.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/pwm.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"

void
InitConsole(void)
{

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    UARTStdioConfig(0, 115200, 16000000);
}

#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif
void
ConfigureUART(void)
{

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
    MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
    MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    UARTStdioConfig(0, 115200, 16000000);
}

int
main(void)
{
    float a;
    float b;
    MAP_SysCtlPWMClockSet(SYSCTL_PWMDIV_8);

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    MAP_GPIOPinConfigure(GPIO_PB6_M0PWM0);
    MAP_GPIOPinTypePWM(GPIO_PORTB_BASE, GPIO_PIN_6);

    MAP_PWMGenConfigure(PWM0_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN |
                        PWM_GEN_MODE_NO_SYNC);


    MAP_PWMGenPeriodSet(PWM0_BASE, PWM_GEN_0, (SysCtlClockGet() / 250));

    MAP_PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT, true);

    MAP_PWMGenEnable(PWM0_BASE, PWM_GEN_0);
#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
    uint32_t ui32SysClock;
#endif

    uint32_t pui32ADC0Value[1];

#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
    //
    // Note: SYSCTL_CFG_VCO_240 is a new setting provided in TivaWare 2.2.x and
    // later to better reflect the actual VCO speed due to SYSCTL#22.
    //
    ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
            SYSCTL_OSC_MAIN |
            SYSCTL_USE_PLL |
            SYSCTL_CFG_VCO_240), 20000000);
#else
    SysCtlClockSet(SYSCTL_SYSDIV_16 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                   SYSCTL_XTAL_1MHZ);
#endif

    InitConsole();
    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

    GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);

    ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

    ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH0 | ADC_CTL_IE |
                             ADC_CTL_END);

    ADCSequenceEnable(ADC0_BASE, 3);

    ADCIntClear(ADC0_BASE, 3);


    while(1)
    {

        ADCProcessorTrigger(ADC0_BASE, 3);

        while(!ADCIntStatus(ADC0_BASE, 3, false))
        {
        }
        ADCIntClear(ADC0_BASE, 3);

        ADCSequenceDataGet(ADC0_BASE, 3, pui32ADC0Value);
        UARTprintf("AIN0 = %d\n", pui32ADC0Value[0]);
        a=pui32ADC0Value[0];
        b=a-1970;
        if (b>100)
        {
            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);
            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);

            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
            SysCtlDelay(100000);
        }
        else
        {
            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);

            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);

            MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                 MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);
            SysCtlDelay(100000);
        }

    }
}

above is my code

and I want to make the output square form(0101)when some input(b>100)  and else when(b<100) I want to make the output square waveform (1010)

but the Oscilloscope's waveform is not same what I think

Do Anyone knows the reason?

During this month, I have been doing this part of project.

But anyone don't know the reason of the error

  • Hi,

      You wrote code like below and this will not work. It looks like your PWM period is 250Hz or slower. Just think about how long is one PWM period in 250Hz. It is 4mS. Now look at your code and see how fast to execute the MAP_PWMPulseWidthSet. It may just take in the range of uS or in hundreds of nS to execute the API. Before one duty cycle is complete, you are forcing a change for a different duty cycle.  In another word, the 4 MAP_PWMPulseWidthSet will execute before one duty cycle is complete. The first three MAP_PWMPulseWidthSet will neve take effect.

       I think you will get a much better luck to get what you want if you use the GPT timer in PWM mode where you can create a one-shot PWM. Another way you may try is to use the GPIO if I were you. You can simply set a pin low, wait for some time to expire and then set the pin high again. You can repeat this the number of times you want per your application. 

      The PWM module is used to generate a continuous PWM pulse train.  You should only update the duty cycle and make it synchronous so that the duty cycle update will take affect at the end of one duty cycle. 

      If this is your university homework or project, I will suggest you discuss with your professor/TA/classmates.

            if (b>100)
            {
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
                SysCtlDelay(100000);
            }
  • Thank for Your Help

    My PWM period is 3.8Hz, nearly

    But I couldn't understand that you said

    ' You can simply set a pin low, wait for some time to expire and then set the pin high again. You can repeat this the number of times you want per your application. '

    what is the 'pin low' and 'pin high'

    I agree that you said 'You should only update the duty cycle and make it synchronous so that the duty cycle update will take affect at the end of one duty cycle.'

    That is I think what I should solve.

    And you said, To solve this problem, use the gpio.

    But I cannot understand the difference 'gpio' and 'adc caputure'

    and I have the only Example about gpio_jtag

    volatile uint32_t g_ui32Mode;
    
    
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
    }
    #endif
    
    void
    SysTickIntHandler(void)
    {
        uint8_t ui8Buttons;
        uint8_t ui8ButtonsChanged;
    
        ui8Buttons = ButtonsPoll(&ui8ButtonsChanged, 0);
    
        if(BUTTON_PRESSED(LEFT_BUTTON, ui8Buttons, ui8ButtonsChanged))
        {
    
            g_ui32Mode ^= 1;
    
            if(g_ui32Mode == 0)
            {
    
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x01;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) |= 0x01;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x02;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) |= 0x02;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x04;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) |= 0x04;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x08;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) |= 0x08;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x00;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = 0;
    
    
                MAP_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3 | GPIO_PIN_1,
                                 GPIO_PIN_3);
            }
            else
            {
    
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x01;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) &= 0xfe;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x02;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) &= 0xfd;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x04;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) &= 0xfb;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x08;
                HWREG(GPIO_PORTC_BASE + GPIO_O_AFSEL) &= 0xf7;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
                HWREG(GPIO_PORTC_BASE + GPIO_O_CR) = 0x00;
                HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = 0;
                MAP_GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, (GPIO_PIN_0 | GPIO_PIN_1 |
                                                           GPIO_PIN_2 | GPIO_PIN_3));
    
    
                MAP_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3 | GPIO_PIN_1,
                                 GPIO_PIN_1);
            }
        }
    }
    
    
    void
    ConfigureUART(void)
    {
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    
        MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
        MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
        MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
        UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    
        UARTStdioConfig(0, 115200, 16000000);
    }
    
    int
    main(void)
    {
        uint32_t ui32Mode;
    
        MAP_FPULazyStackingEnable();
    
        MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
                           SYSCTL_OSC_MAIN);
    
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    
        ButtonsInit();
    
        SysTickPeriodSet(SysCtlClockGet() / 100);
        SysTickIntEnable();
        SysTickEnable();
    
        IntMasterEnable();
    
        MAP_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3 | GPIO_PIN_1);
        MAP_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3 | GPIO_PIN_1, GPIO_PIN_3);
    
        g_ui32Mode = 0;
        ui32Mode = 0;
    
        ConfigureUART();
    
        UARTprintf("\033[2JGPIO <-> JTAG\n");
    
        UARTprintf("Pins are JTAG\n");
    
        while(1)
        {
    
            while(g_ui32Mode == ui32Mode)
            {
            }
    
            ui32Mode = g_ui32Mode;
    
            if(ui32Mode == 0)
            {
                UARTprintf("Pins are JTAG\n");
            }
            else
            {
                UARTprintf("Pins are GPIO\n");
            }
        }
    }
    

    But I don't know how to use this example to synchronous

    Thanks for reply!!

    regards,

    Yoon

  • Hi,

      Which port are you trying to use for GPIO? If you are going to use PortC[3:0] then I will really suggest you NOT to. These are used for JTAG. If you repurpose them for GPIO then you will lose the capablity to debug your device which is not a good thing. There are many other GPIO ports you can use. Why don't you try other ports?

      Why don't reference the project0 example on how to use the GPIO. The blinky example is another one to reference. Below is the code for project0 which you can find in TivaWare library.

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    
    //*****************************************************************************
    //
    // Define pin to LED color mapping.
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    //! \addtogroup example_list
    //! <h1>Project Zero (project0)</h1>
    //!
    //! This example demonstrates the use of TivaWare to setup the clocks and
    //! toggle GPIO pins to make the LED's blink. This is a good place to start
    //! understanding your launchpad and the tools that can be used to program it.
    //
    //*****************************************************************************
    
    #define RED_LED   GPIO_PIN_1
    #define BLUE_LED  GPIO_PIN_2
    #define GREEN_LED GPIO_PIN_3
    
    //*****************************************************************************
    //
    // 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)
    {
        //
        // Setup the system clock to run at 50 Mhz from PLL with crystal reference
        //
        SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                        SYSCTL_OSC_MAIN);
    
        //
        // Enable and wait for the port to be ready for access
        //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
        while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF))
        {
        }
        
        //
        // Configure the GPIO port for the LED operation.
        //
        GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED);
    
        //
        // Loop Forever
        //
        while(1)
        {
            //
            // Turn on the LED
            //
            GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, RED_LED);
    
            //
            // Delay for a bit
            //
            SysCtlDelay(2000000);
    
            //
            // Turn on the LED
            //
            GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, BLUE_LED);
    
            //
            // Delay for a bit
            //
            SysCtlDelay(2000000);
        }
    }
    

      

  • Now I have Three questions:

    the first is to send a PWM output of 0101 when b is greater than 1000, i.e. send a PWM signal four times. But the input to the kit now is 1 Hz on the SINE waveform.
    The output occurs once a second. If I can synchronize through GPIO, I would like to ask if this is possible.

    Second, I connected the output of the PB6 pin of the kit to the oscilloscope, and the output signal occurs once a second, but at some point, 0.999 output occurs three times in a row or two times in a row. What's wrong with this? Below is my Code (The if part of the code I posted above was modified.)

    if (b>1000)
            {
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0.999);
                SysCtlDelay(100000);
            }
            else
            {
                MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,
                                     MAP_PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) *0);
                SysCtlDelay(100000);
            }

    Third, I don't know how to synchronize.
    ' MAP_PWMGenConfigure (PWM0_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN |
    PWM_GEN_MODE_GEN_SYNC_LOCAL);'
    It wasn't SYNC_LOCAL but GEN_NO_SYNC. Didn't I change this to synchronize?
    And you told me to use GPIO and PWM together is called GPIOPinTypePWM, how can I set up a duty cycle with this?

    To summarize what I finally want, when an input signal is in the kit, I output 0101 using PWM when it is higher than the reference value and 1010 when it is lower than the standard.

    Regards,

    Yoon

  • sungmin yoon said:
    the first is to send a PWM output of 0101 when b is greater than 1000, i.e. send a PWM signal four times. But the input to the kit now is 1 Hz on the SINE waveform.
    The output occurs once a second. If I can synchronize through GPIO, I would like to ask if this is possible.

    What is your input? If this input is a GPIO input then you can configure it to generate an interrupt when an input edge is detected. In your ISR, you can generate your output corresponding to the input event. If your input is an ADC, you can also generate an interrupt when a conversion is complete. In your ADC ISR, you can generate your output. 

    sungmin yoon said:
    Second, I connected the output of the PB6 pin of the kit to the oscilloscope, and the output signal occurs once a second, but at some point, 0.999 output occurs three times in a row or two times in a row. What's wrong with this? Below is my Code (The if part of the code I posted above was modified.)

      I really don't think you are doing this right. Why are you using the PWM to generate 0101 when you can use the GPIO to create the 0101 much easily. Suppose you want to create 0101, this means each pulse duration will be 250mS. See below pseudo code. 

      if (b > 1000) {

          GPIOPinWrite(GPIO_PORTF_BASE, 0, 0); // Set the PF0 low. You can choose your own pin

          SysCtlDelay(xyz); // with xyz giving you 250mS. You can try SysCtlDelay(SysCtlClockSet() / 4 /3) to wait 250mS

          GPIOPinWrite(GPIO_PORTF_BASE, 0, 1); // Set the PF0 high. 

          SysCtlDelay(xyz); //  wait 250mS

          GPIOPinWrite(GPIO_PORTF_BASE, 0, 0); // Set the PF0 low. 

          SysCtlDelay(xyz); // wait 250mS

          GPIOPinWrite(GPIO_PORTF_BASE, 0, 1); // Set the PF0 high. 

          SysCtlDelay(xyz); //  wait 250mS

      } else {

      // your code for b < 1000

     }

    sungmin yoon said:
    Third, I don't know how to synchronize.
    ' MAP_PWMGenConfigure (PWM0_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN |
    PWM_GEN_MODE_GEN_SYNC_LOCAL);'
    It wasn't SYNC_LOCAL but GEN_NO_SYNC. Didn't I change this to synchronize?
    And you told me to use GPIO and PWM together is called GPIOPinTypePWM, how can I set up a duty cycle with this?

    See above, you will have a much easier path to success if you use GPIO instead of PWM.  You don't want to use PWM to generate waveform like what you need. 

     Again, as much as I wanted to help, you should discuss with your professor/TA and classmates for your homework. 

          

      

  • With your help, I finally made it.

    I regret why I didn't think about using gpio to create a square waveform.

    but your code could not make the waveform that I want.

    So, Here's my Code 0101 1010

      if (b>1100)
            {
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3,0x0); //off
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, GPIO_PIN_3); // on
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3,0x0); //off
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, GPIO_PIN_3); // on
                SysCtlDelay(500000);
            }
            else
            {
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, GPIO_PIN_3); // on
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0x0); //off
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, GPIO_PIN_3); // on
                SysCtlDelay(500000);
                GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0x0); //off
                SysCtlDelay(500000);
            }

    I hope it helps someone who reads my post.