Documentation for “Zerocat Chipflasher” as of Sat, 07 Dec 2024 11:40:48 +0100
Repository:
Version: v2.0.5-18-05a6c4fe7
Branch: master
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor. Version 1.00.78 Compiling... ../../firmware2/src/ADC-monitor.spin |-pins.spin Done. Program size is 1100 bytes TYPE: 43 VALUE: 00000CE4 (00000000) NAME: MV_VCC TYPE: 43 VALUE: 00000CB2 (00000000) NAME: MV_GOOD TYPE: 43 VALUE: 00000A8C (00000000) NAME: MV_ALERT TYPE: 43 VALUE: 00000960 (00000000) NAME: MV_CRITICAL TYPE: 43 VALUE: 00000001 (00000000) NAME: BIT_GOOD TYPE: 43 VALUE: 00000002 (00000000) NAME: BIT_ALERT TYPE: 43 VALUE: 00000004 (00000000) NAME: BIT_CRITICAL TYPE: 43 VALUE: 00000400 (00000000) NAME: ADC_STARTTIME TYPE: 43 VALUE: 000003DE (00000000) NAME: ADC_RANGEINIT TYPE: 43 VALUE: 00009C40 (00000000) NAME: ADC_CHARGETIME TYPE: 53 VALUE: 00000301 (00000004) NAME: GO TYPE: 53 VALUE: 00000002 (00000004) NAME: GET_RANGE TYPE: 53 VALUE: 00000003 (00000004) NAME: GET_RESULT TYPE: 53 VALUE: 00000004 (00000004) NAME: GET_FLAG_GOOD TYPE: 53 VALUE: 00000005 (00000004) NAME: GET_RESULT_GOOD TYPE: 53 VALUE: 00000106 (00000004) NAME: ALERT TYPE: 53 VALUE: 00000007 (00000004) NAME: GET_FLAG_ALERT TYPE: 53 VALUE: 00000008 (00000004) NAME: GET_RESULT_ALERT TYPE: 53 VALUE: 00000109 (00000004) NAME: CRITICAL TYPE: 53 VALUE: 0000000A (00000004) NAME: GET_FLAG_CRITICAL TYPE: 53 VALUE: 0000000B (00000004) NAME: GET_RESULT_CRITICAL TYPE: 4F VALUE: 0000000C (00000000) NAME: PINS TYPE: 51 VALUE: 00000000 (00000000) NAME: PIN_CEN1^A TYPE: 51 VALUE: 00000001 (00000000) NAME: PIN_CEN0^A TYPE: 51 VALUE: 00000002 (00000000) NAME: PIN_MOSI^A TYPE: 51 VALUE: 00000003 (00000000) NAME: PIN_WPN^A TYPE: 51 VALUE: 00000004 (00000000) NAME: PIN_SCLK3^A TYPE: 51 VALUE: 00000005 (00000000) NAME: PIN_SCLK2^A TYPE: 51 VALUE: 00000006 (00000000) NAME: PIN_SCLK1^A TYPE: 51 VALUE: 00000007 (00000000) NAME: PIN_SCLK0^A TYPE: 51 VALUE: 00000008 (00000000) NAME: PIN_MISO^A TYPE: 51 VALUE: 00000009 (00000000) NAME: PIN_PLUGTESTN^A TYPE: 51 VALUE: 0000000A (00000000) NAME: PIN_PNP^A TYPE: 51 VALUE: 0000000C (00000000) NAME: PIN_HOLDN^A TYPE: 51 VALUE: 0000000D (00000000) NAME: PIN_D3^A TYPE: 51 VALUE: 0000000E (00000000) NAME: PIN_D2^A TYPE: 51 VALUE: 0000000F (00000000) NAME: PIN_D1^A TYPE: 51 VALUE: 0000001D (00000000) NAME: PIN_TRIGGER^A TYPE: 51 VALUE: 0000001E (00000000) NAME: PIN_TX^A TYPE: 51 VALUE: 0000001F (00000000) NAME: PIN_RX^A TYPE: 51 VALUE: 00000010 (00000000) NAME: SWDIP_A^A TYPE: 51 VALUE: 00000011 (00000000) NAME: SWDIP_B^A TYPE: 51 VALUE: 00000012 (00000000) NAME: SWDIP_1^A TYPE: 51 VALUE: 00000013 (00000000) NAME: SWDIP_2^A TYPE: 51 VALUE: 00000014 (00000000) NAME: SWDIP_3^A TYPE: 51 VALUE: 00000015 (00000000) NAME: SWDIP_4^A TYPE: 51 VALUE: 00000016 (00000000) NAME: SWDIP_5^A TYPE: 51 VALUE: 00000017 (00000000) NAME: SWDIP_6^A TYPE: 51 VALUE: 00000010 (00000000) NAME: RST_DISABLE^A TYPE: 51 VALUE: 00000018 (00000000) NAME: RS232_RST^A TYPE: 51 VALUE: 0000000B (00000000) NAME: RST_INHIBIT^A TYPE: 51 VALUE: 0000001B (00000000) NAME: ADC_OUT^A TYPE: 51 VALUE: 0000001A (00000000) NAME: ADC_CALIBRATION^A TYPE: 51 VALUE: 00000019 (00000000) NAME: ADC_IN^A TYPE: 51 VALUE: 00000003 (00000000) NAME: MASK_CEN_AVAIL^A TYPE: 51 VALUE: 000000F0 (00000000) NAME: MASK_SCLK_AVAIL^A TYPE: 51 VALUE: 000011FF (00000000) NAME: MASK_SPI_BUS_AVAIL^A TYPE: 51 VALUE: 000000F0 (00000000) NAME: MASK_SCLK_ACTIVE100^A TYPE: 51 VALUE: 000000E0 (00000000) NAME: MASK_SCLK_ACTIVE75^A TYPE: 51 VALUE: 000000C0 (00000000) NAME: MASK_SCLK_ACTIVE50^A TYPE: 51 VALUE: 00000080 (00000000) NAME: MASK_SCLK_ACTIVE25^A TYPE: 51 VALUE: 00000000 (00000000) NAME: MASK_SCLK_ACTIVE0^A TYPE: 51 VALUE: 000000F0 (00000000) NAME: MASK_SCLK_ACTIVE^A TYPE: 50 VALUE: 00000001 (00000000) NAME: CHECK_CABLE^A TYPE: 50 VALUE: 00000002 (00000000) NAME: GET_BOARD_CONFIG^A TYPE: 50 VALUE: 00000103 (00000000) NAME: GET_BOARD_VERSION^A TYPE: 50 VALUE: 00000104 (00000000) NAME: GET_PIN_RSTINHIBIT^A TYPE: 50 VALUE: 00000105 (00000000) NAME: GET_MONITOR_HARDWARE^A TYPE: 50 VALUE: 00000106 (00000000) NAME: GET_POWERUP_TYPE^A TYPE: 50 VALUE: 00000107 (00000000) NAME: GET_SUSPEND_INHIBIT^A TYPE: 50 VALUE: 00000108 (00000000) NAME: GET_MODE_SPI^A TYPE: 50 VALUE: 00000109 (00000000) NAME: GET_DRIVER_STRENGTH^A TYPE: 50 VALUE: 0000010A (00000000) NAME: GET_BAUDRATE^A TYPE: 50 VALUE: 0000010B (00000000) NAME: HIGH^A TYPE: 50 VALUE: 0000010C (00000000) NAME: LOW^A TYPE: 43 VALUE: 00000019 (00000000) NAME: ADC_IN TYPE: 43 VALUE: 0000001B (00000000) NAME: ADC_OUT TYPE: 43 VALUE: 0000001A (00000000) NAME: ADC_CALIB TYPE: 47 VALUE: 00000000 (00000000) NAME: STACK TYPE: 4A VALUE: 00000034 (00000000) NAME: MONITORADC_PASM TYPE: 4A VALUE: 000000D8 (000000a4) NAME: CALIBRATE^B^A^A^A TYPE: 4A VALUE: 00000110 (000000dc) NAME: CALIBRATE_RESULT^B^A^A^A TYPE: 4A VALUE: 00000184 (00000150) NAME: LOOP^B^A^A^A TYPE: 4A VALUE: 000001F0 (000001bc) NAME: ADC TYPE: 4A VALUE: 00000208 (000001d4) NAME: ADC_RET TYPE: 4A VALUE: 0000020C (000001d8) NAME: CAPS TYPE: 4A VALUE: 00000218 (000001e4) NAME: CAPS_RET TYPE: 4A VALUE: 0000021C (000001e8) NAME: CRIT_ENABLE TYPE: 4A VALUE: 00000228 (000001f4) NAME: CRIT_ENABLE_RET TYPE: 4A VALUE: 0000022C (000001f8) NAME: CRIT_DISABLE TYPE: 4A VALUE: 00000230 (000001fc) NAME: CRIT_DISABLE_RET TYPE: 4A VALUE: 00000234 (00000200) NAME: ALERT_ENABLE TYPE: 4A VALUE: 00000240 (0000020c) NAME: ALERT_ENABLE_RET TYPE: 4A VALUE: 00000244 (00000210) NAME: ALERT_DISABLE TYPE: 4A VALUE: 00000248 (00000214) NAME: ALERT_DISABLE_RET TYPE: 4A VALUE: 0000024C (00000218) NAME: MULTIPLY TYPE: 4A VALUE: 00000258 (00000224) NAME: LOOP^O^A^A^A TYPE: 4A VALUE: 00000264 (00000230) NAME: MULTIPLY_RET TYPE: 4A VALUE: 00000268 (00000234) NAME: DIVIDE TYPE: 4A VALUE: 00000270 (0000023c) NAME: LOOP^Q^A^A^A TYPE: 4A VALUE: 0000027C (00000248) NAME: DIVIDE_RET TYPE: 4A VALUE: 00000280 (0000024c) NAME: MASK_ADC_OUT TYPE: 4A VALUE: 00000284 (00000250) NAME: MASK_ADC_CALIB TYPE: 4A VALUE: 00000288 (00000254) NAME: MASK_QUOT TYPE: 4A VALUE: 0000028C (00000258) NAME: RANGE TYPE: 4A VALUE: 00000290 (0000025c) NAME: T_START TYPE: 4A VALUE: 00000294 (00000260) NAME: T_CHARGE TYPE: 4A VALUE: 00000298 (00000264) NAME: VAL_VCC TYPE: 4A VALUE: 0000029C (00000268) NAME: VAL_MV_CRIT TYPE: 4A VALUE: 000002A0 (0000026c) NAME: VAL_MV_ALERT TYPE: 4A VALUE: 000002A4 (00000270) NAME: VAL_MV_GOOD TYPE: 4A VALUE: 000002A8 (00000274) NAME: VAL_TRUE TYPE: 4A VALUE: 000002AC (00000278) NAME: VAL_FALSE TYPE: 4B VALUE: 000002B0 (0000027c) NAME: P_STACK TYPE: 4B VALUE: 000002B0 (00000280) NAME: P TYPE: 4B VALUE: 000002B0 (00000284) NAME: P_RESULT TYPE: 4B VALUE: 000002B0 (00000288) NAME: P_PIN_CRIT TYPE: 4B VALUE: 000002B0 (0000028c) NAME: P_PIN_ALERT TYPE: 4B VALUE: 000002B0 (00000290) NAME: P_PINCTRL_CRIT TYPE: 4B VALUE: 000002B0 (00000294) NAME: P_PINCTRL_ALERT TYPE: 4B VALUE: 000002B0 (00000298) NAME: P_FLAGS TYPE: 4B VALUE: 000002B0 (0000029c) NAME: P_RANGE TYPE: 4B VALUE: 000002B0 (000002a0) NAME: P_RESULT_CRIT TYPE: 4B VALUE: 000002B0 (000002a4) NAME: P_RESULT_ALERT TYPE: 4B VALUE: 000002B0 (000002a8) NAME: P_RESULT_GOOD TYPE: 4B VALUE: 000002B0 (000002ac) NAME: MASK_CRIT TYPE: 4B VALUE: 000002B0 (000002b0) NAME: MASK_ALERT TYPE: 4B VALUE: 000002B0 (000002b4) NAME: T_NEXT TYPE: 4B VALUE: 000002B0 (000002b8) NAME: T_DELTA TYPE: 4B VALUE: 000002B0 (000002bc) NAME: T_ACQUISITION TYPE: 4B VALUE: 000002B0 (000002c0) NAME: ACC TYPE: 4B VALUE: 000002B0 (000002c4) NAME: LOWPOINT TYPE: 4B VALUE: 000002B0 (000002c8) NAME: RESULT_CRIT TYPE: 4B VALUE: 000002B0 (000002cc) NAME: RESULT_ALERT TYPE: 4B VALUE: 000002B0 (000002d0) NAME: RESULT_GOOD TYPE: 4B VALUE: 000002B0 (000002d4) NAME: X TYPE: 4B VALUE: 000002B0 (000002d8) NAME: Y TYPE: 4B VALUE: 000002B0 (000002dc) NAME: BITS TYPE: 4E VALUE: 00000004 (00000000) NAME: CFGBOARD TYPE: 4E VALUE: 00000008 (00000000) NAME: PIN_CRIT TYPE: 4E VALUE: 0000000C (00000000) NAME: PIN_ALERT TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000004 (00000000) NAME: CTRL TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000004 (00000000) NAME: CTRL TYPE: 4E VALUE: 00000000 (00000000) NAME: R TYPE: 4E VALUE: 00000000 (00000000) NAME: R Distilled longs: 0 OBJ bytes: 1416 _CLKMODE: 00 _CLKFREQ: 00B71B00 0000- 24 00 3C 04 1C 03 0C 01 B0 02 00 00 CF 02 00 00 $.<............. 0010- D5 02 00 00 DA 02 00 00 E4 02 00 00 EA 02 00 00 ................ 0020- F2 02 00 00 FD 02 00 00 03 03 00 00 0B 03 00 00 ................ 0030- 16 03 00 00 1C 03 24 00 F0 3F BD A0 9F 40 BD A0 ......$..?...@.. 0040- A0 42 BD A0 A0 44 BD A0 04 40 FD 80 A0 46 BD A0 .B...D...@...F.. 0050- 04 40 FD 80 A0 48 BD A0 04 40 FD 80 A0 4A BD A0 .@...H...@...J.. 0060- 04 40 FD 80 A0 4C BD A0 04 40 FD 80 A0 4E BD A0 .@...L...@...N.. 0070- 04 40 FD 80 A0 50 BD A0 04 40 FD 80 A0 52 BD A0 .@...P...@...R.. 0080- 04 40 FD 80 A0 54 BD A0 A2 6A BD 08 9D 6A 3D 86 .@...T...j...j=. 0090- B5 56 A9 A0 01 60 D5 A0 B5 60 95 2C B0 56 95 A0 .V...`...`.,.V.. 00A0- A3 6A BD 08 9D 6A 3D 86 B5 58 A9 A0 01 60 D5 A0 .j...j=..X...`.. 00B0- B5 60 95 2C B0 58 95 A0 01 F4 FF A0 19 F0 FF 50 .`.,.X.........P 00C0- 1B F0 FF 54 48 F0 FF 58 93 EC BF 68 97 5E BD A0 ...TH..X...h.^.. 00D0- 97 5C BD A0 01 5C FD 28 94 EC BF 68 94 E8 BF 64 .\...\.(...h...d 00E0- 76 F2 FC 5C 6F EA FC 5C B0 62 BD A0 94 E8 BF 68 v..\o..\.b.....h 00F0- 76 F2 FC 5C 6F EA FC 5C B1 60 BD 84 96 60 3D 87 v..\o..\.`...`=. 0100- 37 00 68 5C AE 5E BD 94 01 5C FD 2A 29 00 54 5C 7.h\.^...\.*).T\ 0110- B0 2C BD A0 A7 2C 3D 08 94 EC BF 64 B0 6A BD A0 .,...,=....d.j.. 0120- 9A 6C BD A0 86 18 FD 5C B6 6A BD A0 99 6C BD A0 .l.....\.j...l.. 0130- 8D 24 FD 5C 95 6A BD 60 B5 64 BD A0 A8 6A 3D 08 .$.\.j.`.d...j=. 0140- B0 6A BD A0 9B 6C BD A0 86 18 FD 5C B6 6A BD A0 .j...l.....\.j.. 0150- 99 6C BD A0 8D 24 FD 5C 95 6A BD 60 B5 66 BD A0 .l...$.\.j.`.f.. 0160- A9 6A 3D 08 B0 6A BD A0 9C 6C BD A0 86 18 FD 5C .j=..j...l.....\ 0170- B6 6A BD A0 99 6C BD A0 8D 24 FD 5C 95 6A BD 60 .j...l...$.\.j.` 0180- B5 68 BD A0 AA 6A 3D 08 6F EA FC 5C B1 60 BD 84 .h...j=.o..\.`.. 0190- 96 60 BD 44 00 60 FD 40 A1 60 3D 08 A6 6A BD 08 .`.D.`.@.`=..j.. 01A0- B2 60 3D 85 04 6A F1 68 04 6A CD 64 B3 60 3D 85 .`=..j.h.j.d.`=. 01B0- 02 6A F1 68 02 6A CD 64 B4 60 3D 85 01 6A CD 68 .j.h.j.d.`=..j.h 01C0- 01 6A F1 64 A6 6A 3D 08 9D 56 3D 86 A4 6A 95 08 .j.d.j=..V=..j.. 01D0- 01 6A D5 29 7A FA D0 5C 7E FE C4 5C 9D 58 3D 86 .j.)z..\~..\.X=. 01E0- A5 6A 95 08 01 6A D5 29 80 06 D1 5C 84 0A C5 5C .j...j.)...\...\ 01F0- 54 00 7C 5C F1 5B BD A0 10 5A FD 80 AF 5A BD F8 T.|\.[...Z...Z.. 0200- FC 61 BD A4 00 5A FD F8 FC 61 BD 80 00 00 7C 5C .a...Z...a....|\ 0210- F1 5B BD A0 98 5A BD 80 00 5A FD F8 00 00 7C 5C .[...Z...Z....|\ 0220- B2 60 3D 85 AB E8 BF 70 AB EC BF 68 00 00 7C 5C .`=....p...h..|\ 0230- AB EC BF 64 00 00 7C 5C B3 60 3D 85 AC E8 BF 70 ...d..|\.`=....p 0240- AC EC BF 68 00 00 7C 5C AC EC BF 64 00 00 7C 5C ...h..|\...d..|\ 0250- 10 6A FD 2C 10 6E FD A0 01 6C FD 29 B5 6C B1 81 .j.,.n...l.).l.. 0260- 01 6C FD 31 89 6E FD E4 00 00 7C 5C 0F 6C FD 2C .l.1.n....|\.l., 0270- 10 6E FD A0 B6 6A BD E1 01 6A FD 34 8F 6E FD E4 .n...j...j.4.n.. 0280- 00 00 7C 5C 00 00 00 08 00 00 00 04 FF FF 00 00 ..|\............ 0290- DE 03 00 00 00 04 00 00 40 9C 00 00 E4 0C 00 00 ........@....... 02A0- 60 09 00 00 8C 0A 00 00 B2 0C 00 00 FF FF FF FF `............... 02B0- 00 00 00 00 43 35 38 09 1A 43 6B 37 00 1E 01 35 ....C58..Ck7...5 02C0- 05 09 01 35 05 06 00 64 06 0C 05 0A 05 34 C7 34 ...5...d.....4.4 02D0- 43 2C 32 43 38 05 D0 61 32 43 35 D0 33 32 43 37 C,2C8..a2C5.32C7 02E0- 01 D0 36 E8 35 FB 61 32 43 37 02 D0 61 32 64 35 ..6.5.a2C7..a2d5 02F0- FB 43 37 21 D1 32 43 37 01 D0 37 00 E8 35 FB 61 .C7!.2C7..7..5.a 0300- 32 43 37 22 D0 61 32 64 35 FB 43 37 00 D1 32 43 2C7".a2d5.C7..2C 0310- 37 01 D0 37 01 E8 35 FB 61 32 43 38 06 D0 61 32 7..7..5.a2C8..a2 0320- 20 01 0D 00 34 00 00 00 3E 00 00 00 59 00 00 00 ...4...>...Y... 0330- 61 00 00 00 73 00 00 00 83 00 00 00 98 00 00 00 a...s........... 0340- AD 00 00 00 C9 00 00 00 DF 00 00 00 0D 01 00 00 ................ 0350- 16 01 00 00 38 09 3D 92 35 FB 61 62 47 32 38 17 ....8.=.5.abG28. 0360- 38 12 3E 92 E7 37 25 E8 61 37 00 62 43 38 11 37 8.>..7%.a7.bC8.7 0370- 03 3E 92 37 21 E8 62 4A 32 64 37 21 E8 36 EC 33 .>.7!.bJ2d7!.6.3 0380- 32 38 72 00 64 05 03 36 0D 04 38 0B 33 0C 37 03 28r.d..6..8.3.7. 0390- 33 0C 32 38 82 00 64 05 03 36 0D 03 34 33 0C 35 3.28..d..6..43.5 03A0- 33 0C 32 38 97 00 64 05 03 36 0D 08 64 37 06 E8 3.28..d..6..d7.. 03B0- 35 FB 33 0C 34 33 0C 32 38 AC 00 64 05 03 36 0D 5.3.43.28..d..6. 03C0- 08 64 37 05 E8 35 FB 33 0C 35 33 0C 32 38 C8 00 .d7..5.3.53.28.. 03D0- 64 05 03 36 0D 0E 64 37 03 E8 0A 04 35 33 04 03 d..6..d7....53.. 03E0- 37 21 33 0C 37 21 33 0C 32 38 DE 00 64 05 03 36 7!3.7!3.28..d..6 03F0- 0D 09 64 38 0C E8 37 00 E2 33 0C 36 33 0C 32 39 ..d8..7..3.63.29 0400- 01 0C 00 64 05 03 36 0D 1D 39 01 05 64 37 04 E8 ...d..6..9..d7.. 0410- 38 05 E2 35 0D 04 36 0D 07 0C 3A 01 C2 00 33 0C 8..5..6...:...3. 0420- 39 E1 00 33 0C 0C 3A 01 C2 00 33 0C 32 64 3D D4 9..3..:...3.2d=. 0430- 1C 64 3D D6 1C 32 64 3D D4 18 64 3D D6 1C 32 00 .d=..2d=..d=..2. 0440- D0 4D 56 5F 56 43 43 10 E4 0C 00 00 4D 56 5F 47 .MV_VCC.....MV_G 0450- 4F 4F 44 10 B2 0C 00 00 4D 56 5F 41 4C 45 52 54 OOD.....MV_ALERT 0460- 10 8C 0A 00 00 4D 56 5F 43 52 49 54 49 43 41 4C .....MV_CRITICAL 0470- 10 60 09 00 00 42 49 54 5F 47 4F 4F 44 10 01 00 .`...BIT_GOOD... 0480- 00 00 42 49 54 5F 41 4C 45 52 54 10 02 00 00 00 ..BIT_ALERT..... 0490- 42 49 54 5F 43 52 49 54 49 43 41 4C 10 04 00 00 BIT_CRITICAL.... 04A0- 00 41 44 43 5F 53 54 41 52 54 54 49 4D 45 10 00 .ADC_STARTTIME.. 04B0- 04 00 00 41 44 43 5F 52 41 4E 47 45 49 4E 49 54 ...ADC_RANGEINIT 04C0- 10 DE 03 00 00 41 44 43 5F 43 48 41 52 47 45 54 .....ADC_CHARGET 04D0- 49 4D 45 10 40 9C 00 00 47 4F 03 47 45 54 5F 52 IME.@...GO.GET_R 04E0- 41 4E 47 45 00 47 45 54 5F 52 45 53 55 4C 54 00 ANGE.GET_RESULT. 04F0- 47 45 54 5F 46 4C 41 47 5F 47 4F 4F 44 00 47 45 GET_FLAG_GOOD.GE 0500- 54 5F 52 45 53 55 4C 54 5F 47 4F 4F 44 00 41 4C T_RESULT_GOOD.AL 0510- 45 52 54 01 47 45 54 5F 46 4C 41 47 5F 41 4C 45 ERT.GET_FLAG_ALE 0520- 52 54 00 47 45 54 5F 52 45 53 55 4C 54 5F 41 4C RT.GET_RESULT_AL 0530- 45 52 54 00 43 52 49 54 49 43 41 4C 01 47 45 54 ERT.CRITICAL.GET 0540- 5F 46 4C 41 47 5F 43 52 49 54 49 43 41 4C 00 47 _FLAG_CRITICAL.G 0550- 45 54 5F 52 45 53 55 4C 54 5F 43 52 49 54 49 43 ET_RESULT_CRITIC 0560- 41 4C 00 41 44 43 5F 49 4E 10 19 00 00 00 41 44 AL.ADC_IN.....AD 0570- 43 5F 4F 55 54 10 1B 00 00 00 41 44 43 5F 43 41 C_OUT.....ADC_CA 0580- 4C 49 42 10 1A 00 00 00 LIB..... ______________________________________________________________________________ ********************************************************* File starts here *** Zerocat Chipflasher --- Flash free firmware, kick the Management Engine. Copyright (C) 2020, 2021, 2022 Kai Mertens File ADC-monitor.spin --- Watch sigma-delta analog to digital conversion. This file is part of Zerocat Chipflasher. See end of file for terms of use. ****************************************************************************** # Object Summary Object "../../firmware2/src/ADC-monitor" Interface: PUB go(cfgboard, pin_crit, pin_alert) PUB get_range : PUB get_result : PUB get_flag_good : PUB get_result_good : PUB alert(ctrl) PUB get_flag_alert : PUB get_result_alert : PUB critical(ctrl) PUB get_flag_critical : PUB get_result_critical : Program: 271 Longs Variable: 9 Longs # Objects Load pin configuration object. # Constants Monitor Settings for Vcc_SPI @ ADC_IN Nominal Voltage is needed for internal calculations. MV_VCC --- Vcc value in Millivolts Once SPI bus power is suspended, turn back and resume when a good level is established again. MV_GOOD --- low limit in Millivolts for good Driving an SPI chip should be done within specs, that is with 2.7 to 3.3 Volts. MV_ALERT --- low limit in Millivolts for alert Flashing a ThinkPad T60/MX still works fine around 2350mV. Let us set this voltage as critical limit. Update: Readout without Vcc_SPI suspend fails on T60/MX25L1605D, letM-bM-^@M-^?s rise critical threshold to err out after a while. MV_CRITICAL --- low limit in Millivolts for critical ADC Settings ADC_IN --- counter input pin for sigma-delta ADC ADC_OUT --- counter feedback pin for sigma-delta ADC ADC_CALIB --- calibration pin, providing 0V and Vcc ADC_STARTTIME --- initial time over which to accumulate counts, power-of-two ADC_RANGEINIT --- initial range ADC_CHARGETIME --- allow caps to charge/discharge # Variables stack[] --- provide some stack space # Functions ______________________________________ PUB go(cfgboard, pin_crit, pin_alert) Launch PASM code into new cog: MonitorADC_PASM Pin pin_crit will be switched on if ADC result trips below limiting critical value. Set pin_crit to TRUE if no pin in use. Pin pin_alert will be switched on if ADC result trips below limiting alert value. Set pin_alert to TRUE if no pin in use. On startup, driving the pins is disabled. Drivers are to set explicitly via alert() and critical(). _________________ PUB get_range : Get range value. __________________ PUB get_result : Get calibrated ADC result. _____________________ PUB get_flag_good : Get value of flag_good, TRUE or FALSE. _______________________ PUB get_result_good : Get limiting ADC value for good action. ________________ PUB alert(ctrl) Enable (TRUE) or disable (FALSE) pin_alert driver. FALSE will set the pin tristate. ______________________ PUB get_flag_alert : Get value of flag_alert, TRUE or FALSE. ________________________ PUB get_result_alert : Get limiting ADC value for alert action. ___________________ PUB critical(ctrl) Enable (TRUE) or disable (FALSE) pin_crit driver. FALSE will set the pin tristate. _________________________ PUB get_flag_critical : Get value of flag_crit, TRUE or FALSE. TRUE requires immediate action! ___________________________ PUB get_result_critical : Get value of limiting ADC value for critical action. # PASM/Data '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' MonitorADC_PASM --- PASM code entry This code is inspired by Parallax Manuals and Application Notes: * AN001-P8X32ACounters-v2.0.pdf: figure 14 * AN008-SigmaDeltaADC-v1.0.pdf: figure 6, listing2 * P8X32A-Web-PropellerManual-v1.2.pdf: Math Samples Parameter: * stack[8] --- calculated, limiting ADC value for good * stack[7] --- calculated, limiting ADC value for alert * stack[6] --- calculated, limiting ADC value for critical * stack[5] --- calculated range value * stack[4] --- value of flags, TRUE or FALSE * stack[3] --- control pin_alert, direction register value * stack[2] --- control pin_crit, direction register value * stack[1] --- pin_alert * stack[0] --- pin_crit / calibrated result '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' adc --- get raw ADC value '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' caps --- Wait for t_charge to pass, allow capacitors to charge/discharge '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' crit_enable --- update output latch, enable direction register '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' crit_disable --- clear direction register, set pin tristate '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' alert_enable --- update output latch, enable direction register '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' alert_disable --- clear direction register, set pin tristate '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Multiply * multiplies x[15..0] by y[15..0] * y[31..16] must be zero * returns product in y[31..0] '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Divide * divides x[31..0] by y[15..0] * y[16] must be zero * returns quotient in x[15..0] * returns remainder in x[31..16] '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Named registers, initialized mask_ADC_OUT mask_ADC_CALIB mask_quot range --- intended ADC range, will be trimmed during calibration t_start --- initial acquisition time, power-of-two t_charge val_VCC val_mv_crit val_mv_alert val_mv_good val_true val_false '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Named registers, reserved space, not initialized p_stack --- stack base address p --- pointer into stack p_result --- will point to stack[0], calibrated ADC result p_pin_crit --- will point to stack[0], critical pin p_pin_alert --- will point to stack[1], alert pin p_pinctrl_crit --- pointer into stack, will point to stack[2], direction value for critical pin p_pinctrl_alert --- pointer into stack, will point to stack[3], direction value for alert pin p_flags --- pointer into stack, will point to stack[4] p_range --- pointer into stack, will point to stack[5] p_result_crit --- pointer into stack, will point to stack[6] p_result_alert --- pointer into stack, will point to stack[7] p_result_good --- pointer into stack, will point to stack[8] t_next --- time variable, used for waitcnt t_delta --- delta acquisition time, used during calibration t_acquisition --- acquisition time, trimmed during calibration acc --- general-purpose register lowpoint --- ADC raw value for low endpoint result_crit --- trigger value for critical flag result_alert --- trigger value for alert pin result_good --- trigger value for alert pin x --- used by math operations / general-purpose register y --- used by math operations bits --- used by math operations ****************************************************************************** Terms of Use: Zerocat Chipflasher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zerocat Chipflasher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Zerocat Chipflasher. If not, see <http://www.gnu.org/licenses/>. ************************************************************** End of File ***