diff --git a/main.c b/main.c index 676702e..f2ae194 100644 --- a/main.c +++ b/main.c @@ -9,3 +9,10 @@ #define CLKINT (1 << 2) // Bit 2 of CSR to specify CPU clock #define CLOCK_HZ 16000000 // Clock frequency of EK-TM4C123GXL #define SYSTICK_RELOAD_VALUE(us) ((CLOCK_HZ / 1000000) * (us) - 1) // SysTick reload value in microseconds based on clock frequency + +void systick_setting(void) +{ + STRELOAD = SYSTICK_RELOAD_VALUE(1000); // RELOAD VALUE FOR 1ms + STCTRL |= ENABLE | CLKINT; // Enable SysTick with system clock + STCURRENT = 0; // Clear current value +}