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.

Tiva c series TM4C123 launchpad not working

Other Parts Discussed in Thread: TM4C123GH6PM

Hi everyone,

I am working on Tiva c series for past one week . suddenly I don't know what happen to that launchpad it is not working  in the sense the program is not running but when I try to flash the .bin file using LM flash programmer the program get flashed but the program is not running inside the controller. In same manner when I try to program using code composer studio v5.1 the program is debugged but it is not running (i.e., I am not getting any changes in my gpio) . If any one faced this issue please help me.

thanks, 

  • Hello Thangamani,

    Is this a simple program like GPIO toggle? Can you share the code?

    Regards
    Amit
  • Hi Amit,

    It is not about toggling the GPIO even thought I try to generate PWM I am unable to get output through the pin. when I try to debug step by step the instructions is moving step by step but there is no changes in the pins or in led.

    Regards
    Praveen
  • Hello Praveen,

    How have you configured the GPIO and the PWM for the application? Did you check the example codes in TivaWare?

    Regards
    Amit
  • Hello Amit,

    I stared to work only after worked with those example. Before controller going into this wrong stage it's working is perfect as my expect.

    Regards

    Praveen 

  • Amit is asking you to present your GPIO & PWM, "Configuration & Set Up" code.

    Your work effort & board history - while of interest - cannot (by themselves) guide us to your solution.
  • Hello Amit,

    Here the code
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/tm4c123gh6pm.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/pwm.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/timer.h"

    void Timer0IntHandler(void);
    //void PWM_CONFIG();
    void TIMER_CONFIG();

    uint32_t ui32Period;
    #define PWM_FREQUENCY 55
    volatile uint32_t ui32Load;
    volatile uint32_t ui32PWMClock;
    volatile uint32_t ui8Adjust;
    unsigned int temp;
    int main()
    {
    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
    SysCtlPWMClockSet(SYSCTL_PWMDIV_64);
    //ENABLING THE PERIPHERALS
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); //ENABLE GPIO_A PIN 2_3_4
    GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4); // GPIO PIN TYPE
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
    //PWM_CONFIG();
    TIMER_CONFIG();
    while(1)
    {}
    }

    void Timer0IntHandler(void)
    {

    // Clear the timer interrupt
    TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    static unsigned int step=0;
    ui8Adjust = 83;
    if(step==6)
    step=0;
    else
    step++;
    switch(step)
    {
    case 0: // segment 0(0-60)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x02);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x0c);
    break;
    }
    case 1: // segment 1(60-120)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x02);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x14);
    break;
    }
    case 2: // segment 2(120-180)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x04);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x18);
    break;
    }
    case 3: // segment 3(180-240)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x04);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x0c);
    break;
    }
    case 4: // segment 4(240-300)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x14);
    break;
    }
    case 5: // segment 5(300-360)
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4, 0x18);
    break;
    }
    }
    }
    void TIMER_CONFIG()
    {
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // Enable TIMER0 FOR SEGMENT

    // TIMER INTERRUPT CONFIGH
    TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
    ui32Period = (SysCtlClockGet() / 10) / 2;
    TimerLoadSet(TIMER0_BASE, TIMER_A,3960);
    IntEnable(INT_TIMER0A);
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    IntMasterEnable();

    TimerEnable(TIMER0_BASE, TIMER_A);

    }

    This the code I used to debug on TM4CV123GH6PM. when I try to debug it was done but the is no response from the controller but the led used to blink in red colour. I have not got any change in the GPIO or from PWM.

    Regards
    Praveen
  • Hello Praveen,

    When you halt the debugger, where the does the code show it is executing?

    Regards
    Amit