SN8P26L38
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 91
Version 1.5
The T1 16-bit counter buffer is T1CH and T1CL combination. System provides a routine to process the 16-bit data
buffer under 8-bit situation to make high/low bytes of 16-bit data processed at the same time. T1CH register is the key
to control the T1 16-bit counter buffer processed through T1CH, T1CL buffers. Export T1C 16-bit buffer data to T1CH,
T1CL registers is by reading T1CH register. Import T1C 16-bit buffer data from T1CH, T1CL registers is by writing
T1CH register after setting T1CL register data.
Example: Reading T1C 16-bit buffer data is controlled by reading T1CH register. Read T1CH register data
and low byte data of T1C 16-bit buffer exporting to T1CL register at the same time.
B0MOV
A, T1CH
; Read T1CH first and T1C low byte data exported to T1CL.
…
B0MOV
A, T1CL
; Read T1CL data from buffer.
…
Note: Read T1CH first when reading T1C 16-bit buffer.
Example: Writing and setting T1C 16-bit buffer data is controlled by writing data into T1CH register. When
writing T1CH register data, T1CH, T1CL data are imported into T1C 16-bit buffer at the same time. Setting
T1CL register data first is necessary, or the T1C low byte data would be error.
…
B0MOV
T1CL, A
; Write T1CL data into T1CL buffer first.
…
B0MOV
T1CH, A
; Write T1CH data and T1CH, T1CL are imported to T1C
; 16-bit buffer.
Note: Write T1CL first when writing T1C 16-bit buffer.
Example: Write T1CL is by write T1CH. Only executing
“CLR T1CL” and no do any T1CH writing operation
can
’t clear T1CL buffer. Clear T1CL must be using “MOV” instruction as following.
MOV
A, #0
B0MOV
T1CL, A
; Write
“0” into T1CL to clear T1CL.
…
B0MOV
T1CH, A
; Write T1CH data and T1CH, T1CL are imported to T1C
; 16-bit buffer.
Note: Don
’t clear T1CL by “CLR” instruction.