From 0d7b2a1af7f56fbc7390c921b8ee61f87022c587 Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Thu, 19 Sep 2024 22:43:43 +0530 Subject: [PATCH] PWM module initialization --- Lab6_Task1.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Lab6_Task1.c b/Lab6_Task1.c index 004f230..a9ece2c 100644 --- a/Lab6_Task1.c +++ b/Lab6_Task1.c @@ -18,10 +18,16 @@ void main(void) 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); } GPIO_PORTF_AFSEL_R |= 0x02;