Hi forum,
I'm designed an controlelr with the TM4C1294KCPDT. Now I try to initialize the Timer 5_A to generate a PWM-signal.
I started with the example code comming with CCS6 Tiva.
Access to Pin 71 (PM7) as GPIO works well, but I can't get a waveform from the Timer.
Someone have a idea what is wrong ? Thanks for your comment.
Here my short program: (labels PART_TM4C1294KCPDT and TARGET_IS_TM4C129_RA1 are defined in my CCS6-project)
#include <stdbool.h>
#include <stdint.h>
#include "inc/tm4c1294kcpdt.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
//*****************************************************************************
//
//! This function initializes PWM output at pin PM7
//!
//! \param none
//!
//! \return nothing
//
//*****************************************************************************
void main( void)
{
//
// Set the system clock to run at 16MHz from the PLL.
//
SysCtlClockFreqSet( (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_320), 16000000);
//
// The Timer used for CLK_OUT peripheral must be enabled for use.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER5);
SysCtlDelay(2);
//
// Enable this peripheral.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);
SysCtlDelay(2);
//
// 16/32-Bit Timer 5 Capture/Compare/PWM 1.
// Configure the GPIO pin muxing for the Timer/CCP function.
//
GPIOPinConfigure(GPIO_PM7_T5CCP1);
//
// Configures pin(s) for use as CLK_OUT
//
GPIOPinTypeTimer(GPIO_PORTM_BASE, GPIO_PIN_7);
//
// Disable and Configure CLK_OUT-Timer as a 16-bit PWM timer.
//
TimerConfigure(TIMER5_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM);
//
// From the load value (cycle time) down to match value the signal will be high.
// From the match value to 0 the timer will be low.
// clkout-frequency is 1 / (80MHz / (high + low))
//
TimerLoadSet(TIMER5_BASE, TIMER_A, 50000 );
TimerMatchSet(TIMER5_BASE, TIMER_A, 25000);
//
// Enable CLK_OUT-Timer.
//
TimerEnable(TIMER5_BASE, TIMER_A);
//
// loop forever
//
while(1) ;
}