MATCH_L[n] / CAP_L[n] @ 0x5000_4180-- MATCH_H[n] / CAP_H[n] @ 0x5000_41c0-- MATCHREL_L[n] / CAPCTRL_L[n] @ 0x5000_4280-- MATCHREL_H[n] / CAPCTRL_H[n] @ 0x5000_42c0-- |
<<< L-counter - generates plain pulses >>> <<< H-counter - counts number of pulses >>> <<< >>> <<< to count number of pulses, H-counter is: >>> <<< started at L-counter== m >>> <<< stopped at L-counter==(m+1) >>> <<< >>> <<< Halt both H- and L-counter when H-counter >>> <<< reaches required count: n >>> |
CTRL_U:00020000 COUNT_U:00020005 OUTPUT:00 <<< L==5 -> ev0 (limit-L) ^^^ CLK ^^^ CTRL_U:00020000 COUNT_U:00020000 OUTPUT:01 <<< L cleared ^^^ CLK ^^^ CTRL_U:00020000 COUNT_U:00020001 OUTPUT:01 ^^^ CLK ^^^ CTRL_U:00020000 COUNT_U:00020002 OUTPUT:01 <<< L==2 -> ev1 (run-H) <<< (*1) ^^^ CLK ^^^ CTRL_U:00000004 COUNT_U:00030003 OUTPUT:00 <<< L halted but H is run (*2) <<< L==3 but halted, no event will occur ^^^ CLK ^^^ CTRL_U:00000004 COUNT_U:00040003 OUTPUT:00 ^^^ CLK ^^^ CTRL_U:00000004 COUNT_U:00050003 OUTPUT:00 (*1) H==2 but H is stopped at here, so event cannot be generated, I think. But after next clock, L is halted. so ev5 (H==2) must be generated by some "look-ahead-run-status" (next_state_is_run). (*2) From the priority of conflict actions by my examination, it is natural that HALT is ignored for H counter if it is stopped. |
sct_reset_peri() sctimer_init() <<<< with CTRCLR >>>> ---------- go(2) <<<< without CTRCLR >>>> n = 2 CLKs: 12MHz/12MHz LPC_SCT 00000184 =CONFIG 00C00080 =CTRL_U <<<< prescale: H=1/7, L=1/5, both run <<<<< snipped >>>>> IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:1/7, L:1/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:2/7, L:2/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:3/7, L:3/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:4/7, L:4/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:5/7, L:5/5++ IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:6/7, L:1/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:7/7++, L:2/5 IN0:00 CTRL_U:00C00080 COUNT_U:04570124 ^^^ CLK ^^^ <<< H:1/7, L:3/5 IN0:00 CTRL_U:00C00080 COUNT_U:04570124 sct_stop() <<<< once stop >>>> ---------- go(2) <<<< run again without CTRCLR >>>> <<<<< snipped >>>>> IN0:00 CTRL_U:00C00080 COUNT_U:04560123 <<< counter is re-writed ^^^ CLK ^^^ <<< H:2/7, L:4/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560123 ^^^ CLK ^^^ <<< H:3/7, L:5/5++ IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:4/7, L:1/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:5/7, L:2/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:6/7, L:3/5 IN0:00 CTRL_U:00C00080 COUNT_U:04560124 ^^^ CLK ^^^ <<< H:7/7++, L:4/5 IN0:00 CTRL_U:00C00080 COUNT_U:04570124 ^^^ CLK ^^^ <<< H:1/7, L:5/5++ IN0:00 CTRL_U:00C00080 COUNT_U:04570125 ^^^ CLK ^^^ <<< H:2/7, L:1/5 IN0:00 CTRL_U:00C00080 COUNT_U:04570125 |
<<<< HALT + STOP + START >>>> IN0:00 CTRL_U:00020000 COUNT_U:00000000 ^^^ CLK ^^^ IN0:00 CTRL_U:00020000 COUNT_U:00000001 ^^^ CLK ^^^ IN0:00 CTRL_U:00020000 COUNT_U:00000002 <<< match! ^^^ CLK ^^^ IN0:00 CTRL_U:00000004 COUNT_U:00010003 <<< H started, L halted ^^^ CLK ^^^ IN0:00 CTRL_U:00000004 COUNT_U:00020003 |
(High side) (Low side) ---+---------------------+--------------------+--------------------- n | EVENTs (CONFLICT) | while "stop"ped | while "run"ning ---+---------------------+--------------------+--------------------- 1 | START | "run" with count | keep "run" 2 | STOP | keep "stop" | "stop" after count 3 | STOP + START | "run" with count | "stop" after count 4 | HALT | keep "stop" | "halt" after count 5 | HALT + START | "run" with count | "halt" after count 6 | HALT + STOP | keep "stop" | "halt" after count 7 | HALT + STOP + START | "run" with count | "halt" after count ---+---------------------+--------------------+--------------------- |
FILES 00README.txt --- this file Makefile --- Makefile for make.exe link.awk --- a AWK script to generate linker script Startup.S --- CPU start up main.c --- main entry common.h --- system shared difinitions common.c --- system shared functions (uart) rprintf.c --- simple printf() (from sample of WinARM_20060606.zip) sct_test.c --- a console to evaluate SCT test-NNN.hex --- a hex file image made zz-result.txt --- evaluation result log (with comments) My LPC810 is: /* * +------------+ * | LPC810 | * ) P M021F | * ) X 1M28603 | * | N +D3414C | ... year 3, week 41, '4C' ver.13.4 * +------------+ * | Dev.ID: 0x00008100 * | B.L.Ver: 13.4 <-- by FlashMagic */ And referecing: /* * UM10601: LPC81x User manual Rev.1.6 * LPC81xM: Product data sheet Rev.4.3 * lpcopen_2_01_lpcxpresso_nxp_lpcxpresso_812.zip */ |