From e8e4d78f94f7ffdd2eddf7c41df35b1fc43d7d87 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Tue, 27 Apr 2021 10:07:49 +0200 Subject: [PATCH] make timer16 overflow every 512 cycles music is still _way_ to slow; need to investigate. --- bsv.asm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bsv.asm b/bsv.asm index c91510c..f31ee13 100644 --- a/bsv.asm +++ b/bsv.asm @@ -246,10 +246,7 @@ init: ;XXX: increase pwm base frequency (/1) -> (4*4.096mhz)/(2^8) = 64khz ;timer16/ivr setup - ;mov a, #(( 0<<0 | 1<<3 | 4<<5 )) ; ovf@bit8 (512cy; §9.2.5), clk/4, ihrc - MOV a, #(( 1<<0 | 1<<3 | 4<<5 )) ; ovf@bit9 (???cy; §9.2.5), clk/4, ihrc - ;XXX: datasheet §5.10.1 says bit8 = 256cycles, 9.2.5 says bit8=512cy - ; note: ovf@bit9 causes 4khz isr => we need ovf@bit8. + MOV a, #(( 0<<0 | 1<<3 | 4<<5 )) ; ovf@bit8 (512cy; §9.2.5), clk/4, ihrc MOV t16m, a MOV a, #(1<<2) ; enable timer16 int, disable all others MOV inten, a -- 2.39.3