Rev. 1.00
6�
��ne ��� �01�
Rev. 1.00
63
��ne ��� �01�
HT66FM5440
Brushless DC Motor A/D Flash MCU
HT66FM5440
Brushless DC Motor A/D Flash MCU
Programming Considerations
The TM Counter Registers and the Capture/Compare CCRA, CCRB and CCR
P
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, CCRB and CCRP registers are 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, CCRB and CCRP low byte
registers, named PTMnAL, PTMnBL and PTMnRPL, using the following access procedures.
Accessing the CCRA, CCRB or CCRP low byte registers without following these access procedures
will result in unpredictable values.
Data B�s
�-bit B�ffer
PTMnDH
PTMnDL
PTMnAH/
PTMnBH
PTMnAL/
PTMnBL
PTMn Co�nter Register (Read only)
PTMn CCRA/CCRB Register (Read/Write)
PTMnRPH
PTMnRPL
PTMn CCRP Register (Read/Write)
The following steps show the read and write procedures:
• Writing Data to CCRA, CCRB or CCR
P
♦
Step 1. Write data to Low Byte PTMnAL, PTMnBL or PTMnRPL
– Note that here data is only written to the 8-bit buffer.
♦
Step 2. Write data to High Byte PTMnAH , PTMnBH or PTMnRPH
– 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 CCRA, CCRB or CCR
P
♦
Step 1. Read data from the High Byte PTMnDH, PTMnAH , PTMnBH or PTMnRPH
– 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 PTMnDL, PTMnAL , PTMnBL or PTMnRPL
– This step reads data from the 8-bit buffer.