From fa6077839b4a27bcae60893e1fa959794b787f88 Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Thu, 19 Sep 2024 22:40:17 +0530 Subject: [PATCH] Port initialization --- Lab6_Task1.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Lab6_Task1.c b/Lab6_Task1.c index 327904f..004f230 100644 --- a/Lab6_Task1.c +++ b/Lab6_Task1.c @@ -3,6 +3,27 @@ #include "tm4c123gh6pm.h" #define mask_bits 0x11 //mask bits for user switch + +void GPIOF_config(void); +void GPIOF_Int_Config(void); + +void main(void) + { + SYSCTL_RCC_R &= ~(1 << 20); //SYSTEM CLOCK SOURCE FOR 16MHz PWM + SYSCTL_RCGC0_R |= 0x00100000; //enable clock for PWM module + SYSCTL_RCGCPWM_R = 0x3; // + + GPIOF_config(); + GPIOF_Interrupt_config(); + GPIO_PORTF_AFSEL_R |= 0x02; + GPIO_PORTF_PCTL_R |= 0x50; + + + + + + + } GPIO_PORTF_AFSEL_R |= 0x02; GPIO_PORTF_PCTL_R |= 0x50; PWM1_2_CTL_R= 0x00000000;