《飞思卡尔hc12系类ad转换模块讲解》由会员分享,可在线阅读,更多相关《飞思卡尔hc12系类ad转换模块讲解(16页珍藏版)》请在金锄头文库上搜索。
1、Freescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.TMFreescale HCS12 微控制器微控制器微控制器微控制器TMFr
2、eescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 1Internal BusSCI 1256K FLASEEPROM1
3、2K SRAMATD 1Star12 CPUBKP INT MMICM BDM MEBI4K BYTES EEPROMSIM msCAN 3msCAN 2msCAN 1SCI 1SPI 2 or PWM CH 4-7BDLC or msCAN 0msCAN 4 or IICSPI 1 or PWM CH 0-3SPI 0ATD 0PIM PLL PITECT 8 CHANPWM 8 CHANA/D转换模块转换模块转换模块转换模块TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and th
4、e Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 2AD转换模块转换模块转换模块转换模块特点特点特点特点:8/10 位精度位精度位精度位精度 7 us, 10-位单次转换时间位单次转换时间位单次转换时间位单次转换时间. 采样缓冲放大器采样缓冲放大器采样缓冲放大器采样缓冲放大器
5、可编程采样时间可编程采样时间可编程采样时间可编程采样时间 左左左左/右右右右 对齐对齐对齐对齐, 有符号有符号有符号有符号/无符号结果数据无符号结果数据无符号结果数据无符号结果数据 外部触发控制外部触发控制外部触发控制外部触发控制 转换完成中断转换完成中断转换完成中断转换完成中断 模拟输入模拟输入模拟输入模拟输入8通道复用通道复用通道复用通道复用 模拟模拟模拟模拟/数字输入引脚复用数字输入引脚复用数字输入引脚复用数字输入引脚复用 1到到到到8转换序列长度转换序列长度转换序列长度转换序列长度 连续转换模式连续转换模式连续转换模式连续转换模式 多通道扫描方式多通道扫描方式多通道扫描方式多通道扫描方
6、式TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 3A/D 寄存器寄存器寄存器寄存器转换结果寄存器转换结果寄
7、存器转换结果寄存器转换结果寄存器控制寄存器控制寄存器控制寄存器控制寄存器状态寄存器状态寄存器状态寄存器状态寄存器TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semic
8、onductor, Inc. 2005.Slide 4Address offset $0002A/D 控制寄存器控制寄存器控制寄存器控制寄存器2ADPU - A/D 电源使能/禁止 1 = A/D模块上电 0 = 禁止A/D,以减少功耗AFFC - A/D 快速转换完成标志位清零 1 = 快速标志位清零顺序每次读取结果寄存器自动清零 0 = 正常标志位清零顺序需要手动对状态标志位清零AWAI - A/D 等待模式 1 = 等待模式下,转换 0 = 等待模式下,禁止转换ASCIE - A/D 顺序完成中断使能ASCIF - A/D 顺序完成标志位高电平触发,每次触发,执行连续转换X111低电平触
9、发,每次触发,执行连续转换X101上升沿触发,每次触发,执行一次转换X110下降沿触发,每次触发,执行一次转换X100忽略外部触发,执行连续转换后10xx忽略外部触发,执行一次转换后停止00xx描述SCANETRIGEETRIGPETRIGLEATDCTRL2TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or
10、service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 5FRZResponse00Ignore IFREEZE01Reserved10Finish conversion, then freeze11Freeze ImmediatelyAddress offset $0003转换序列长度转换序列长度转换序列长度转换序列长度FIFO 结果寄存器 FIFO 1 = 结果寄存器没有映射到转换序列 0 = 结果寄存器没有映射到转换序列A/D 控制寄存器控制寄存
11、器控制寄存器控制寄存器3ATDCTRL3转换序列长度就是需要转换的通道数转换序列长度就是需要转换的通道数转换序列长度就是需要转换的通道数转换序列长度就是需要转换的通道数 比如: 通道0,1,2作为AD采集通道 则转换序列为3,即S2C=1,S1C=1 在控制寄存器5 ATD0CTL5中: 设CC CB CA = 0 0 0,转换序列从通 道0开始;ATD0DR0, ATD0DR1,ATD0DR2存放转换结果 设CC CB CA = 0 1 0,转换序列从通 道2开始。 仍然是ATD0DR0, ATD0DR1,ATD0DR2存放转换结果TMFreescale Semiconductor Conf
12、idential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 65位 模数计数器预分频器 - 由A/D控制寄存器中的PRS4:0控制 - 分频系数从2到64 - 如果 PRS4:0
13、= 0, 预分频不起作用注: 设置PRS4:0时, A/D Clock 不能大于 2 MHz. 最大最大最大最大 A/D 时钟时钟时钟时钟 = 2.0 MHz (最小最小最小最小 A/D CLOCK = 0.5 MHz)ATDCTL4(HI) - A/D 控制寄存器控制寄存器控制寄存器控制寄存器SRES8 - A/D 精度选择精度选择精度选择精度选择 1 = 8 位位位位 0 = 10位位位位采样时间选择采样时间选择采样时间选择采样时间选择Address offset $0004A/D 时钟选择时钟选择时钟选择时钟选择/ 预分频预分频预分频预分频除除除除25位位位位 模数计数器模数计数器模数计
14、数器模数计数器 预分频器预分频器预分频器预分频器PRS0-PRS4系统时钟系统时钟系统时钟系统时钟A/D 时钟时钟时钟时钟16 A/D时钟周期118 A/D时钟周期104 A/D时钟周期012 A/D时钟周期00采样时间采样时间采样时间采样时间SMP 1:0TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or s
15、ervice names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 7转换时间转换时间转换时间转换时间A/D 时钟2, 4, 8, 16 时钟周期总是2 个 时钟周期转换时间计算举例:(假设 2MHZ A/D 时钟频率)例 1: 转换时间 = Initial Sample Time + Programmed Sample Time + Resolution Period = 2 + 2 + 10 = 14 A/D Clocks = 7uSec 例 2: 转换时间=
16、Initial Sample Time + Programmed Sample Time + Resolution Period = 2 + 16 + 10 = 28 A/D Clocks = 14uSecCCF标志位置位,如果在8通道模式下,序列结束TMFreescale Semiconductor Confidential and Proprietary Information. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005.Slide 8SCAN