From: Tobias Girstmair Date: Wed, 28 Apr 2021 07:24:27 +0000 (+0200) Subject: better way to skip calibration when programming same chip multiple times X-Git-Url: https://git.gir.st/Chiptunes-pms150c.git/commitdiff_plain/8410984af39f568560a0ee2e0a7cfadf3ae1bda3 better way to skip calibration when programming same chip multiple times --- diff --git a/bsv.asm b/bsv.asm index b6fed82..f7bb7ff 100644 --- a/bsv.asm +++ b/bsv.asm @@ -50,6 +50,7 @@ ihrcr = 0x0B ; 512 cycles (the next power of two above the 495 cycles the program needs for ; execution), this gives us a clock speed of 512 * 8khz = 4.096MHz. The MCU ; will be powered by a 3V lithium coin cell. +do_calib = 1 calib_freq = 4096000 ; Hz calib_vdd = 3000 ; mV @@ -204,8 +205,8 @@ init: MOV a, #active_clock MOV clkmd, a ; switch to IHRC - .org 0x106 ; comment out on 2nd iteration ; calibration placeholder: + .if do_calib AND a, #'R' AND a, #'C' AND a, #1 ; IHRC @@ -216,7 +217,10 @@ init: AND a, #( calib_vdd ) AND a, #( calib_vdd>>8 ) AND a, #ihrcr - .org 0x11a + .else + .word 0xffff, 0xffff, 0xffff, 0xffff, 0xffff + .word 0xffff, 0xffff, 0xffff, 0xffff, 0xffff + .endif ;stack setup: MOV a, #stack_start