Rev. 1.10
62
November 04, 2019
Rev. 1.10
63
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
Programming Considerations
The TM Counter Registers and the Capture/Compare CCRA registers, all have a low and high byte
structure. The high bytes can be directly accessed, but as the low bytes can only be accessed via an
internal 8-bit buffer, reading or writing to these register pairs must be carried out in a specific way.
The important point to note is that data transfer to and from the 8-bit buffer and its related low byte
only takes place when a write or read operation to its corresponding high byte is executed.
As the CCRA register is implemented in the way shown in the following diagram and accessing
these register pairs is carried out in a specific way as described above, it is recommended to use the
"MOV" instruction to access the CCRA low byte registers, named xTMAL, using the following
access procedures. Accessing the CCRA low byte register without following these access procedures
will result in unpredictable values.
Data Bus
8-bit Buffer
xTMAH
xTMAL
xTM Counter Register (Read only)
xTM CCRA Register (Read/Write)
xTMDH
xTMDL
The following steps show the read and write procedures:
•
Writing Data to CCRA
♦
Step 1. Write data to Low Byte xTMAL
– Note that here data is only written to the 8-bit buffer.
♦
Step 2. Write data to High Byte xTMAH
– Here data is written directly to the high byte registers and simultaneously data is latched
from the 8-bit buffer to the Low Byte registers.
•
Reading Data from the Counter Registers and or CCRA
♦
Step 1. Read data from the High Byte xTMDH or xTMAH
– Here data is read directly from the High Byte registers and simultaneously data is latched
from the Low Byte register into the 8-bit buffer.
♦
Step 2. Read data from the Low Byte xTMDL or xTMAL
– This step reads data from the 8-bit buffer.