Chapter 14A/D ConverterOperation XIV - 37When the timer 12 operation is started, A/D conversion is started every 1 ms. When A/D conversion is completedwith channel 0 and 1, the AD0 complete interrupt is generated.Figure:14.3.8 A/D Conversion Timing (0 to 2 Channel Converted Once Each)(13) Set the timer 12: Select the timer compare/capture A operation modeTM12MDA(0x0000A284)bp7-6: TMAM1-0=00(13) Set the compare register (double buffer) to the functionof the timer 12 compare/capture register by theTMAM1-0 flags of the timer 12 compare/capture Amode register (TM12MDA).(14) Set the timer 12: Initialize the timer 12TM12MD(0x0000A280)bp6: TMLDE=1(14) Set the TMLDE flag of the TM11MD register to “1” toinitialize the timer 12. The value of the compareregister buffer is loaded into the TM12CA register.Reset the TMLDE flag to “0” after setting.(15) Set the timer 12: Start the timer operationTM12MD(0x0000A280)bp7: TMCNE=1(15) Set the TMCNE flag of the TM12MD register to “1” tooperate the timer 8.(16) Set the AD0: Read the A/D valueAN0BUF00 (0x0000A410)AN0BUF01 (0x0000A414)AN0BUF02 (0x0000A418)(16) A/D0 conversion data buffer 0 and 1 (ANOBUF0,ANOBUF1) are read by the AD0 complete interruptprocessing after A/D conversion ends .Setup Procedure DescriptionExternal trigger(TM12 compare a match)Conversion operationInterrupt ch0 ch1 ch2 ch0 ch1 ch2