From 36a19620704283c0a3ac8403abd1f4e99536db0f Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Sun, 22 Sep 2024 15:58:08 +0530 Subject: [PATCH] Added some more initialization --- Lab6_Task2.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Lab6_Task2.c b/Lab6_Task2.c index 30856ea..9cbbce2 100644 --- a/Lab6_Task2.c +++ b/Lab6_Task2.c @@ -21,9 +21,16 @@ void main(void) SYSCTL_RCC_R &= ~(1 << 20); SYSCTL_RCGC0_R |= 0x00100000; SYSCTL_RCGCPWM_R = 0x3; - //SYSCTL_RCGC2_R |= 0x20; - //GPIO_PORTF_DEN_R= 0x1F; - //GPIO_PORTF_DIR_R= 0x0E; + + + SYSCTL_RCGC2_R |= 0x20; + GPIO_PORTF_LOCK_R = 0x4C4F434B; /* unlock commit register*/ + GPIO_PORTF_CR_R = 0x1F; + GPIO_PORTF_DEN_R= 0x1F; + GPIO_PORTF_DIR_R= 0x0E; + GPIO_PORTF_PUR_R = 0x11; + + GPIOF_config(); GPIOF_Interrupt_config(); GPIO_PORTF_AFSEL_R |= 0x02; @@ -31,7 +38,6 @@ void main(void) 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;