Rev. 1.00
10�
��ne ��� �01�
Rev. 1.00
103
��ne ��� �01�
HT66FM5440
Brushless DC Motor A/D Flash MCU
HT66FM5440
Brushless DC Motor A/D Flash MCU
Controlling the power on/off function of the A/D converter circuitry is implemented using the
ADOFF bit in the ADCR0 register. This bit must be cleared to power on the A/D converter. When
the ADOFF bit is cleared to power on the A/D converter internal circuitry, a certain delay as
indicated in the timing diagram, must be allowed before an A/D conversion is initiated. Even if
no pins are selected for use as A/D inputs, if the ADOFF bit is low, then some power will still be
consumed. In power conscious applications it is therefore recommended that the ADOFF is set high
to reduce power consumption when the A/D converter function is not being used.
The boundary register pairs, ADHVDH/ADHVDL and ADLVDH/ADLVDL contain preset values
which can be compared with the converted values of OPA0O, OPA1O and OPA2O that are stored
in ADRH/ADRL registers or ISRHn/ISRLn registers. Various types of comparisons can be made as
defined by the ADCLVE and ADCHVE bits and an interrupt will be generated to inform the system
that either the lower or higher boundary has been execeeded. This function can be used to ensure
that the motor current operates within safe working limits.
Summary of A/D Conversion Steps
ADSTR Triggered A/D Conversion Steps
The following summarises the individual steps that should be executed in order to implement an
ADSTR triggered A/D conversion process.
• Step 1
Select the required A/D conversion clock by correctly programming bits ADCK2~ADCK0 in the
ADCR1 register.
• Step 2
Enable the A/D converter by clearing the ADOFF bit in the ADCR0 register to zero.
• Step 3
Select which signal is to be connected to the internal A/D converter by correctly configuring the
ACS3~ACS0 bits in the ADCR0 register. If external channel ANn is selected, its bypass unity-
gain buffer function can be enabled or disabled by correctly configuring the ADBYPS register
according to application requirements.
• Step 4
Select which pin is to be used as A/D input and configure it by correctly programming the
corresponding bit in the pin-shared control register.
• Step 5
Select A/D converter resolution and data format by setting the ADCRL_SEL bit in the ADCR2
register and the ADRFS bit in the ADCR0 register.
• Step 6
If A/D conversion interrupt is used, the interrupt control registers must be correctly configured
to ensure the A/D interrupt function is active. The master interrupt control bit, EMI, the A/D
conversion interrupt control bit, AEOCE, and the associated interrupt priority control bit, Int_
prinE, must all be set high in advance.
• Step 7
The A/D conversion procedure can now be initialised by setting the ADSTR bit from low to high
and then low again. Note that this bit should have been originally cleared to zero.
• Step 8
If A/D conversion is in progress, the EOCB flag will be set high. After the A/D conversion
process is complete, the EOCB flag will go low and then the output data can be read from ADRH
and ADRL registers.
Note: When checking for the end of the conversion process, if the method of polling the EOCB bit
in the ADCR0 register is used, the interrupt enable step above can be omitted.