From 3482a25afcebcf1819d0eaea9de7fa2e2723ed20 Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Thu, 19 Sep 2024 23:22:45 +0530 Subject: [PATCH] PWM initialization --- Lab6_Task2.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Lab6_Task2.c b/Lab6_Task2.c index eaebc2f..d0f5691 100644 --- a/Lab6_Task2.c +++ b/Lab6_Task2.c @@ -24,4 +24,37 @@ void main(void) //SYSCTL_RCGC2_R |= 0x20; //GPIO_PORTF_DEN_R= 0x1F; //GPIO_PORTF_DIR_R= 0x0E; + GPIOF_config(); + GPIOF_Interrupt_config(); + GPIO_PORTF_AFSEL_R |= 0x02; + GPIO_PORTF_PCTL_R |= 0x50; + + PWM1_2_CTL_R= 0x00000000; + PWM1_2_GENB_R |= 0x80E; + + PWM1_2_LOAD_R = 0xA0; + PWM1_2_CMPB_R = 0x50; + PWM1_2_CTL_R |=0x01; + PWM1_ENABLE_R |=(1<<5); + + while(1); + } + + + + + + + + + + + + + + + + + +