diff --git a/Group21_Lab06_Task1/main.c b/Group21_Lab06_Task1/main.c index d899106..e4adfd9 100644 --- a/Group21_Lab06_Task1/main.c +++ b/Group21_Lab06_Task1/main.c @@ -32,3 +32,10 @@ volatile int duty = 50; // Initial duty const volatile int PWM_PERIOD = 1000000; // Period for 100kHz in microseconds (10ms) volatile int ontime = 0; // Variable to track on time //volatile bool ledState = false; // State of the LED + +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 +}