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.

pwm generation for 60 hz inverter

Other Parts Discussed in Thread: TM4C123GH6PM

I just bought the arm mcu TM4C123GH6PM and I am new in the programming . my application is a single phase solar inverter that produce 60 hz sine wave. I need a sample complete code to generate the PWM . Thank you

Regards,

Majdi Baccouche

  • Hi Majdi,

    There are 3 examples for PWM in the TIVAWare installation

    TivaWare_C_Series-2.0.1.11577\examples\peripherals\pwm

    You can refer to the invert.c example. Do put a while(1) before PWMOutputInvert API call so that you can see the 250Hz signal. This example can then be modified for the 60Hz PWM.

    Regards

    Amit Ashara

  • Hi Amit,

    Thank you for the response. I tried the example with the dead_band, however, the signal output is a constant pwm duty cycle ,I couldn't have a variable duty cycle that increases and decreases automatically.

    let me explain again what I need: I need a variable duty cycle that increases and decreases automatically so I can feed it to my mosfet's driver. Thank you for the support.

    Regards,

    Majdi

  • I am sorry I am new to this programming the MCU that is why maybe I am asking a dumb question.

  • Hi Majdi,

    Did you check the reload_interrupt.c It does a variation of the duty cycle in the Interrupt routine. To avoid glitches, you would need to set the load of the register when timeout occurs. This can be done using the PWM CTL register.

    Regards

    Amit

  • Amit,

    I just copied and pasted the code,however I do not see  the variation of the duty cycle,I only see a I think 1% ducty cycle that is constant  .this is the code I used,what do I need to add or missing:

    #include <stdbool.h>

    #include <stdint.h>

    #include "inc/hw_ints.h"

    #include "inc/hw_memmap.h"

    #include "driverlib/gpio.h"

    #include "driverlib/interrupt.h"

    #include "driverlib/pin_map.h"

    #include "driverlib/pwm.h"

    #include "driverlib/sysctl.h"

    #include "driverlib/uart.h"

    #include "utils/uartstdio.h"

    //*****************************************************************************

    //

    //! \addtogroup pwm_examples_list

    //! <h1>PWM Reload Interrupt (reload_interrupt)</h1>

    //!

    //! This example shows how to setup an interrupt on PWM0. This example

    //! demonstrates how to setup an interrupt on the PWM when the PWM timer is

    //! equal to the configurable PWM0LOAD register.

    //!

    //! This example uses the following peripherals and I/O signals. You must

    //! review these and change as needed for your own board:

    //! - GPIO Port B peripheral (for PWM0 pin)

    //! - PWM0 - PB6

    //!

    //! The following UART signals are configured only for displaying console

    //! messages for this example. These are not required for operation of the

    //! PWM.

    //! - UART0 peripheral

    //! - GPIO Port A peripheral (for UART0 pins)

    //! - UART0RX - PA0

    //! - UART0TX - PA1

    //!

    //! This example uses the following interrupt handlers. To use this example

    //! in your own application you must add these interrupt handlers to your

    //! vector table.

    //! - INT_PWM0_0 - PWM0IntHandler

    //

    //*****************************************************************************

    //*****************************************************************************

    //

    // This function sets up UART0 to be used for a console to display information

    // as the example is running.

    //

    //*****************************************************************************

     

    //*****************************************************************************

    //

    // Prints out 5x "." with a second delay after each print. This function will

    // then backspace, clear the previously printed dots, backspace again so you

    // continuously printout on the same line. The purpose of this function is to

    // indicate to the user that the program is running.

    //

    //*****************************************************************************

     

    //*****************************************************************************

    //

    // The interrupt handler for the for PWM0 interrupts.

    //

    //*****************************************************************************

    void

    PWM0IntHandler(void)

    {

    //

    // Clear the PWM0 LOAD interrupt flag. This flag gets set when the PWM

    // counter gets reloaded.

    //

    PWMGenIntClear(PWM0_BASE, PWM_GEN_0, PWM_INT_CNT_LOAD);

    //

    // If the duty cycle is less or equal to 75% then add 0.1% to the duty

    // cycle. Else, reset the duty cycle to 0.1% cycles. Note that 64 is

    // 0.01% of the period (64000 cycles).

    //

    if((PWMPulseWidthGet(PWM0_BASE, PWM_OUT_0) + 64) <=

    ((PWMGenPeriodGet(PWM0_BASE, PWM_GEN_0) * 3) / 4))

    {

    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0,

    PWMPulseWidthGet(PWM0_BASE, PWM_OUT_0) + 64);

    }

    else

    {

    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0, 64);

    }

    }

    //*****************************************************************************

    //

    // Configure PWM0 for a load interrupt. This interrupt will trigger everytime

    // the PWM0 counter gets reloaded. In the interrupt, 0.1% will be added to

    // the current duty cycle. This will continue until a duty cycle of 75% is

    // received, then the duty cycle will get reset to 0.1%.

    //

    //*****************************************************************************

    int

    main(void)

    {

    //

    // Set the clocking to run directly from the external crystal/oscillator.

    // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the

    // crystal on your board.

    //

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |

    SYSCTL_XTAL_16MHZ);

    //

    // Set the PWM clock to the system clock.

    //

    SysCtlPWMClockSet(SYSCTL_PWMDIV_1);

    //

    // Set up the serial console to use for displaying messages. This is

    // just for this example program and is not needed for PWM0 operation.

    //

     

    //

    //

    // The PWM peripheral must be enabled for use.

    //

    SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);

    //

    // For this example PWM0 is used with PortB Pin6. The actual port and pins

    // used may be different on your part, consult the data sheet for more

    // information. GPIO port B needs to be enabled so these pins can be used.

    // TODO: change this to whichever GPIO port you are using.

    //

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    //

    // Configure the GPIO pin muxing to select PWM00 functions for these pins.

    // This step selects which alternate function is available for these pins.

    // This is necessary if your part supports GPIO pin function muxing.

    // Consult the data sheet to see which functions are allocated per pin.

    // TODO: change this to select the port/pin you are using.

    //

    GPIOPinConfigure(GPIO_PB6_M0PWM0);

    //

    // Configure the PWM function for this pin.

    // Consult the data sheet to see which functions are allocated per pin.

    // TODO: change this to select the port/pin you are using.

    //

    GPIOPinTypePWM(GPIO_PORTB_BASE, GPIO_PIN_6);

    //

    // Configure the PWM0 to count down without synchronization.

    //

    PWMGenConfigure(PWM0_BASE, PWM_GEN_0,

    PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);

    //

    // Set the PWM period to 250Hz. To calculate the appropriate parameter

    // use the following equation: N = (1 / f) * SysClk. Where N is the

    // function parameter, f is the desired frequency, and SysClk is the

    // system clock frequency.

    // In this case you get: (1 / 250Hz) * 16MHz = 64000 cycles. Note that

    // the maximum period you can set is 2^16.

    //

    PWMGenPeriodSet(PWM0_BASE, PWM_GEN_0, 64000);

    //

    // For this example the PWM0 duty cycle will be variable. The duty cycle

    // will start at 0.1% (0.01 * 64000 cycles = 640 cycles) and will increase

    // to 75% (0.5 * 64000 cycles = 32000 cycles). After a duty cycle of 75%

    // is reached, it is reset to 0.1%. This dynamic adjustment of the pulse

    // width is done in the PWM0 load interrupt, which increases the duty

    // cycle by 0.1% everytime the reload interrupt is received.

    //

    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0, 64);

    //

    // Enable processor interrupts.

    //

    IntMasterEnable();

    //

    // Allow PWM0 generated interrupts. This configuration is done to

    // differentiate fault interrupts from other PWM0 related interrupts.

    //

    PWMIntEnable(PWM0_BASE, PWM_INT_GEN_0);

    //

    // Enable the PWM0 LOAD interrupt on PWM0.

    //

    PWMGenIntTrigEnable(PWM0_BASE, PWM_GEN_0, PWM_INT_CNT_LOAD);

    //

    // Enable the PWM0 interrupts on the processor (NVIC).

    //

    IntEnable(INT_PWM0_0);

    //

    // Enable the PWM0 output signal (PD0).

    //

    PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT, true);

    //

    // Enables the PWM generator block.

    //

    PWMGenEnable(PWM0_BASE, PWM_GEN_0);

    //

    // Loop forever while the PWM signals are generated and PWM0 interrupts

    // get received.

    //

    while(1)

    {

    }

    }

  • this the vector table  for the interrupt handler:

    #include <stdint.h>

    //*****************************************************************************

    //

    // Forward declaration of the default fault handlers.

    //

    //*****************************************************************************

    void ResetISR(void);

    static void NmiSR(void);

    static void FaultISR(void);

    static void IntDefaultHandler(void);

    //*****************************************************************************

    //

    // External declaration for the reset handler that is to be called when the

    // processor is started

    //

    //*****************************************************************************

    extern void _c_int00(void);

    //*****************************************************************************

    //

    // Linker variable that marks the top of the stack.

    //

    //*****************************************************************************

    extern uint32_t __STACK_TOP;

    //*****************************************************************************

    //

    // External declarations for the interrupt handlers used by the application.

    //

    //*****************************************************************************

    // To be added by user

    //*****************************************************************************

    //

    // The vector table. Note that the proper constructs must be placed on this to

    // ensure that it ends up at physical address 0x0000.0000 or at the start of

    // the program if located at a start address other than 0.

    //

    //*****************************************************************************

    #pragma DATA_SECTION(g_pfnVectors, ".intvecs")

    void (* const g_pfnVectors[])(void) =

    {

    (void (*)(void))((uint32_t)&__STACK_TOP),

    // The initial stack pointer

    ResetISR, // The reset handler

    NmiSR, // The NMI handler

    FaultISR, // The hard fault handler

    IntDefaultHandler, // The MPU fault handler

    IntDefaultHandler, // The bus fault handler

    IntDefaultHandler, // The usage fault handler

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // SVCall handler

    IntDefaultHandler, // Debug monitor handler

    0, // Reserved

    IntDefaultHandler, // The PendSV handler

    IntDefaultHandler, // The SysTick handler

    IntDefaultHandler, // GPIO Port A

    IntDefaultHandler, // GPIO Port B

    IntDefaultHandler, // GPIO Port C

    IntDefaultHandler, // GPIO Port D

    IntDefaultHandler, // GPIO Port E

    IntDefaultHandler, // UART0 Rx and Tx

    IntDefaultHandler, // UART1 Rx and Tx

    IntDefaultHandler, // SSI0 Rx and Tx

    IntDefaultHandler, // I2C0 Master and Slave

    IntDefaultHandler, // PWM Fault

    IntDefaultHandler, // PWM Generator 0

    IntDefaultHandler, // PWM Generator 1

    IntDefaultHandler, // PWM Generator 2

    IntDefaultHandler, // Quadrature Encoder 0

    IntDefaultHandler, // ADC Sequence 0

    IntDefaultHandler, // ADC Sequence 1

    IntDefaultHandler, // ADC Sequence 2

    IntDefaultHandler, // ADC Sequence 3

    IntDefaultHandler, // Watchdog timer

    IntDefaultHandler, // Timer 0 subtimer A

    IntDefaultHandler, // Timer 0 subtimer B

    IntDefaultHandler, // Timer 1 subtimer A

    IntDefaultHandler, // Timer 1 subtimer B

    IntDefaultHandler, // Timer 2 subtimer A

    IntDefaultHandler, // Timer 2 subtimer B

    IntDefaultHandler, // Analog Comparator 0

    IntDefaultHandler, // Analog Comparator 1

    IntDefaultHandler, // Analog Comparator 2

    IntDefaultHandler, // System Control (PLL, OSC, BO)

    IntDefaultHandler, // FLASH Control

    IntDefaultHandler, // GPIO Port F

    IntDefaultHandler, // GPIO Port G

    IntDefaultHandler, // GPIO Port H

    IntDefaultHandler, // UART2 Rx and Tx

    IntDefaultHandler, // SSI1 Rx and Tx

    IntDefaultHandler, // Timer 3 subtimer A

    IntDefaultHandler, // Timer 3 subtimer B

    IntDefaultHandler, // I2C1 Master and Slave

    IntDefaultHandler, // Quadrature Encoder 1

    IntDefaultHandler, // CAN0

    IntDefaultHandler, // CAN1

    IntDefaultHandler, // CAN2

    0, // Reserved

    IntDefaultHandler, // Hibernate

    IntDefaultHandler, // USB0

    IntDefaultHandler, // PWM Generator 3

    IntDefaultHandler, // uDMA Software Transfer

    IntDefaultHandler, // uDMA Error

    IntDefaultHandler, // ADC1 Sequence 0

    IntDefaultHandler, // ADC1 Sequence 1

    IntDefaultHandler, // ADC1 Sequence 2

    IntDefaultHandler, // ADC1 Sequence 3

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // GPIO Port J

    IntDefaultHandler, // GPIO Port K

    IntDefaultHandler, // GPIO Port L

    IntDefaultHandler, // SSI2 Rx and Tx

    IntDefaultHandler, // SSI3 Rx and Tx

    IntDefaultHandler, // UART3 Rx and Tx

    IntDefaultHandler, // UART4 Rx and Tx

    IntDefaultHandler, // UART5 Rx and Tx

    IntDefaultHandler, // UART6 Rx and Tx

    IntDefaultHandler, // UART7 Rx and Tx

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // I2C2 Master and Slave

    IntDefaultHandler, // I2C3 Master and Slave

    IntDefaultHandler, // Timer 4 subtimer A

    IntDefaultHandler, // Timer 4 subtimer B

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // Timer 5 subtimer A

    IntDefaultHandler, // Timer 5 subtimer B

    IntDefaultHandler, // Wide Timer 0 subtimer A

    IntDefaultHandler, // Wide Timer 0 subtimer B

    IntDefaultHandler, // Wide Timer 1 subtimer A

    IntDefaultHandler, // Wide Timer 1 subtimer B

    IntDefaultHandler, // Wide Timer 2 subtimer A

    IntDefaultHandler, // Wide Timer 2 subtimer B

    IntDefaultHandler, // Wide Timer 3 subtimer A

    IntDefaultHandler, // Wide Timer 3 subtimer B

    IntDefaultHandler, // Wide Timer 4 subtimer A

    IntDefaultHandler, // Wide Timer 4 subtimer B

    IntDefaultHandler, // Wide Timer 5 subtimer A

    IntDefaultHandler, // Wide Timer 5 subtimer B

    IntDefaultHandler, // FPU

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // I2C4 Master and Slave

    IntDefaultHandler, // I2C5 Master and Slave

    IntDefaultHandler, // GPIO Port M

    IntDefaultHandler, // GPIO Port N

    IntDefaultHandler, // Quadrature Encoder 2

    0, // Reserved

    0, // Reserved

    IntDefaultHandler, // GPIO Port P (Summary or P0)

    IntDefaultHandler, // GPIO Port P1

    IntDefaultHandler, // GPIO Port P2

    IntDefaultHandler, // GPIO Port P3

    IntDefaultHandler, // GPIO Port P4

    IntDefaultHandler, // GPIO Port P5

    IntDefaultHandler, // GPIO Port P6

    IntDefaultHandler, // GPIO Port P7

    IntDefaultHandler, // GPIO Port Q (Summary or Q0)

    IntDefaultHandler, // GPIO Port Q1

    IntDefaultHandler, // GPIO Port Q2

    IntDefaultHandler, // GPIO Port Q3

    IntDefaultHandler, // GPIO Port Q4

    IntDefaultHandler, // GPIO Port Q5

    IntDefaultHandler, // GPIO Port Q6

    IntDefaultHandler, // GPIO Port Q7

    IntDefaultHandler, // GPIO Port R

    IntDefaultHandler, // GPIO Port S

    IntDefaultHandler, // PWM 1 Generator 0

    IntDefaultHandler, // PWM 1 Generator 1

    IntDefaultHandler, // PWM 1 Generator 2

    IntDefaultHandler, // PWM 1 Generator 3

    IntDefaultHandler // PWM 1 Fault

    };

    //*****************************************************************************

    //

    // This is the code that gets called when the processor first starts execution

    // following a reset event. Only the absolutely necessary set is performed,

    // after which the application supplied entry() routine is called. Any fancy

    // actions (such as making decisions based on the reset cause register, and

    // resetting the bits in that register) are left solely in the hands of the

    // application.

    //

    //*****************************************************************************

    void

    ResetISR(void)

    {

    //

    // Jump to the CCS C initialization routine. This will enable the

    // floating-point unit as well, so that does not need to be done here.

    //

    __asm(" .global _c_int00\n"

    " b.w _c_int00");

    }

    //*****************************************************************************

    //

    // This is the code that gets called when the processor receives a NMI. This

    // simply enters an infinite loop, preserving the system state for examination

    // by a debugger.

    //

    //*****************************************************************************

    static void

    NmiSR(void)

    {

    //

    // Enter an infinite loop.

    //

    while(1)

    {

    }

    }

    //*****************************************************************************

    //

    // This is the code that gets called when the processor receives a fault

    // interrupt. This simply enters an infinite loop, preserving the system state

    // for examination by a debugger.

    //

    //*****************************************************************************

    static void

    FaultISR(void)

    {

    //

    // Enter an infinite loop.

    //

    while(1)

    {

    }

    }

    //*****************************************************************************

    //

    // This is the code that gets called when the processor receives an unexpected

    // interrupt. This simply enters an infinite loop, preserving the system state

    // for examination by a debugger.

    //

    //*****************************************************************************

    static void

    IntDefaultHandler(void)

    {

    //

    // Go into an infinite loop.

    //

    while(1)

    {

    }

    }

  • please I need an actual coding examples not just a suggestions (do this or do that ), If I never done this before and the examples are not performing as expected  , how can I be able to understand the code or how it works. Thank you

  • Hi Majdi,

    There are multiple things that a user wants from a code, and it would not be possible for a vendor to have a code example for each of the requirement. These code examples are meant to be a start-up example for using the module. While this is frustrating for a first time user, it is important that the data sheet reading be also done along side to develop the understanding of the peripheral. With having said that, I can help you build your code

    1. The PWM0IntHandler needs to be mapped to the correct entry in the vector table. The comments for every entry in the vector table should help you.

    2. The PWM0IntHandler has to be defined as an extern in the startup file as the function prototype exists in the test C file.

    3. Secondly how to do you plan to increase and decrease the DC. Is there a Switch that will be read to make this decision. I am unclear on the same so bit more clarity would be useful.

    Regards

    Amit

  • I am building an solar power inverter. the duty cycle will correspond to sine wave mapping , means if a low pass filter would be installed at the output , the result would be a sine wave signal. therefore the PWM duty cycle has to be set automatically and with no external button .

    could you clarify part 1. and part  2. please I tried different things and again I am new to this . can you show me what should I do with PWM0IntHandler. Thank you

  • Hi Majdi,

    OK so now it is clear. If you are using CCS for development then in the startup_ccs.c file you need to map as shown in the attachment.

    Secondly since it is time based PWM DC Change then every time the Interrupt fires you would have to write the algorithm to update the On Time of the PWM Signal.

    //*****************************************************************************
    //
    // startup_ccs.c - Startup code for use with TI's Code Composer Studio.
    //
    // Copyright (c) 2012-2013 Texas Instruments Incorporated.  All rights reserved.
    // Software License Agreement
    // 
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    // 
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    // DAMAGES, FOR ANY REASON WHATSOEVER.
    // 
    // This is part of revision 2.0.1.11577 of the EK-TM4C123GXL Firmware Package.
    //
    //*****************************************************************************
    
    #include <stdint.h>
    #include "inc/hw_nvic.h"
    #include "inc/hw_types.h"
    
    //*****************************************************************************
    //
    // Forward declaration of the default fault handlers.
    //
    //*****************************************************************************
    void ResetISR(void);
    static void NmiSR(void);
    static void FaultISR(void);
    static void IntDefaultHandler(void);
    
    //*****************************************************************************
    //
    // External declaration for the reset handler that is to be called when the
    // processor is started
    //
    //*****************************************************************************
    extern void PWM0IntHandler(void);
    extern void _c_int00(void);
    
    //*****************************************************************************
    //
    // Linker variable that marks the top of the stack.
    //
    //*****************************************************************************
    extern uint32_t __STACK_TOP;
    
    //*****************************************************************************
    //
    // The vector table.  Note that the proper constructs must be placed on this to
    // ensure that it ends up at physical address 0x0000.0000 or at the start of
    // the program if located at a start address other than 0.
    //
    //*****************************************************************************
    #pragma DATA_SECTION(g_pfnVectors, ".intvecs")
    void (* const g_pfnVectors[])(void) =
    {
        (void (*)(void))((uint32_t)&__STACK_TOP),
                                                // The initial stack pointer
        ResetISR,                               // The reset handler
        NmiSR,                                  // The NMI handler
        FaultISR,                               // The hard fault handler
        IntDefaultHandler,                      // The MPU fault handler
        IntDefaultHandler,                      // The bus fault handler
        IntDefaultHandler,                      // The usage fault handler
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // SVCall handler
        IntDefaultHandler,                      // Debug monitor handler
        0,                                      // Reserved
        IntDefaultHandler,                      // The PendSV handler
        IntDefaultHandler,                      // The SysTick handler
        IntDefaultHandler,                      // GPIO Port A
        IntDefaultHandler,                        // GPIO Port B
        IntDefaultHandler,                      // GPIO Port C
        IntDefaultHandler,                      // GPIO Port D
        IntDefaultHandler,                      // GPIO Port E
        IntDefaultHandler,                      // UART0 Rx and Tx
        IntDefaultHandler,                      // UART1 Rx and Tx
        IntDefaultHandler,                      // SSI0 Rx and Tx
        IntDefaultHandler,                      // I2C0 Master and Slave
        IntDefaultHandler,                      // PWM Fault
        PWM0IntHandler,                         // PWM Generator 0
        IntDefaultHandler,                      // PWM Generator 1
        IntDefaultHandler,                      // PWM Generator 2
        IntDefaultHandler,                      // Quadrature Encoder 0
        IntDefaultHandler,                      // ADC Sequence 0
        IntDefaultHandler,                      // ADC Sequence 1
        IntDefaultHandler,                      // ADC Sequence 2
        IntDefaultHandler,                      // ADC Sequence 3
        IntDefaultHandler,                      // Watchdog timer
        IntDefaultHandler,                      // Timer 0 subtimer A
        IntDefaultHandler,                      // Timer 0 subtimer B
        IntDefaultHandler,                      // Timer 1 subtimer A
        IntDefaultHandler,                      // Timer 1 subtimer B
        IntDefaultHandler,                      // Timer 2 subtimer A
        IntDefaultHandler,                      // Timer 2 subtimer B
        IntDefaultHandler,                      // Analog Comparator 0
        IntDefaultHandler,                      // Analog Comparator 1
        IntDefaultHandler,                      // Analog Comparator 2
        IntDefaultHandler,                      // System Control (PLL, OSC, BO)
        IntDefaultHandler,                      // FLASH Control
        IntDefaultHandler,                      // GPIO Port F
        IntDefaultHandler,                      // GPIO Port G
        IntDefaultHandler,                      // GPIO Port H
        IntDefaultHandler,                      // UART2 Rx and Tx
        IntDefaultHandler,                      // SSI1 Rx and Tx
        IntDefaultHandler,                      // Timer 3 subtimer A
        IntDefaultHandler,                      // Timer 3 subtimer B
        IntDefaultHandler,                      // I2C1 Master and Slave
        IntDefaultHandler,                      // Quadrature Encoder 1
        IntDefaultHandler,                      // CAN0
        IntDefaultHandler,                      // CAN1
        IntDefaultHandler,                      // CAN2
        0,                                      // Reserved
        IntDefaultHandler,                      // Hibernate
        IntDefaultHandler,                      // USB0
        IntDefaultHandler,                      // PWM Generator 3
        IntDefaultHandler,                      // uDMA Software Transfer
        IntDefaultHandler,                      // uDMA Error
        IntDefaultHandler,                      // ADC1 Sequence 0
        IntDefaultHandler,                      // ADC1 Sequence 1
        IntDefaultHandler,                      // ADC1 Sequence 2
        IntDefaultHandler,                      // ADC1 Sequence 3
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // GPIO Port J
        IntDefaultHandler,                      // GPIO Port K
        IntDefaultHandler,                      // GPIO Port L
        IntDefaultHandler,                      // SSI2 Rx and Tx
        IntDefaultHandler,                      // SSI3 Rx and Tx
        IntDefaultHandler,                      // UART3 Rx and Tx
        IntDefaultHandler,                      // UART4 Rx and Tx
        IntDefaultHandler,                      // UART5 Rx and Tx
        IntDefaultHandler,                      // UART6 Rx and Tx
        IntDefaultHandler,                      // UART7 Rx and Tx
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // I2C2 Master and Slave
        IntDefaultHandler,                      // I2C3 Master and Slave
        IntDefaultHandler,                      // Timer 4 subtimer A
        IntDefaultHandler,                      // Timer 4 subtimer B
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // Timer 5 subtimer A
        IntDefaultHandler,                      // Timer 5 subtimer B
        IntDefaultHandler,                      // Wide Timer 0 subtimer A
        IntDefaultHandler,                      // Wide Timer 0 subtimer B
        IntDefaultHandler,                      // Wide Timer 1 subtimer A
        IntDefaultHandler,                      // Wide Timer 1 subtimer B
        IntDefaultHandler,                      // Wide Timer 2 subtimer A
        IntDefaultHandler,                      // Wide Timer 2 subtimer B
        IntDefaultHandler,                      // Wide Timer 3 subtimer A
        IntDefaultHandler,                      // Wide Timer 3 subtimer B
        IntDefaultHandler,                      // Wide Timer 4 subtimer A
        IntDefaultHandler,                      // Wide Timer 4 subtimer B
        IntDefaultHandler,                      // Wide Timer 5 subtimer A
        IntDefaultHandler,                      // Wide Timer 5 subtimer B
        IntDefaultHandler,                      // FPU
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // I2C4 Master and Slave
        IntDefaultHandler,                      // I2C5 Master and Slave
        IntDefaultHandler,                      // GPIO Port M
        IntDefaultHandler,                      // GPIO Port N
        IntDefaultHandler,                      // Quadrature Encoder 2
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // GPIO Port P (Summary or P0)
        IntDefaultHandler,                      // GPIO Port P1
        IntDefaultHandler,                      // GPIO Port P2
        IntDefaultHandler,                      // GPIO Port P3
        IntDefaultHandler,                      // GPIO Port P4
        IntDefaultHandler,                      // GPIO Port P5
        IntDefaultHandler,                      // GPIO Port P6
        IntDefaultHandler,                      // GPIO Port P7
        IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)
        IntDefaultHandler,                      // GPIO Port Q1
        IntDefaultHandler,                      // GPIO Port Q2
        IntDefaultHandler,                      // GPIO Port Q3
        IntDefaultHandler,                      // GPIO Port Q4
        IntDefaultHandler,                      // GPIO Port Q5
        IntDefaultHandler,                      // GPIO Port Q6
        IntDefaultHandler,                      // GPIO Port Q7
        IntDefaultHandler,                      // GPIO Port R
        IntDefaultHandler,                      // GPIO Port S
        IntDefaultHandler,                      // PWM 1 Generator 0
        IntDefaultHandler,                      // PWM 1 Generator 1
        IntDefaultHandler,                      // PWM 1 Generator 2
        IntDefaultHandler,                      // PWM 1 Generator 3
        IntDefaultHandler                       // PWM 1 Fault
    };
    
    //*****************************************************************************
    //
    // This is the code that gets called when the processor first starts execution
    // following a reset event.  Only the absolutely necessary set is performed,
    // after which the application supplied entry() routine is called.  Any fancy
    // actions (such as making decisions based on the reset cause register, and
    // resetting the bits in that register) are left solely in the hands of the
    // application.
    //
    //*****************************************************************************
    void
    ResetISR(void)
    {
        //
        // Jump to the CCS C initialization routine.  This will enable the
        // floating-point unit as well, so that does not need to be done here.
        //
        __asm("    .global _c_int00\n"
              "    b.w     _c_int00");
    }
    
    //*****************************************************************************
    //
    // This is the code that gets called when the processor receives a NMI.  This
    // simply enters an infinite loop, preserving the system state for examination
    // by a debugger.
    //
    //*****************************************************************************
    static void
    NmiSR(void)
    {
        //
        // Enter an infinite loop.
        //
        while(1)
        {
        }
    }
    
    //*****************************************************************************
    //
    // This is the code that gets called when the processor receives a fault
    // interrupt.  This simply enters an infinite loop, preserving the system state
    // for examination by a debugger.
    //
    //*****************************************************************************
    static void
    FaultISR(void)
    {
        //
        // Enter an infinite loop.
        //
        while(1)
        {
        }
    }
    
    //*****************************************************************************
    //
    // This is the code that gets called when the processor receives an unexpected
    // interrupt.  This simply enters an infinite loop, preserving the system state
    // for examination by a debugger.
    //
    //*****************************************************************************
    static void
    IntDefaultHandler(void)
    {
        //
        // Go into an infinite loop.
        //
        while(1)
        {
        }
    }
    

    Regards

    Amit