Update Group21_Lab06_Task2/main.c

Add Systic Setting
This commit is contained in:
Uttam Bhavimani Bhavimani 2024-09-22 19:53:15 +05:30
parent 902418281c
commit ac469495c0
1 changed files with 6 additions and 0 deletions

View File

@ -31,3 +31,9 @@ void GPIO_PORT_F_init(void) {
GPIO_PORTF_IEV_R = 0x00; // Falling edge event GPIO_PORTF_IEV_R = 0x00; // Falling edge event
GPIO_PORTF_IM_R |= 0x11; // Unmask interrupts for PF0 and PF4 GPIO_PORTF_IM_R |= 0x11; // Unmask interrupts for PF0 and PF4
} }
void systick_setting(void) {
STRELOAD = SYSTICK_RELOAD_VALUE(PWM_PERIOD/100); // Set reload value for 10 µs intervals (100 kHz)
STCTRL |= (CLKINT | ENABLE | INTEN); // Set internal clock, enable the timer
STCURRENT = 0; // Clear STCURRENT value
}