/* * activity6.c * * Created on: Sep 25, 2025 * Author: sowgro */ #include #include typedef struct { uint32_t CSR; uint32_t RVR; uint32_t CVR; uint32_t CALIB; } sys_tick; void activity6_run() { sys_tick *s = (sys_tick *) 0xE000E010; printf("%lu\r\n", s->CVR); s->RVR = 8000000; s->CSR |= 1; // Turn on systick timer s->CSR |= 1<<2; // Use internal clock int time = 0; int count = 0; for(;;) { if (s->CSR & (1<<16)) { count++; if (count == 10) { // Count to 10 tenths then print next second printf ("%d\r\n", time); time++; count = 0; } } } }