From ad75550260068087c4351a6a197e10c02fe3b399 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Sun, 24 Dec 2023 23:03:47 -0600 Subject: Add blinkN subroutine --- pll.s | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pll.s') diff --git a/pll.s b/pll.s index 7458f61..38573f7 100644 --- a/pll.s +++ b/pll.s @@ -56,3 +56,13 @@ vco_lock: movs r0, 0x8 // postdiv (bit 3) str r0, [r1, PWR_OFST] bx lr + +.type delay_1s, %function +.global delay_1s + +delay_1s: + ldr r3, =0x1fca055 // 33.3 * 10^6 (one-third of a second at 100MHz) +1: // 3 clock cycle loop + subs r3, r3, 1 // 1 clock cycle + bne 1b // 2 clock cycles when taken + mov pc, lr -- cgit v1.2.3