![FTDI FT51A Скачать руководство пользователя страница 87](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158087.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
86
Copyright © 2015 Future Technology Devices International Limited
2.10.9
ADC Programming Flow
Single Sample
Write to the appropriate mode register (AIO_MODE_0, AIO_MODE_1, AIO_MODE_2,
AIO_MODE_3) to select ADC mode (see AIO_MODE Control AIO_0_MODE to
AIO_15_MODE for more details)
Enable the corresponding interrupt bit in the AIO_INTERRUPT_ENABLES_0_7 or
AIO_INTERRUPT_ENABLES_8_15 registers
Assert the corresponding Sample bit in the (AIO_SAMPLE_0, AIO_SAMPLE_1) registers
Wait for the corresponding interrupt bit to be set to indicate that the conversion is
complete (AIO_INTERRUPTS_0_7 or AIO_INTERRUPTS_8_15 registers)
Read digital data (10 bits) from the appropriate AIO_ADC_DATA registers and remove the
lower 2 bits.
Global Sample
(see Global Mode for more details)
Write to the AIO_GLOBAL_CTRL registers to select which cells are to be included in global
sample
Write to the appropriate mode register (AIO_MODE_0, AIO_MODE_1, AIO_MODE_2,
AIO_MODE_3) to select ADC mode (see AIO_MODE Control AIO_0_MODE to
AIO_15_MODE for more details)
Enable the global_sample_int interrupt with global_sample_int_en in register
AIO_GLOBAL_CTRL
Enable the global_update_int interrupt with global_update_int_en in register
AIO_GLOBAL_CTRL
To initiate a global sample, set the Global_Sample bit in the AIO_GLOBAL_CTRL register
Once all ports included in the global list have completed their conversions, the
global_sample_int bit will be set in the AIO_GLOBAL_CTRL register.
The result for each ADC port will be stored in a holding register until the Global_Update bit
is asserted in the AIO_GLOBAL_CTRL register. At which point the contents of all ADC port
holding registers will be transferred into the ADC Data Register
When the global_update_int bit is set in the AIO_GLOBAL_CTRL register, the ADC result
can be read from the corresponding AIO_ADC_DATA registers.