Greetings from Germany,
I've got a little problem with the initialization of the PWM module of my tm4c123gh6pm. I've written the following code:
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_sysctl.h"
#include "driverlib/timer.h"
#include "inc/hw_pwm.h"
#include "driverlib/pwm.h"
int main(void) {
volatile uint32_t foo;
SYSCTL_RCC_R = SYSCTL_XTAL_16MHZ | SYSCTL_USE_PLL | SYSCTL_SYSDIV_5 | SYSCTL_OSC_MAIN;
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOF;
foo = SYSCTL_RCGC2_R;
SYSCTL_RCGC0_R |= SYSCTL_RCGC0_PWM0;
GPIO_PORTF_AFSEL_R |= GPIO_PIN_3;
GPIO_PORTF_DEN_R |= GPIO_PIN_3;
GPIO_PORTF_PCTL_R |= GPIO_PCTL_PF3_M1PWM7;
SYSCTL_RCC_R |= SYSCTL_RCC_PWMDIV_4;
PWM1_CTL_R |= 0;
PWM1_3_GENA_R |= 0x0000008C;
PWM1_3_GENA_R |= 0x0000080C;
PWM1_3_LOAD_R = 0x0000018F;
PWM1_3_CMPA_R = 0x0000012B;
PWM1_3_CMPB_R = 0x00000063;
PWM1_CTL_R |= PWM_3_CTL_ENABLE;
PWM1_ENABLE_R |= PWM_ENABLE_PWM7EN;
while(1){}
return 0;
}
And i think there's a little problem in this code i'm not able to find. Can anyone of you please help me?
Thanks a lot