Rev. 1.00
104
��ne ��� �01�
Rev. 1.00
105
��ne ��� �01�
HT66FM5440
Brushless DC Motor A/D Flash MCU
HT66FM5440
Brushless DC Motor A/D Flash MCU
• 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, t
he A/D
conversion interrupt control bit, ISAEOCE, and the associated interrupt priority control bit, Int_
prinE, must all be set high in advance.
• Step 7
After the A/D conversion p
rocess is complete, the ISEOCB flag will go high and then the output
data can be read from ISRHn and ISRLn registers. After reading the converted results, the
ISEOCB bit should be cleared to zero by application program.
Note: When checking for the end of the conversion process, if the method of polling the ISEOCB bit
in the ADCR2 register is used, the interrupt enable step above can be omitted.
Considerations for simutaniously using both trigger methods
ADSTR
EOCB
PWM Duty 3 trigger
ADDL=3
ISEOCB
1 2 3 4 5
…
10
1234567.....19
ADOFF=0
ACS=000(AN0)
DLSTR=1
ADIS0=0110(OPA0)
PWIS=1
PWDIS=11(PWM Duty 3)
1. AN ch select by ACS(AN0)
ADC result will save to
ADRH/ADRL
4. ADC result will save to
ISRH0/ISRL0
ADDL=3
S/W setup :
7. AN switch to AN1
(select by ADIS3)
ISEOCB = 1
by H/W
ADRE
IOEOCB, ADRE =1
by H/W
ADIS1=0100(OPA2)
ADIS2=0101(OPA1)
ADIS3=0001(AN1)
3. AN switch to OPA2
(select by ADIS1)
2. AN switch to OPA0
(select by ADIS0)
6. ADC result will
save to ISRH1/ISRL1
5. AN switch to OPA1
(select by ADIS2)
8. ADC result will save to
ISRH2/ISRL2
9.AN switch back to AN0
ISEOCB = 0
by S/W
ISAEOCF
ISAEOCF = 1
by H/W
ADCH_SEL=4
10.ADC result will save to
ISRH3/ISRL3
Forced_STR
1234567.....19
1234567.....19
1234567.....19
IOEOCB
IOEOCB = 0
by H/W
ADCRL_SEL=0
A/D Convertion Timing for Two Trigger Modes