From ac469495c0cbabb85dd77c6fc95922eb11e6b263 Mon Sep 17 00:00:00 2001 From: Uttam Ambappa Bhavimani Date: Sun, 22 Sep 2024 19:53:15 +0530 Subject: [PATCH] Update Group21_Lab06_Task2/main.c Add Systic Setting --- Group21_Lab06_Task2/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Group21_Lab06_Task2/main.c b/Group21_Lab06_Task2/main.c index c20d4ce..0c6c861 100644 --- a/Group21_Lab06_Task2/main.c +++ b/Group21_Lab06_Task2/main.c @@ -31,3 +31,9 @@ void GPIO_PORT_F_init(void) { GPIO_PORTF_IEV_R = 0x00; // Falling edge event 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 +} \ No newline at end of file