PWM module initialization

This commit is contained in:
Rajput R Vikramsingh Vikramsingh 2024-09-19 22:43:43 +05:30
parent fa6077839b
commit 0d7b2a1af7
1 changed files with 7 additions and 1 deletions

View File

@ -18,10 +18,16 @@ void main(void)
GPIO_PORTF_AFSEL_R |= 0x02; GPIO_PORTF_AFSEL_R |= 0x02;
GPIO_PORTF_PCTL_R |= 0x50; 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; GPIO_PORTF_AFSEL_R |= 0x02;