make timer16 overflow every 512 cycles
authorTobias Girstmair <tobi@isticktoit.net>
Tue, 27 Apr 2021 08:07:49 +0000 (10:07 +0200)
committerTobias Girstmair <tobi@isticktoit.net>
Tue, 27 Apr 2021 08:07:49 +0000 (10:07 +0200)
music is still _way_ to slow; need to investigate.

bsv.asm

diff --git a/bsv.asm b/bsv.asm
index c91510c6657a8d6d41707a0de478f413bd63d600..f31ee13cac06824bc715b6acf2562a8767f0e4ac 100644 (file)
--- 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
Imprint / Impressum