TOP

In AD application, what should be paid attention to?

black_text">1. After AD enabled, delay 200uS or more to wait ADC circuit ready for conversion. 
2. After AD channel switched, delay 200uS or more to wait ADC circuit ready for conversion. 
3. It is proposed to filter AD sampling data first and then do data processing in other ways. 
4. In program initialization, it is advised to enable ADC and start ADC conversion timely. (As example shows below) 
For example: start an ADC conversion every 1ms. 
Sys_Int:

:; In program initial process, start ADC conversion.
:
movA, #00h; set ADC mode
:
b0bsetFADENB; Enable ADC circuit

Sys_Init90: 
                        ret

ADC_Convert:

b0bts1f_time_1ms; to determine whether reached 1ms.
jmpADC_Convert900
b0bclrf_time_1ms; 1ms time arrived, start ADC conversion.
b0bsetFADS

ADC_Convert10:

b0bts1FEOC
jmpADC_Convert10
b0bclrFEOC
movA, ADB
movADC_buf1, A
movA, ADM
movADC_buf2, A; save data after ADC conversion
b0bclrFCHS2
b0bclrFCHS1
b0bclrFCHS0; switch ADC channel and preparation for next ADC conversion.

ADC_Convert90: 
                        ret