Analog-to-Digital Converter (ADC)
MC56F8346 ADC 学习
两个ADC:ADCA,ADCB
ADC特点:
- 12位转换精度
- 最大5MHZ的时钟频率,周期200ns
- 每秒可以有1.66 million samples
- 第一个采样转换时间conversion time 是8.5 ADC clock cycles ,8.5×200ns=1.7us
- 以后的采样转换时间只要6个ADC时钟,
- Simultaneous mode下 26.5 ADC clock cycles,26.5×200ns=5.3us, 8个转换
- ADC可以和PWM、TMR同步
- Simultaneous or sequential sampling with additional text
- 可以同时采样和保持两路输入
- 可以连续扫描和保存多达8个测量值
- Internally multiplex to select two of eight inputs
- Power savings modes允许自动关闭和开启所有或者部分ADC功能
- Built-in calibration using on-chip input voltage network
- Unselected inputs tolerate injected/sourced current without affecting ADC performance,
supporting operation in noisy industrial environments. See data sheet’s ADC Parameters
table for more information on current limits. - Optional interrupts at the end of a scan, if an out-of-range limit is exceeded, (high or low)
or at zero crossing - Optional sample correction by subtracting a pre-programmed offset value
- Signed or unsigned result
- Single ended or differential inputs for all input pins with support for an arbitrary mix of
input types

上图中包括 一个八通道输入eight-channel input,
两个独立的采样保持电路 Sample and Hold(S/H)circuits.
两个分离的转换器将结果保存在缓冲区。
转换过程的初始化可以通过:SYNC信号,上升沿,来自定时器通道
在8346中是TimerC channels 2 and 3,
也可以通过对ADC Control Register(ADCR1)START 位写1来实现。
SYNC 信号的上升沿或者START 位的置1都会开始一个转换序列或者说一个扫描。
可以采样和转换多达8个 single ended channels, 4 differential channel pairs,
或者其它的组合。
ADC可以配置成一个单独的扫描和停止,一旦触发(trigger)就开始扫描,或者一直按程序编写的
扫描直到通过STOP位来停止。
Dual ADC 可以配置成 sequential or simultaneous 转换。
sequential:多达8个channel,single ended, 可以以任意顺序采样和保存,
通过Channel List register来设置。ADLST1 and ADLST2
如下图:

根据ANAn inputs的多少,两个ADC可能都需要。
simultaneous:

采样保持电路(S/H circuits)在同一时刻capture 两个不同的通道。
在扫描结束时可以选择中断,
如果一个通道超过范围,溢出了(measures below the low threshold limit or above the high
threshold limit set in the limit registers)或者在过零点 zero crossing时,
都可以产生中断。
要理解和操作ADC,必须了解各个功能部分的特点和限制(features and limitations)
Input MUX Function
这个MUX 能够获得eight single ended inputs,将它们提供给ADC转换的两个任意输出通道。
当然这两个输出的通道不能同时选上一个输入,否则转换精度受到影响。
四个不同的mode以及相关的限制如下:
1.MUXing for Sequential,Single Ended Mode Conversions
Figure 2-3 AN0-3对应ADC0, AN4-7对应ADC1,
输出到 Offset,Limit,Result registers。
(VREFH-VREFLO)/2 for the differential input to both ADCs.
2.MUXing for Sequential,Differential Mode Conversions,
even number input routed to the ADC input
odd number input used as the differential input to the ADC.
3.MUXing for Simultaneous,Single Ended Mode Conversions.
any input can be used by ADC0,
any other input can be selected for use by ADC1.
(VREFH-VREFLO)/2for the differential input to both ADCs.
4.MuXing for Simultaneous,Differential Mode Conversions.
AN0和AN2作为ADC0的输入,AN1和AN3分别作为differential input.
AN4-AN7到ADC1。
Popularity: 17% [?]
Tags: BLDCRelated posts



