概 述

Size: px
Start display at page:

Download "概 述"

Transcription

1 Astro II 数据手册 1.0 Capital microelectronics, Inc. Web: Page 1 of 100

2 目录 1 概述 FPGA 特性 FPGA 概述 现场可编程逻辑 绕线资源 嵌入式存储器模块 EMB9K emb9k_tdp emb9k_sdp emb9k_sp I/O I/O 特性 I/O 描述 时钟网络 时钟网络通路 PLL PLL 接口 PLL 属性 MSS 子系统 CPU 寻址方式 指令集 寻址方式助记 按功能划分的指令集 十六进制编码排序指令 读 - 改 - 写指令 扩展指令 指令周期计算 存储器 内存和 SFR RAM 存储器 存储 Banking 外部存储器接口 (EMIF) 特殊功能寄存器 (SFRs) SFR 存储单元 SFR 复位值 SFR 说明 (1) 累加器 -ACC Web: Page 2 of 100

3 (2) B 寄存器 -B (3) 程序状态寄存器 -PSW (4) 堆栈指针 -SP (5) 数据指针 -DPH,DPL (6) 数据指针选择寄存器 -DPS (7) 数据指针 1 DPH1,DPL (8) 端口 P0,P1,P2,P (9) 程序存储页面寄存器 PAGESEL (10) 数据存储页面寄存器 D_PAGESEL (11) 定时 / 计数器控制寄存器 TCON (12) 定时器模式寄存器 TMOD (13) 定时器 0 TH0,TL (14) 定时器 1 TH1,TL (15) 定时器 2 控制寄存器 T2CON (16) 定时器 2 TH2,TL (17) 比较 / 捕获功能配置寄存器 CCEN (18) 比较 / 捕获寄存器 CC1,CC2,CC (19) 比较 / 重装入 / 捕获寄存器 CRCH,CRCL (20) 串口 0 控制寄存器 S0CON (21) 串口 0 数据缓冲寄存器 S0BUF (22) 串口 0 重装入寄存器 S0RELH,S0RELL (23) 串口 1 控制寄存器 S1CON (24) 串口 1 数据缓冲 S1BUF (25) 串口 1 重装入寄存器 S1RELH,S1RELL (26) 看门狗重装入寄存器 WDTREL (27) 中断允许寄存器 0 IEN (28) 中断允许寄存器 1 IEN (29) 中断允许寄存器 2 IEN (30) 中断优先级寄存器 IP0,IP (31) 中断请求控制寄存器 IRCON (32) 电源控制寄存器 PCON (33) 时钟控制寄存器 CKCON (34) 串口 0 波特率选择寄存器 ADCON (35) 乘法 / 除法寄存器 MD0,MD1,MD2,MD3,MD4,MD (36) 算术控制寄存器 ARCON (37) I 2 C 数据寄存器 I2CDAT (38) I 2 C 地址寄存器 I2CADR (39) I 2 C 控制寄存器 I2CCON Web: Page 3 of 100

4 (40) I 2 C 状态寄存器 I2CSTA (41) SPI 串口外设状态寄存器 SPSTA (42) SPI 串行外设控制寄存器 SPCON (43) SPI 串行外设数据寄存器 SPDAT (44) SPI 串行外设从选择寄存器 SPSSN (45) 软件复位寄存器 SRST 扩展特殊功能寄存器 乘 - 除单元 MDU 概述 MDU 操作说明 (1) 装载 mdx 寄存器 (2) 执行计算 (3) 从 mdx 寄存器中读取结果 (4) 规格化 (5) 移位 (6) mdef 标志 (arcon,7- 表 3-37 ARCON 寄存器 ) (7) mdov 标志 (arcon.6- 表 3-37 ARCON 寄存器 ) 中断控制器 中断源 (1) 外部中断 0 和 (2) 外部中断 (3) 外部中断 (4) 外部中断 (5) 外部中断 (6) 外部中断 (7) 外部中断 (8) 定时器中断 (9) 串口中断 (10) 使能 / 禁用位 中断优先级 中断源概要 定时器 定时器 (1) 概述 (2) 功能方式 (3) 说明 定时器 (1) 概述 Web: Page 4 of 100

5 (2) 功能方式 (3) 说明 定时器 2( 带有比较 / 捕获单元 ) (1) 概述 (2) 定时器 2 说明 (3) 比较功能说明 看门狗 (1) 概述 (2) 说明 I 2 C I 2 C 概述 说明 (1) 操作模式 (2) 仲裁 (3) 串行时钟生成器 (4) 地址比较器 (5) 特殊功能寄存器 SPI 概述 说明 (1) 特殊功能寄存器 (2) TR 块 (3) 中断生成 UART UART (1) UART0 操作模式 (2) UART0 多处理器通信 UART (1) UART1 运行模式 (2) UART1 多处理器通信 P 端口 概述 端口引脚的多路复用 电源管理 节电方式 退出节电方式 MSS 系统控制 MSS 系统时钟电源管理 Web: Page 5 of 100

6 (1) PLL 操作 (2) clkcpu clkout0 clkout1 clkout2 操作 (3) Fabric 的 gclk 门控操作 MSS SPI 操作 MSS I 2 C I/O 设置 MSS 在系统重配置 MSS 在系统更新 实例化 宏模块端口列表 配置 配置模式 AS 模式 PS 模式 JTAG 模式 非易失性存储器 ISC 安全 配置数据加密 FLASH 的操作控制 AstroⅡ 上电复位 电气特性 LVCMOS33 D.C. 规格 LVTTL33 D.C. 规格 引脚及封装 引脚定义 引脚列表 TQFP-100 封装引脚列表 LQFP-144 封装引脚列表 封装信息 开发工具 商务指南 AstroⅡ 系列产品列表 产品命名规则 Web: Page 6 of 100

7 Legend ALU AS CCU CMS CPU DMS DPRAM EMB IAP I2C ISC ISP ISR LSB MDU MOVC MOVX MSB MSS OCDS OCI PMU PS RTC SFR SPI UMS Arithmetic-Logic Unit Active Serial Compare Capture Unit Control Mux Switch Control Processor Unit Down Mux Switch Dual Port RAM Embedded Memory Block In Application Programming Inter-IC a serial interface designed by Philips Semiconductors In System Configuration In System Programming Interrupt Service Routine unit Least Significant Bit Multiplication-Division Unit Move Program Memory Move External Memory Most Significant Bit Microcontroller Subsystem On-Chip Debug Support On-Chip Instrumentations Power Management Unit Passive Serial Real Time Clock Special Function Register Serial Peripheral Interface Up Mux Switch Web: Page 7 of 100

8 1 概述 AstroⅡ 是一款集成了增强型 8051 处理器硬核和 FPGA 等资源于一体智能型器件, 能够实现完全可定制系统设计和 IP 保护能力, 而且易于使用 设计者可以便捷地利用 Capital Microelectronics 的 Primace 进行 FPGA 设计, 支持第三方 EDA 工具 Keil TM 进行嵌入式设计 AstroⅡ 的单芯片系统比传统专属功能微控制器具有更大的灵活性 比现有使用软核处理器的 FPGA 具有更低的成本 AstroⅡ 的 ISP 功能可以实现在系统更新配置镜像,ISC 功能可以实现在系统用其他配置镜像重新配置 AstroⅡ Astro Ⅱ 系列产品广泛应用于工业 医疗设备 通信系统和消费类电子等多种应用领域 现场可编程门阵列 (FPGA) 基于 SRAM 的 0.13 微米工艺 FPGA Fabric - 4 输入查找表 + 基于 DFF 的可编程逻辑单元 LC 个可编程逻辑单元 - 专用的算术进位链 - 层次化结构布线资源 嵌入式 RAM Block 存储器 - 2x9Kbit 可配置双端口 DPRAM 存储器 EMB9K 时钟网络 - 8 个 De-skew 全局时钟 - 1 个支持频率合成 相移 De-skew 的 PLL( 输入时钟频率范围 :5~350MHz 输出时钟频率范围 :10~350MHz) - 4 个外部时钟输入 1 个外部振荡反馈时钟输入 I/O 和操作电压 - 3.3V LVCMOS/LVTTL - 支持 5V 输入 - 最高可达 150MHz - I/O 属性可编程 - 3.3VI/O 电压 1.2V 内核电压 微控制子系统 (MSS) 增强型 8051MCU - 精简指令周期,12 倍于标准 8051 的 MIPS, 频率最高可达 150MHz - 兼容标准 8051 的指令系统 - 硬件支持乘法 除法指令 - 支持扩展指令 :MOV A,ACC - 支持 16 位乘法 32/16 位除法硬件 - 片上调试系统 OCDS, 支持 JTAG 在线调试 - 8 个外部中断源, 总共 13 个中断源 - 支持高达 8M 数据 / 代码存储器 嵌入式 SRAM 存储器 - 32KByte 单端口存储器 SPRAM - 4KByte 双端口 DPRAM(Fabric 连 B 端口,MSS 连 A 端口 ) Web: Page 8 of 100

9 - 数据 / 代码统一编址 存储大小灵活配置 外设 - 3 个 16 定时时器, 定时器 2 可用作比较捕获单元 - 1 个 16 位硬件看门狗 - 1 个 I 2 C 接口 - 1 个 SPI 接口, 可控制 4 个从设备 - 2 个全双工异步串行接口 停止 空闲模式电源管理 芯片系统管理 - ISC 控制 - ISP 控制 - 系统动态频率切换 - 系统动态 PLL 控制 - 系统 FPGA 时钟关断控制 AstroⅡ 配置 配置模式 - JTAG 模式 - AS 模式 - PS 模式 JTAG 接口 - JTAG 芯片配置 - JTAG 8051 调试 - 芯片配置 8051 调试共用同一 JTAG 支持多映像配置文件 可选 4Mbit 内部 SPI-FLASH ISC 安全机制 - 配置文件数据加密 - 基于密钥的 SPI 操作保护 - 访问保护机制 - 配置 memory 1 保护 1 Memory 包括 MSS 8051 的 RAM code Web: Page 9 of 100

10 表 1-1 AstroII 系列产品列表 AstroⅡ 系列产品列表 AstroⅡ AS2E5F1KAL144 AS2E5F1KL144 AS2E5F1KAT100 AS2E5F1KT100 封装 LQFP144 LQFP144 TQFP100 TQFP100 FPGA LC Fabric RAM Blocks MSS 16 位定时器 存储器 32K+4KByte 32K+4KByte 32K+4KByte 32K+4KByte 16 位看门狗 I 2 C 接口 SPI 接口 全双工异步串 行接口 SPI Flash 4Mbit 4Mbit I/Os 速度 工业等级 商业 (0,+70 ) 商业 (0,+70 ) 商业 (0,+70 ) 商业 (0,+70 ) 工业 (-40,+85 ) 工业 (-40,+85 ) AstroⅡ 系统示意图 图 1-1 AstroII 系统示意图 Web: Page 10 of 100

11 2 FPGA 特性 2.1 FPGA 概述 图 2-1 FPGA 概况显示了 AstroⅡ 的整个 FPGA 的结构 嵌入式存储器模块 EMB9K 内嵌在 Fabric 中, MSS GCLK 时钟网络以及 IOB 等通过绕线资源联到 Fabric 上 图中的 连接 表示绕线资源 I/O Blocks (IOB) BLB array I/O Blocks (IOB) EMB9K EMB9K MSS, GCLK, I/O Blocks I/O Blocks(IOB) 图 2-1 FPGA 概况 FPGA Fabric 的基本模块是 BLB(Basic Logic Block) 64 个 BLB 阵列, 分四个层次通过上下绕线资源和和跨层次的进位链资源连接成整个 FPGA Fabric 16 个逻辑单元 LC(Logic Cell) 组成一个 BLB, 也即 HLB1,4 个 HLB1 组合为一个 HLB2 同理,4 个 HLB2 组合成 1 个 HLB3 AstroⅡ 包含 4 个 HLB3, 可以视为一个 HLB4, 共计 1024 个逻辑单元 (64 个 BLB) AstroⅡ 四周分布 IOB I/O 块 (I/O Block), 它们通过交叉互联线与 FPGA 逻辑阵列相连接 芯片的左边有 7 个 IOB, 其余三边都有 8 个 IOB 每个 IOB 包含 4 个 IOC(I/O Cell)I/O 单元 2.2 现场可编程逻辑现场可编程逻辑单元 (LC) 作为现场可编程块 ( 图 2-2) 中最小的单元, 有如下特征 : 一个 4 输入查找表可以实现四个变量的任何逻辑功能 进位链的特点可以用于加法器 / 减法器 或非门链和 WLUT 链可以扩展 LUT 功能 一个可编程寄存器 支持寄存器反馈回 LUT Web: Page 11 of 100

12 图 2-2 现场可编程逻辑单元 图 2-3 显示 LC 的串联 进位链经由进位链输入输出信号串联在一起 与非门链经由 lutin 和 lutout 串联 ;WLUT 链经由 wlutin 和 wlutout 串联 图 2-3 进位链,NOR 链和 WLUT 链 基本逻辑单元块 (BLB) 是由 16 个 LC 和 BLB_ctrl 块组成的 BLB_ctrl 为 16 个逻辑单元提供 : clk,cen,rstn 和 sload, 四个公用信号 图 2-4 描述了 BLB 的构造 Web: Page 12 of 100

13 图 2-4 BLB 和 LC 2.3 绕线资源 绕线资源是由一个以四叉树方式绕线多路复用结构和交联绕线结构组成的 分层四叉树绕线资源为所有 BLB 提供充足的绕线路径, 其中 BLB 是树的最小节点并且包含 16 个 LC 交联绕线资源在 BLB 之间提供快捷的绕线路径 图 2-5 描述了简化的交联绕线资源和分层绕线资源 图 2-5 绕线资源 2.4 嵌入式存储器模块 EMB9K AstroⅡ 中共 2 个 EMB9K 块 EMB9K 模块是一个同步真双端口存储器, 具有如下特征 : 9,216 bits 混合时钟方式 支持字节使能写端口数据宽度为 8,9,16,18,32 或 36 位时,EMB9K 支持字节写操作 字节使能允许 Web: Page 13 of 100

14 屏蔽输入数据, 这样 EMB9K 可以写入特定字节 未写入的字节保持之前写入的值 表 2-1 支持字节的 EMB9K 块 we [3..0] d [15..0] d [17..0] d [31..0] d [35..0] [0] = 1 [7..0] [8..0] [7..0] [8..0] [1] = 1 [15..8] [17..9] [15..8] [17..9] [2] = 1 [23..16] [26..18] [3] = 1 [31..24] [35..27] 奇偶校验位 - 支持奇偶校验码 EMB9K 支持每字节一个奇偶校验位 奇偶校验位和内部逻辑单元一起, 可以执行奇偶校验以确保数 据的完整 也可使用校验位大小的数据字存储用户定义的控制位 A B 数据宽度可独立配置 支持直通或寄存器读输出 直通读 (( 同步 1 clock): 在读有效的情况下, 读的数据在同一个时钟周期里驱动到读数据总线 q 上 寄存器读 (( 同步 2 clock): 在读有效的情况下, 内部读的数据在下一个时钟周期里放到输出寄存 器里并驱动到读数据总线 q 上 通过设置 output_mode, 可以选取直通读模式或寄存器读模式 在寄存器读模式下, 可通过 is_clk_qx_inverted 参数来选择时钟上升沿读或时钟下降沿读 支持初始化 初始化文件格式为.hex 或.dat( 每行一个 16 进制数, 行数为 EMB9K 的深度 ) 初始化文件在配置 过程中初始化 EMB9K 的存储器 Memory 模式 依据应用模式可配置成如下几种模式 : - emb9k_tdp - emb9k_sdp - emb9k_sp 在 emb9k_tdp emb9k_sdp 模式下不能同时读写同一个地址 emb9k_tdp EMB9K 支持任何组合的双端口操作 : 不同的端口时钟下的两端口读, 两端口写, 或一端口读一端口写 图 2-6 显示了真双端口存储配置 Web: Page 14 of 100

15 图 2-6 真双端口存储方式 表 2-2 真双端口存储方式端口描述 Port name Type Description aa (b) Input Port A (B) Address. da (b) Input Port A (B) Data Input. qa (b) Output Port A (B) Data Output. wea (b) Input Port A (B) Write Enable. Data is written into the dual-port SRAM upon the rising edge of the clock when both wea (b) and cea (b) are high. cea (b) Input Port A (B) Enable. When cea (b) is high and wea (b) is low, data read from the dual-port SRAM address aa (b). If cea (b) is low, qa (b) retains its value. clka (b) Input Port Clock. rstn_qa (b) input read register reset,low active clke_qa (b) input read clock enable,high active 表 2-3 真双端口存储器方式直通模式下的真值表 Inputs Outputs cea(b) wea (b) clk Status qa (b) 0 X X HOLD Data stored in the memory is retained. 1 0 READ Data is read from the memory location specified by the address bus. 1 1 WRITE da (b) 表 2-4 真双端口可能的数据宽度组合 Port A Port B 8K 1 4K 2 2K 4 1K K 1 1K K 1 4K 2 Web: Page 15 of 100

16 Port A Port B 8K 1 4K 2 2K 4 1K K 1 1K K 4 1K K 1 1K emb9k_sdp 置 EMB9K 存储器也支持简单双端口存储方式 : 一端口读一端口写 图 2-7 显示了简单双端口存储配 图 2-7 简单双端口存储方式 表 2-5 简单双端口存储方式端口描述 Port name Type Description d_w Input Write Data a_w Input Write Address. we_w Input Write Enable,high active clk_w Input Write Clock. ce_w Input Write Port Enable. high active q_r Output Read Data a_r Input Read Address. ce_r Input Read Enable. high active clk_r Input Read Clock. rstn_r Input read register reset,low active clke_r Input read clock enable,high active 表 2-6 简单双端口数据宽度组合 Read Port Write 1K Port 8K 1 4K 2 2K K 1 9 K 1 1K Web: Page 16 of 100

17 Read Port Write 1K Port 8K 1 4K 2 2K K K 1 4K 2 2K 4 1K 9 1K K emb9k_sp EMB9K 存储块也支持单端口存储方式, 如下图 2-8 所示 : 图 2-8 单端口存储方式 表 2-7 单端口存储方式端口描述 Port name Type Description d Input Write Data a Input Write Address. we Input Write Enable,high active clk Input Write Clock. ce Input Port Enable. high active q Output Read Data rstn_r Input read register reset,low active clke_r Input read clock enable,high active 表 2-8 简单双端口可能的数据宽度组合 Port 8K 1 4K 2 2K 4 1K K 1 1K Web: Page 17 of 100

18 2.5 I/O I/O 特性 可承受 5V 输入 ; 支持 LVCMOS33/LVTTL33 I/O 标准 ; 独立三态输出控制 内部可编程上拉电阻 : 62~112 KΩ; I/O 驱动电流固定为 : 8mA; 支持异步直通输入输出 ; 支持同步输入输出 I/O 描述 结构 IOC 是 I/O 的最小基本单元, 一个 IOC 控制一个 I/O IOC 加上绕线资源组成 IOB0 下图描述了 IOB0 的 图 2-9 IOB0 结构 4 个 IOB0 和互联绕线资源 HSB1 组成一个 IOB1 下图描述了 IOB1 的结构 7 个 IOB1 控制 Astro Ⅱ 的左边 I/O, 其余三边各有 8 个 IOB1 Web: Page 18 of 100

19 xmo[19:10] xmo[9:0] xmi 20 gci 16 IOB1 xmo 10 xmo 10 xmi gci HSB1 umoi 10 XMS1 xmi gci CMS1 umo 10 mux4 UMS1 cmo 9 8 umi DMS1-0 umi DMS1-3 mux8 mux8 2 2 dmo dmo dmi0 dmi3 1 1 dmo0 dmo3 dmi 9 cmi umi IOB0-0 umo 2 9 umi cmi IOB0-3 umo 2 图 2-10 IOB1 结构 2.6 时钟网络 AstroⅡ 专用的全局时钟网络可以为 MSS 系统和 FPGA 的 fabric 提供灵活的低延迟 低抖动的时钟 时钟网络通路 图 2-11 描述的是 AstroⅡ 的全局时钟网络通路 pll_lock clk0 clk1 xin xout clk2 osc crysta l xc osc gclk[15:0] 0 xmi[7] xmi[6] xmi[5] xmi[4] xmi[3] xmi[2] xmi[1] xmi[0] CLK3 CLK2 CLK1 CLK mux fbclkin mux 20 xmi[7: 0] mux 8 pll_res et clkout clkin 0 clkout PLL-0 1 fbclkin clkout2 pll_lock SFR_pd SFR_pd_en pllout0 pllout1 pllout2 pll_lock 3 4 Clock mux Clock mux Clock mux SFR Clock mux mcu SFR clkcpu clkout2 clkout1 clkout0 clk3 CLK0 CLK1 CLK2 CLK3 CLK0 CLK1 CLK2 CLK3 图 2-11 全局时钟网络通路 AstroⅡ 有五个时钟输入引脚 :clk0, clk1, clk2,clk3 和 xin; 一个时钟输出引脚 :xout;1 个 PLL clk0,clk1,clk2,clk3 这四个引脚既可以作为全局时钟输入引脚, 也可以作为用户 I/O xin 和 xout 分别为外部晶体振荡器输入引脚和输出引脚,Xin 只能用作全局时钟输入引脚, 输入频率 10~20MHz 当 xin 作为外部时钟输入时, 输入时钟通过 xin 接入全局时钟树上,xout Web: Page 19 of 100

20 悬空 xin 与 clk1 不能同时用作全局时钟输入 OSC 为内部振荡器, 典型值为 15MHz, 随温度 电压变化而变化, 变化范围 :9~20MHz OSC 为 AS 配置提供时钟, 不推荐用户设计里使用 OSC AstroⅡ 的设计必须在 Primace 里用 PLL Wizard 例化 PLL 才能为 MSS 和 Fabric 提供时钟 PLL Wizard 中配置对应的 Clock mux 的值, 为 clkcpu 和 clkout0 clkout1 clkout2 选择全局时钟源 AstroⅡFabric 有 8 个全局时钟 clk0~clk3 和 clkcpu clkout0 clkout1 clkout2 都可以连到全局时钟总线上 PLL 的输入 clkin 可以来自外部 clk0~clk3 外部晶体以及 fabric,pll 的 de-skew 模式的反馈可以来自 Fabric 的 8 个全局时钟和 clk0~clk3 MSS 的 8051 可以通过扩展的 SFR 动态控制 PLL 的电源的关开 clkcpu 和 clkout0 clkout1 clkout2 PLL 输出关开以及分频, 详见 MSS 系统 PLL 图 2-12 PLL fref = fin / n; fvco = fref * m = fin * (m / n) ffb = fvco / m; fclkout0 = fvco / c0 = fin * (m / (n * c0)) fclkout1 = fvco / c1 = fin * (m / (n * c1)) fclkout2 = fvco / c2 = fin * (m / (n * c2)) VCO 输出为 300MHz~800MHz 输出占空比为:50%±5% PLL 使用 m/(n c) 换算频率, 为 PLL 输出端口提供时钟频率合成 输入时钟信号先被前置分频器 (pre-divider) 的系数 n 整除, 然后再与反馈环路分频器 (feedback-loop divider) 的系数 m 相乘 控制回路将 VCO 的输出信号频率与 fin (m/n) 进行匹配 输出级 C0,C1,C2 将高频 VCO 分频后输出 前置分频器 (pre-divider) 系数 n 的范围是 1 到 32 反馈环路分频器(feedback-loop divider) 的系数 m 的范围是 1 到 512 输出级分频器(post-scale divider) 的 c0/c1/c2 的范围是 1 到 32 Web: Page 20 of 100

21 2.6.3 PLL 接口 表 2-9 PLL 接口 Signal I/O Description clkin I Reference clock 5-350MHz fbclkin I Feedback clock: used in de-skew mode pll_reset I PLL reset: when reset = 1, PLL reset clkout0 O Main output clock 10~350Mhz support dynamic clock switch clkout1 O First shifted phase out clock 10~350Mhz Can run at different freq in synthesize mode support dynamic clock switch clkout2 O Second shifted phase out clock 10~350Mhz Can run at different freq in synthesize mode support dynamic clock switch pll_lock O PLL Lock status output. When pll_lock=1, PLL is in lock status clk_cpu O Mcu clock out 10~350Mhz, support dynamic clock switch PLL 属性 表 2-10 PLL 属性 Attribute Description Value pll_pwrmode pll_pwrmode =always_on, always power stream on(default) pll_pwrmode =comb, MCU and FP control mode enable pll_pwrmode =FP, FP control mode enable pll_pwrmode =MCU, MCU control mode enable pll_pwrmode = always_off, always power off pll_deskew pll_deskew=1,deskew mode enable pll_deskew=0, frequency synthesize,use VCO as feedback 0,1 pll_bypass pll_bypass=1,pass input reference clock to 0,1 clkout0/1/2 pll_o0en pll_o0en=1, enable individual clock output 0,1 clkout0 pll_o1en pll_o1en=1, enable individual clock output 0,1 clkout1 pll_o2en pll_o2en=1, enable individual clock output 0,1 clkout2 pll_ph1en pll_ph1en=1,phase shift mode enable for clock output clkout1 0,1 pll_ph2en pll_ph2en=1,phase shift mode enable for 0,1 Web: Page 21 of 100

22 clock output clkout2 pll_refdiv input divider 1:32 pll_fbdiv feedback divider 1:512 pll_odiv0 output divider for clock output clkout0 1:32 pll_odiv1 output divider for clock output clkout1 1:32 pll_odiv2 output divider for clock output clkout2 1:32 pll_phsel1 phase shift control for clock output clkout1 Accoreding to the value of pll_odiv1 pll_phsel2 phase shift control for clock output clkout2 Accoreding to the value of pll_odiv2 pll_fsl pll_fsl=1,link the phase shift between clkout0 and clkout1/ clkout2 0,1 clkcpu_mux Clkcpu_mux = in0, divider disable and clk stream source is clk_in0 (default) Clkcpu_mux = in1, divider disable and clk source is clk_in1 Clkcpu_mux = dyn, divider enable and clk source is dynamic Clkcpu_mux = dis, clk source is 0 clkcpu_in0 clkcpu_in0 = po0, select pllout0 (default) stream clkcpu_in0 = po1, select pllout1 clkcpu_in0 = po2, select pllout2 clkcpu_in1 clkcpu_in0 = ck0, select clk0 (default) clkcpu_in0 = ck1, select clk1 clkcpu_in0 = ck2 select clk2 clkcpu_in0 = ck3, select clk3 stream clkout0_mux clkout0_mux = in0, divider disable and clk stream source is clk_in0 (default) clkout0_mux = in1, divider disable and clk source is clk_in1 clkout0_mux = dyn, divider enable and clk source is dynamic clkout0_mux = dis, clk source is 0 clkout0_in0 clkout0_in0 = po0, select pllout0 (default) stream clkout0_in0 = po1, select pllout1 clkout0_in0 = po2, select pllout2 clkout0_in1 clkout0_in0 = ck0, select clk0 (default) clkout0_in0 = ck1, select clk1 clkout0_in0 = ck2, select clk2 clkout0_in0 = ck3, select clk3 stream clkout1_mux clkout1_mux = in0, divider disable and clk stream source is clk_in0 (default) Web: Page 22 of 100

23 clkout1_in0 clkout1_in1 clkout2_mux clkout2_in0 clkout2_in1 ck0_src ck1_src clkout1_mux = in1, divider disable and clk source is clk_in1 clkout1_mux = dyn, divider enable and clk source is dynamic clkout1_mux = dis, clk source is 0 clkout1_in0 = po1, select pllout1 (default) clkout1_in0 = po2, select pllout2 clkout1_in0 = po0, select pllout0 clkout1_in0 = ck0, select clk0 (default) clkout1_in0 = ck1, select clk1 clkout1_in0 = ck2, select clk2 clkout1_in0 = ck3, select clk3 clkout2_mux = in0, divider disable and clk source is clk_in0(default) clkout2_mux = in1, divider disable and clk source is clk_in1 clkout2_mux = dyn, divider enable and clk source is dynamic clkout2_mux = dis, clk source is 0 clkout2_in0 = po2, select pllout2 (default) clkout2_in0 = po0, select pllout0 clkout2_in0 = po1, select pllout1 clkout2_in0 = ck0, select clk0 (default) clkout2_in0 = ck1, select clk1 clkout2_in0 = ck2, select clk2 clkout2_in0 = ck3, select clk3 ck0_src=pad, select clk0 PAD as input(default) ck0_src=osc, select internal osc as input ck1_src=pad, select clk1 PAD as input ck1_src=xc, select crstral pin as input stream stream stream stream stream stream stream 3 MSS 子系统 MSS 子系统由 150MHz 增强型 8051 处理器 集成的外设和集成的 SRAM 组成 具有如下特征 : 增强型 8051MCU - 精简指令周期,12 倍于标准 8051 的 MIPS, 频率最高可达 150MHz - 兼容标准 8051 的指令系统 - 片上调试系统 (OCDS), 支持 JTAG 在线调试 - 支持高达 8M 数据 / 代码存储器 嵌入式 SRAM 存储器 - 32KByte 单端口存储器 SPRAM - 4KByte 双端口 DPRAM(Fabric 连 B 端口,8051 连 A 端口 ) - 数据 / 代码统一编址 存储大小灵活配置 外设 Web: Page 23 of 100

24 - 一个算术协处理器 MDU - 3 个 16 位定时器, 定时器 2 可用作比较捕获单元 - 1 个 16 位硬件看门狗 - 1 个 I 2 C 接口 - 1 个 SPI 接口 - 2 个全双工异步串行接口 停止 空闲模式电源管理 芯片系统管理 - ISC 控制 - IAP 控制 - 在系统动态频率切换 - 在系统动态 PLL 控制 - 在系统 FPGA 时钟关断控制 MSS 子系统的 EMIF P 端口 SPI 以及 DPRAM4K 的 B 端口连到了 FPGA 的 Fabric 上,I 2 C 和扩展的 SFR 连到了 AsrtoII 的硬件模块上 MSS 通过这些通路可以智能的控制 AsrtoⅡ 的运行 图 3-1 描述的是 MSS 系统的功能和连接关系 图 3-1 MSS 功能连接图 CPU AstroⅡ 使用单周期增强型 8051 CPU 作为中央处理器, 指令集与标准 ASM51 完全兼容 8051CPU 主要特性 : 精简指令周期,12 倍于标准 8051 的 MIPS, 频率最高可达 150MHz 兼容标准 8051 的指令系统 硬件支持乘法 除法指令 Web: Page 24 of 100

25 支持扩展指令 :MOV A,ACC 片上调试系统 (OCDS),JTAG 在线调试 支持 16 位乘法 32/16 位除法硬件 8 个外部中断源, 共计 13 个中断源 77 个 SFR 支持高达 8MB 程序 / 数据存储器 寻址方式 8051 支持的寻址方式如下表 3-1 所示表 3-1 寻址方式 Addressing Description mode Direct The operand is specified by a direct 8-bit address field. Only the Addressing internal RAM and the SFRs can be accessed using this mode. Indirect The instruction specifies the register which contains the address Addressing of the operand. The registers R0 or R1 are used to specify the 8-bit address, while the Data Pointer (DPTR) register is used to specify the 16-bit address. Register Certain instructions access one of the registers (R0-R7) in the Addressing specified register bank. These instructions are more efficient because there is no need for an address field. Register Some instructions are specific to certain registers. For example, Specific some instructions always act on the accumulator. In this case, Instructions there is no need to specify the operand. Immediate Some instructions carry the value of the constants directly Constants instead of an address. Indexed This type of addressing can be used only for a read of the Addressing program memory. This mode uses the Data Pointer as the base and the accumulator value as an offset to read a program memory. Bit Addressing In this mode, the operand is one of 256 bits 指令集 8051 指令与工业标准 8051 指令完全兼容 下面几个表为指令集, 包括寻址方式助记, 按功能划分的指令集和十六进制编码排序指令, 以及指令耗时计算 寻址方式助记 下面 2 个表 ( 表 3-2 和表 3-3) 描述了应用在指令集表中的助记 表 3-2 数据寻址方式助记 Symbol Rn Working register R0-R7 Description Web: Page 25 of 100

26 #data #data 16 bit A One of 128 internal RAM locations or any Special Function Register Indirect internal or external RAM location addressed by register R0 or R1 8-bit constant included in instruction (immediate operand) 16-bit constant included as bytes 2 and 3 of instruction (immediate operand) One of 128 software flags located in internal RAM, or any flag of bit- addressable Special Function Registers, including I/O pins and status word Accumulator 表 3-3 程序寻址方式助记 Symbol Description addr16 Destination address for LCALL or LJMP, can be anywhere within the 64-Kbyte page of program memory address space addr11 Destination address for ACALL or AJMP, within the same 2-Kbyte page of program memory as the first byte of the following instruction Rel SJMP and all conditional jumps include an 8-bit offset byte. Its range is +127/-128 bytes relative to the first byte of the following instruction 按功能划分的指令集 下表按照指令的功能进行分类, 描述了指令编码的十六进制格式, 每条指令占用的字节以及执行每 条指令所需的机器周期 需注意, 显示的周期数以无程序存储等待状态为前提 表 3-4 按功能划分的指令 Mnemonic Description Code Bytes Cycles Arithmetic operations ADD A,Rn Add register to accumulator 0x28-0x2F 1 2 ADD A,direct Add directly addressed data to accumulator 0x ADD A,@Ri Add indirectly addressed data to accumulator 0x26-0x ADD A,#data Add immediate data to accumulator 0x ADDC A,Rn Add register to accumulator with carry 0x38-0x3F 1 2 ADDC A,direct Add directly addressed data to accumulator 0x with carry ADDC A,@Ri Add indirectly addressed data to accumulator with carry 0x36-0x ADDC A,#data Add immediate data to accumulator with 0x carry SUBB A,Rn Subtract register from accumulator with borrow 0x98-0x9F 1 2 SUBB A,direct Subtract directly addressed data from 0x accumulator with borrow SUBB A,@Ri Subtract indirectly addressed data from 0x96-0x accumulator with borrow SUBB A,#data Subtract immediate data from accumulator 0x Web: Page 26 of 100

27 Mnemonic Description Code Bytes Cycles with borrow INC A Increment accumulator 0x INC Rn Increment register 0x08-0x0F 1 3 INC direct Increment directly addressed location 0x Increment indirectly addressed location 0x06-0x INC DPTR Increment data pointer 0xA3 1 1 DEC A Decrement accumulator 0x DEC Rn Decrement register 0x18-0x1F 1 3 DEC direct Decrement directly addressed location 0x Decrement indirectly addressed location 0x16-0x MUL AB Multiply A and B 0xA4 1 4 DIV Divide A by B 0x DA A Decimally adjust accumulator 0xD4 1 1 Logic operations ANL A,Rn AND register to accumulator 0x58-0x5F 1 2 ANL A,direct AND directly addressed data to accumulator 0x ANL A,@Ri AND indirectly addressed data to accumulator 0x56-0x ANL A,#data AND immediate data to accumulator 0x ANL direct,a AND accumulator to directly addressed 0x location ANL direct,#data AND immediate data to directly addressed 0x location ORL A,Rn OR register to accumulator 0x48-0x4F 1 2 ORL A,direct OR directly addressed data to accumulator 0x ORL A,@Ri OR indirectly addressed data to accumulator 0x46-0x ORL A,#data OR immediate data to accumulator 0x ORL direct,a OR accumulator to directly addressed location 0x ORL direct,#data OR immediate data to directly addressed 0x location XRL A,Rn Exclusive OR register to accumulator 0x68-0x6F 1 2 XRL A,direct Exclusive OR directly addressed data to 0x accumulator XRL A,@Ri Exclusive OR indirectly addressed data to 0x66-0x accumulator XRL A,#data Exclusive OR immediate data to accumulator 0x XRL direct,a Exclusive OR accumulator to directly 0x addressed location XRL direct,#data Exclusive OR immediate data to directly 0x addressed location CLR A Clear accumulator 0xE4 1 1 CPL A Complement accumulator 0xF4 1 1 RL A Rotate accumulator left 0x Web: Page 27 of 100

28 Mnemonic Description Code Bytes Cycles RLC A Rotate accumulator left through carry 0x RR A Rotate accumulator right 0x RRC A Rotate accumulator right through carry 0x SWAP A Swap nibbles within the accumulator 0xC4 1 1 Data transfer operations MOV A,Rn Move register to accumulator 0xE8-0xEF 1 1 MOV A,direct Move directly addressed data to accumulator 0xE5 2 3 MOV A,@Ri Move indirectly addressed data to accumulator 0xE6-0xE7 1 4 MOV A,#data Move immediate data to accumulator 0x MOV Rn,A Move accumulator to register 0xF8-0xFF 1 1 MOV Rn,direct Move directly addressed data to register 0xA8-0xAF 2 4 MOV Rn,#data Move immediate data to register 0x78-0x7F 2 2 MOV direct,a Move accumulator to direct 0xF xE0 1 4~11 0xF2-0xF3 1 6~13 MOV direct,rn Move register to direct 0x88-0x8F 2 3 MOV direct1,direct2 Move directly addressed data to directly addressed location 0x MOV direct,@ri Move indirectly addressed data to directly 0x86-0x addressed location MOV Move immediate data to directly addressed 0x direct,#data location Move accumulator to indirectly addressed location 0xF6-0xF7 1 3 Move directly addressed data to indirectly 0xA6-0xA7 2 4 addressed location Move immediate data to in directly addressed 0x76-0x location MOV Load data pointer with a 16-bit immediate 0x DPTR,#data16 MOVC Load accumulator with a code byte relative to 0x A,@A+DPTR DPTR MOVC A,@A+PC Load accumulator with a code byte relative to PC 0x MOVX A,@Ri Move external RAM (8-bit addr.) to 0xE2-0xE3 1 5~12 accumulator 2 MOVX A,@DPTR Move external RAM (16-bit addr.) to accumulator 2 Move accumulator to external RAM (8-bit addr.) 2 Move accumulator to external RAM (16-bit 0xF0 1 5~12 2 The MOVX instructions perform one of two actions depending on the state of 'pmw' bit (pcon.4). For more information refer to the Program Memory Write mode. Web: Page 28 of 100

29 Mnemonic Description Code Bytes Cycles addr.) 2 PUSH direct Push directly addressed data onto stack 0xC0 2 4 POP direct Pop directly addressed location from stack 0xD0 2 3 XCH A,Rn Exchange register with accumulator 0xC8-0xCF 1 2 XCH A,direct Exchange directly addressed location with 0xC5 2 3 accumulator XCH A,@Ri Exchange indirect RAM with accumulator 0xC6-0xC7 1 4 XCHD A,@Ri Exchange low-order nibbles of indirect and 0xD6-0xD7 1 5 accumulator Program branches ACALL addr11 Absolute subroutine call xxx10001b 2 4 LCALL addr16 Long subroutine call 0x RET Return from subroutine 0x RETI Return from interrupt 0x AJMP addr11 Absolute jump xxx00001b 2 3 LJMP addr16 Long jump 0x SJMP rel Short jump (relative address) 0x Jump indirect relative to the DPTR 0x JZ rel Jump if accumulator is zero 0x JNZ rel Jump if accumulator is not zero 0x JC rel Jump if carry flag is set 0x JNC Jump if carry flag is not set 0x JB bit,rel Jump if directly addressed bit is set 0x JNB bit,rel Jump if directly addressed bit is not set 0x JBC bit,rel Jump if directly addressed bit is set and clear bit 0x CJNE A,direct,rel Compare directly addressed data to 0xB5 3 5 accumulator and jump if not equal CJNE A,#data,rel Compare immediate data to accumulator 0xB4 3 4 and jump if not equal CJNE Compare immediate data to register and 0xB8-0xBF 3 4 Rn,#data,rel jump if not equal CJNE Compare immed. to ind. and jump if not equal B6-B7 3 DJNZ Rn,rel Decrement register and jump if not zero D8-DF 2 4 DJNZ direct,rel Decrement directly addressed location and D5 3 5 jump if not zero NOP No operation Boolean manipulation CLR C Clear carry flag 0xC3 1 1 CLR bit Clear directly addressed bit 0xC2 2 4 SETB C Set carry flag 0xD3 1 1 Web: Page 29 of 100

30 Mnemonic Description Code Bytes Cycles SETB bit Set directly addressed bit 0xD2 2 4 CPL C Complement carry flag 0xB3 1 1 CPL bit Complement directly addressed bit 0xB2 2 4 ANL C,bit AND directly addressed bit to carry flag 0x ANL C,/bit AND complement of directly addressed bit to 0xB0 2 3 carry ORL C,bit OR directly addressed bit to carry flag 0x ORL C,/bit OR complement of directly addressed bit to 0xA0 2 3 carry MOV C,bit Move directly addressed bit to carry flag 0xA2 2 3 MOV bit,c Move carry flag to directly addressed bit 0x 十六进制编码排序指令 下表显示的按十六进制编码排序的指令集 表 3-5 十六进制指令 Opcode Mnemonic Opcode Mnemonic Op- code Mnemonic 00 H NOP 19 H DEC R1 32 H RETI 01 H AJMP addr11 1A H DEC R2 33 H RLC A 02 H LJMP addr16 1B H DEC R3 34 H ADDC A,#data 03 H RR A 1C H DEC R4 35 H ADDC A,direct 04 H INC A 1D H DEC R5 36 H ADDC A,@R0 05 H INC direct 1E H DEC R6 37 H ADDC A,@R1 06 H 1F H DEC R7 38 H ADDC A,R0 07 H 20 H JB bit.rel 39 H ADDC A,R1 08 H INC R0 21 H AJMP addr11 3A H ADDC A,R2 09 H INC R1 22 H RET 3B H ADDC A,R3 0A H INC R2 23 H RL A 3C H ADDC A,R4 0B H INC R3 24 H ADD A,#data 3D H ADDC A,R5 0C H INC R4 25 H ADD A,direct 3E H ADDC A,R6 0D H INC R5 26 H ADD A,@R0 3F H ADDC A,R7 0E H INC R6 27 H ADD A,@R1 40 H JC rel 0F H INC R7 28 H ADD A,R0 41 H AJMP addr11 10 H JBC bit,rel 29 H ADD A,R1 42 H ORL direct,a 11 H ACALL addr11 2A H ADD A,R2 43 H ORL direct,#data 12 H LCALL addr16 2B H ADD A,R3 44 H ORL A,#data 13 H RRC A 2C H ADD A,R4 45 H ORL A,direct 14 H DEC A 2D H ADD A,R5 46 H ORL A,@R0 15 H DEC direct 2E H ADD A,R6 47 H ORL A,@R1 16 H 2F H ADD A,R7 48 H ORL A,R0 17 H 30 H JNB bit,rel 49 H ORL A,R1 18 H DEC R0 31 H ACALL addr11 4A H ORL A,R2 Web: Page 30 of 100

31 Op- Mnemonic Op- Mnemonic Op- Mnemonic code code code 4B H ORL A,R3 5D H ANL A,R5 6F H XRL A,R7 4C H ORL A,R4 5E H ANL A,R6 70 H JNZ rel 4D H ORL A,R5 5F H ANL A,R7 71 H ACALL addr11 4E H ORL A,R6 60 H JZ rel 72 H ORL C,bit 4F H ORL A,R7 61 H AJMP addr11 73 H 50 H JNC rel 51 H ACALL addr11 52 H ANL direct,a 53 H ANL direct,#data 54 H ANL A,#data 55 H ANL A,direct 62 H XRL direct,a 63 H XRL direct,#data 64 H XRL A,#data 65 H XRL A,direct 66 H XRL A,@R0 67 H XRL A,@R1 74 H MOV A,#data 75 H MOV direct,#data 76 H 77 H 78 H MOV R0.#data 79 H MOV R1.#data 56 H ANL A,@R0 68 H XRL A,R0 7A H MOV R2.#data 57 H ANL A,@R1 69 H XRL A,R1 7B H MOV R3.#data 58 H ANL A,R0 6A H XRL A,R2 7C H MOV R4.#data 59 H ANL A,R1 6B H XRL A,R3 7D H MOV R5.#data 5A H ANL A,R2 6C H XRL A,R4 7E H MOV R6.#data 5B H ANL A,R3 6D H XRL A,R5 7F H MOV R7.#data 5C H ANL A,R4 6E H XRL A,R 读 - 改 - 写指令 执行 从 SFR 或内部 RAM 读取字节, 修改并且重新写回 的指令, 叫做 读 - 改 - 写指令 当目标 是 I/O 端口 (P0-P3) 或端口中的一位时, 这些指令读取的是输出锁存器而不是引脚 表 3-6 读 - 改 - 写指令 Mnemonic Description Code Bytes Cycles ANL direct,a AND accumulator to direct 0x ANL direct,#data AND immediate data to direct 0x ORL direct,a OR accumulator to direct 0x ORL direct,#data OR immediate data to direct 0x XRL direct,a Exclusive OR accumulator to direct 0x XRL direct,#data Exclusive OR immediate data to direct 0x JBC bit, rel Jump if bit is set and clear bit 0x CPL bit Complement bit 0xB2 2 3 INC direct Increment direct 0x Increment indirect 0x06-0x DEC direct Decrement direct 0x Decrement indirect 0x16-0x DJNZ direct,rel Decrement and jump if not zero 0xD5 3 4 MOV bit,c Move carry flag to direct bit 0x CLR bit Clear bit 0xC2 2 3 Web: Page 31 of 100

32 Mnemonic Description Code Bytes Cycles SETB bit Set bit 0xD 扩展指令 AstroⅡ 中的 8051 MCU 兼容英特尔 MCS51 指令集, 并扩展了如下指令 : MOV A, ACC 这条指令不会破坏 ACC 寄存器中的数据 指令周期计算为精确计算程序执行时间, 每个指令的执行周期都需要计算在内 每个指令周期都可使用下面的公式计算 : if (BYTES > 1 or CYCLES = 1) then DURATION = CYCLES + (BYTES+R)*P + X*D else DURATION = CYCLES + (2+R)*P + X*D 其中 : - BYTE 是指令的字节数 ( 见表 3-4 和表 3-6) - CYCLE 是无等候状态时的周期数 ( 见表 3-4 和表 3-6) - R=1 针对 MOVC 指令, 否则 R=0 - X=1 针对 MOVX 指令, 否则 X=0 - P= 程序存储器等待状态数 (= ckcon[6:4] ) - D= 数据存储器等待状态数 (= ckcon[2:0] ) 在程序存储器写模式下 (PMW),MOVX 的公式如下 : DURATION = CYCLES + (2+X)*P 3.2 存储器 8051 内核采用哈佛结构, 程序和数据的地址 数据总线是共享的但有独立的程序和数据控制信号 8051 的存储组织与标准 8051 相同 分三种存储区域 : 程序空间 外部数据空间和内部数据空间 Astro Ⅱ 的 MSS 集成了 256 字节的内部数据空间 利用页寄存器可以扩展程序和数据空间到 8MB AstroⅡ 把 8051 的程序与数据控制信号合并将哈佛体系结构连接为冯诺依曼体系结构, 也就是进行统一编址, 共享相同的存储空间 需要用户在编程时, 区分程序和数据空间, 以免重叠 内存和 SFR 图 3-2 描述的是内存为 256 字节的存储映射 存储空间同时提供 128 字节的特殊功能寄存器 对低于 80H 的地址空间无论进行直接寻址还是间接寻址, 访问的都是数据存储器的低 128 字节 对高于 7Fh 的地址空间进行间接寻址访问的是内部数据存储器的高 128 字节, 直接寻址访问的是 SFR 低 128 字节包括工作寄存器 (00h 1Fh) 以及位寻址区 (20h 2Fh) 最低 32 字节构成 4 个 bank, 每个 bank 都包括八个寄存器 (R0-R7) 程序存储器状态字(PSW) 的 2 个位选取被使用的 bank 紧接着 16 个字节是位寻址区, 可通过 00h-7Fh 地址进行位寻址 ( 参见表 3-10 可位寻址空间 ) Web: Page 32 of 100

33 图 3-2 内存映像 RAM 存储器 AstroⅡ 内部集成了一块 32KB 的 SPRAM 和一块 4KB 的 DPRAM 32KB 的 SPRAM 仅为 MSS 系统可用 8051 操作 SPRAM 和 DPRAM 最高频率可达 150MHz,8051 与 RAM 之间采用同步工作方式 在 Primace 中例化 system wizard 时设置 8051 firmware 的输出.hex 为 MSS 系统内嵌 RAM 的初始化 内部集成的 Memory 用作程序区时,MSS 的程序作为 AstroⅡ 配置的一部分在配置过程中装载到 MSS 的程序 Memory 里 4KB 的双端口 RAM 中的 A 端口连线到 MSS 的 Memory 总线,B 端口连到 FPGA 的 Fabric,MSS 和 FPGA 共享 4KB 空间, 同时 MSS 和 FPGA 可以独立操作 DPRAM 图 3-3 描述了 AstroⅡ 中 MSS 的存储映像 图 3-3 存储地址映像注意 : 用户编程必须确保程序和数据空间不重叠, 以免程序运行时, 对数据的操作改写了程序代码 4KB 的 DPRAM 存储块 B 端口存储方式, 如下图 2-8 所示 : Web: Page 33 of 100

34 图 3-4 单端口存储方式 表 3-7 4KB 的 DPRAM 存储方式端口描述 Port name Type Description db Input Write Data,8 bit width ab Input Write Address,12 bit width wenb Input Write Enable,low active clkb Input Write Clock. cenb Input Port Enable. low active qb Output Read Data,8 bit width 存储 Banking 8051 不做 Banking 时, 存储空间可达 64KB(0000h~FFFFh) 当用做 Banking 时, 存储映像如下 所示 具体设置, 请参见 3.3.3(9) 和 3.3.3(10) 外部存储器接口 (EMIF) 图 3-5 程序 / 外部数据存储段映射 外部存储器接口用于扩展 MSS 系统的存储空间, 地址映像位于 9000~7FFFFF, 需用 Fabric 去实现 EMIF 接口 MSS 的 8051 时钟端口通过硬连线连接到全局时钟树上, 需要在 PLL wizard 中选择一个, 不需要 Primace 软件绕线 EMIF 的 clkemif 时钟也来自全局时钟, 需要 Primace 软件绕线实现时钟的连接 8051 时钟与 EMIF 的 clkemif 时钟可以同频率也可不同频率, 两者是异步关系 EMIF 接口实现了 Fabric EMIF 操作与 8051 EMIF 操作的双向同步 8051 对 Fabric 扩展的存储空间每次读写需要大约 4 个 clkemif + 3 个 8051 时钟周期 Web: Page 34 of 100

35 表 3-8 EMIF 端口描述 Port name Type Width Description clkemif Input 1 Fabric EMIF clock, posedge active memaddr Output 23 EMIF Address,MSS to Fabric memdatai Input 8 Read Data,Fabric to MSS memdatao Output 8 Write data,mss to Fabric memrd Output 1 read Enable. high active memwr Output 1 Write Enable,high active memack Input 1 Fabric to MSS operation acknowledge EMIF 包括 23 位宽的地址总线 memaddr,8 位的输入数据总线 memdatai,8 位输出数据总线 memdatao, 控制信号 memrd, memwr, memack 以及时钟信号 clkemif 控制信号 memrd, memwr, 在 clkemif 的上升沿输出到 Fabric 读取时, 在 Fabric 的数据有效的情况下, 下一个时钟的上升沿 Fabric 输出一个时钟的 memack 有效到 MSS 写入时,Fabric 接收到数据后, 输出一个时钟的 memack 有效到 MSS EMIF 的读写时序时序图, 如下所示 图 3-6 EMIF 读时序 3.3 特殊功能寄存器 (SFRs) 图 3-7 EMIF 写时序 SFRs 在内存空间中, 地址范围从 7Fh 到 FFh SFR 存储单元 如表 3-9 所示的 SFR 表, 部分地址已被占用, 其余部分为保留的特殊功能寄存器 Web: Page 35 of 100

36 表 3-9 SFR 存储单元 Hex/ Bin X000 X001 X010 X011 X100 X101 X110 X111 Bin/ F8 miscconclkcpuconclko0con clko1conclko2con F0 b srst F7 E8 md0 md1 md2 md3 md4 md5 arcon EF E0 acc spsta spcon spdat spssn E7 D8 adcon i2cdat i2cadr i2ccon i2csta DF D0 psw C8 t2con crcl crch tl2 th2 CF C0 ircon ccen ccl1 cch1 ccl2 cch2 ccl3 cch3 C7 B8 ien1 ip1 s0relh s1relh BF B0 p3 A8 ien0 ip0 s0rell i2cspisel iscaddr0 iscaddr1 iscaddr2iscaddr3 AF A0 p2 98 s0con s0buf ien2 s1con s1buf s1rell 9F 90 p1 dps pagesel d_pagesel tcon tmod tl0 tl1 th0 th1 ckcon 8F 80 p0 sp dpl dph dpl1 dph1 wdtrel pcon 87 在 SFR 地址空间中有 16 个 SFR 是既可以字节寻址也可以是位寻址的 位寻址的 SFR 是地址以 000ˊb (80ˊh, 88ˊh, 90ˊh F8ˊh) 结尾的 16 个寄存器 (128 位 ) 和 128 位的内部数据存储器 ( 存储单元 为 20ˊh 2Fˊh) 一起构成位寻址区 ( 请参见表 3-10) 表 3-10 可位寻址空间 Hex/ Bin X000 X001 X010 X011 X100 X101 X110 X111 Bin/ Hex SFR F8 misccon.0 misccon.1 misccon.2 misccon.3 misccon.4 misccon.5 misccon.6 misccon.7 FF F0 b.0 b.1 b.2 b.3 b.4 b.5 b.6 b.7 F7 E8 EF E0 acc.0 acc.1 acc.2 acc.3 acc.4 acc.5 acc.6 acc.7 E7 D8 adcon.0 adcon.1 adcon.2 adcon.3 adcon.4 adcon.5 adcon.6 adcon.7 DF D0 psw.0 psw.1 psw.2 psw.3 psw.4 psw.5 psw.6 psw.7 D7 C8 t2con.0 t2con.1 t2con.2 t2con.3 t2con.4 t2con.5 t2con.6 t2con.7 CF C0 ircon.0 ircon.1 ircon.2 ircon.3 ircon.4 ircon.5 ircon.6 ircon.7 C7 B8 ip.0 ip.1 ip.2 ip.3 ip.4 ip.5 ip.6 ip.7 BF /ien1.0 /ien1.1 /ien1.2 /ien1.3 /ien1.4 /ien1.5 /ien1.6 /ien1.7 B0 p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 B7 A8 ien0.0 ien0.1 ien0.2 ien0.3 ien0.4 ien0.5 ien0.6 ien0.7 AF A0 p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 A7 98 s0con.0 s0con.1 s0con.2 s0con.3 s0con.4 s0con.5 s0con.6 s0con.7 9F 90 p1.0 p1.1 p1.2 p1.3 p1.4 p1.5 p1.6 p tcon.0 tcon.1 tcon.2 tcon.3 tcon.4 tcon.5 tcon.6 tcon.7 8F 80 p0.0 p0.1 p0.2 p0.3 p0.4 p0.5 p0.6 p Internal RAM 78 2Fh.0 2Fh.1 2Fh.2 2Fh.3 2Fh.4 2Fh.5 2Fh.6 2Fh.7 7F 70 2Eh 77 Hex FF D7 B7 A7 Web: Page 36 of 100

37 Hex/ Bin X000 X001 X010 X011 X100 X101 X110 X111 Bin/ 68 2Dh 6F 60 2Ch Bh 5F 50 2Ah h 4F 40 28h h 3F 30 26h h 2F 20 24h h 1F 10 22h h.0 21h.1 21h.2 21h.3 21h.4 21h.5 21h.6 21h.7 0F 00 20h.0 20h.1 20h.2 20h.3 20h.4 20h.5 20h.6 20h SFR 复位值 Hex 下表为复位值和简单说明 表 3-11 SFR 表的复位值 SFR Add Rese Description p0 80h FFh Port 0 sp 81h 07h Stack Pointer dpl 82h 00h Data Pointer Low dph 83h 00h Data Pointer High wdtrel 86h 00h Watchdog Timer Reload pcon 87h 00h Power Control tcon 88h 00h Timer/Counter Control tmod 89h 00h Timer Mode Register tl0 8Ah 00h Timer 0, low byte tl1 8Bh 00h Timer 1, low byte th0 8Ch 00h Timer 0, high byte th1 8Dh 00h Timer 1, high byte ckcon 8Eh 71h Clock Control Register p1 90h FFh Port 1 dps 92h 00h Data Pointer Select pagesel 94h 01h Program Memory Page d_pages 95h 01h External Data Memory s0con 98h 00h Serial Port 0, Control s0buf 99h 00h Serial Port 0, Data Buffer ien2 9Ah 00h Interrupt Enable Register SFR Add Rese Description s1con 9Bh 00h Serial Port 1, Control s1buf 9Ch 00h Serial Port 1, Data Buffer s1rell 9Dh 00h Serial Port 1, Reload p2 A0h FFh Port 2 ien0 A8h 00h Interrupt Enable Register ip0 A9h 00h Interrupt Priority Register s0rell AAh D9h Serial Port 0, Reload p3 B0h FFh Port 3 ip/ien1 B8h 00h Interrupt Priority Register / ip1 B9h 00h Interrupt Priority Register s0relh BAh 03h Serial Port 0, Reload s1relh BBh 03h Serial Port 1, Reload ircon C0h 00h Interrupt Request Control ccen C1h 00h Compare/Capture ccl1 C2h 00h Compare/Capture cch1 C3h 00h Compare/Capture ccl2 C4h 00h Compare/Capture cch2 C5h 00h Compare/Capture ccl3 C6h 00h Compare/Capture cch3 C7h 00h Compare/Capture Web: Page 37 of 100

38 SFR Add Rese Description t2con C8h 00h Timer 2 Control Register crcl CAh 00h Compare/Reload/Captu crch CBh 00h Compare/Reload/Captu tl2 CCh 00h Timer 2, low byte th2 CDh 00h Timer 2, high byte psw D0h 00h Program Status Word SFR Add Rese Description spsta E1h 00h Serial Peripheral Status spcon E2h 14h Serial Peripheral Control spdat E3h 00h Serial Peripheral Data spssn E4h FFh Serial Peripheral Slave md0 E9h 00h Multiplication/Division md1 EAh 00h Multiplication/Division adcon D8h 00h Serial Port 0 Baud Rate md2 EBh 00h Multiplication/Division Select register (only i2cdat DAh 00h I2C Data Register i2cadr DBh 00h I 2 C Address Register i2ccon DCh 00h I 2 C Control Register i2csta DDh F8h I 2 C Status Register acc E0h 00h Accumulator md3 ECh 00h Multiplication/Division md4 EDh 00h Multiplication/Division md5 EEh 00h Multiplication/Division arcon EFh 00h Arithmetic Control b F0h 00h B Register srst F7h 00h Software Reset Register SFR 说明 本节简略描述了所有 SFR (1) 累加器 -ACC 在大多数 8051 指令中使用累加器 A, 保存操作数并存储运算结果 在使用累加器的指令中, 其助 记符是 A, 而不是 ACC (2) B 寄存器 -B B 寄存器在执行乘除法指令时使用 也可以用作临时寄存器用来存储临时数据 (3) 程序状态寄存器 -PSW PSW 寄存器反映 CPU 当前执行状态的状态位 需注意, 检验位 P 只能根据 ACC 寄存器状态由硬件 修改其值 表 3-12 PSW 寄存器 Bit Symbol Description Type psw.7 cy Carry flag Carry bit in arithmetic operations and accumulator for Boolean operations. psw.6 ac Auxiliary Carry flag Set if there is a carry-out from 3rd bit of Accumulator in BCD Operations psw.5 f0 General purpose Flag 0 General purpose flag available for user psw.4 rs1 Register bank select control bit 1, used to select working register bank psw.3 rs0 Register bank select control bit 0, used to select working register bank psw.2 ov Overflow flag Set in case of overflow in Accumulator during arithmetic operations Web: Page 38 of 100

39 Bit Symbol Description Type psw.1 f1 General purpose Flag 1 General purpose flag available for user. psw.0 p Parity flag R Reflects the number of 1 s in the Accumulator. P = 1 if Accumulator contains an odd number of 1 s P = 0 if Accumulator contains an even number of 1 s rs1 和 rs0 位的状态按如下方式选择工作寄存器组 : 表 3-13 寄存器组存储单元 rs1 rs0 Selected Register Bank Location 0 0 Bank 0 (00H 07H) 0 1 Bank 1 (08H 0FH) 1 0 Bank 2 (10H 17H) 1 1 Bank 3 (18H 1FH) (4) 堆栈指针 -SP 这个寄存器指向内部数据存储空间的堆栈顶部 用于执行中断服务子程序或子程序调用前保存程序 的返回地址 堆栈指针在执行 PUSH 或 CALL 命令之前会递增, 执行 POP 或 RET(I) 指令之后会递减 ( 通 常指向堆栈顶部 ) (5) 数据指针 -DPH,DPL MCU 中实现了 2 个数据指针寄存器 DPTR 可以通过 DPL 和 DPH 进行访问 当前使用的数据指针 寄存器由 DPS 寄存器选取 这两个寄存器用于间接寻址时存储 16bit 长的地址, 并适用于以下指令 : MOVX MOVC JMP(computed branch) 它们可以作为 1 个 16 位的寄存器或者 2 个 8 位的寄存器进行操作 DPH 存储当前间接地址高字节, DPL 存储当前间接地址的低字节 通常用于访问外部程序空间或数据空间, 例如 : MOVC 程序空间 ) MOVX 数据空间 ) (6) 数据指针选择寄存器 -DPS 8051 包含 2 个数据指针寄存器 每个寄存器都可作为 16 位的地址源用于间接寻址 DPS 寄存器用 于选择当前数据指针寄存器 AstroⅡ 中,DPS 寄存器位于 SFR 存储空间, 宽为 1 位 AstroⅡ 中, 有 2 个 DPTR 表 3-14 DPS 寄存器 Bit Symbol Description Type dps.7 - not used, read as 0 R dps.6 - dps.5 - dps.4 - Web: Page 39 of 100

40 Bit Symbol Description Type dps.3 - dps.2 - dps.1 - dps.0 dpsel0 Data Pointer Register select. The content of this bit specifies which DPTR from the two is used as current active DPTR. (7) 数据指针 1 DPH1,DPL1 DPTR1 寄存器可以通过 DPL1 和 DPH1 进行访问 不论实际 DPS 寄存器选中当前哪个 DPTR,DPL1 和 DPH1 始终指向 DPTR1 当 DPS 寄存器的 LSB 被设置为 1 时, 所有 DPTR 相关指令都使用这个 16 位的寄存器, 否则 DPTR 来自 DPH 和 DPL DPTR1 特殊功能寄存器位于 SFR 空间, 共有 2 个数据指针 (8) 端口 P0,P1,P2,P3 执行写操作后, 这些寄存器中的内容可以从芯片的相应引脚处检测到 ( 端口 P0,P1,P2,P3) 向 任一的口线写 1 可使得相应引脚保持高电平, 写 0 会使得相应的引脚保持低电平 执行读操作时, 寄存器端口 P0,P1,P2,P3 的状态反应了 8051 引脚的相应值 应注意到某些涉及到端口 N 的读 - 改 - 写指令实际上是读锁存器 ( 如,INC P0; ANL P2, A), 而其他 指令则是读引脚 ( 如, MOV A,P1) P0,P1,P2,P3 寄存器位于 SFR 存储器空间 (9) 程序存储页面寄存器 PAGESEL 此寄存器为程序存储器在 bank 实现时提供额外地址 需注意, 为了在复位后不再向 pagesel 寄 存器写值仍能够生成正确的地址 ( 逻辑地址 8000h 等于对应的物理地址 ),PAGESEL 的复位值为 1 不 能将 0 值赋给 pagesel 寄存器, 否则将导致 bank 区域 ( 逻辑地址在 8000h-FFFFh) 与物理地址 (0000h-7FFFh) 内容重叠 (10) 数据存储页面寄存器 D_PAGESEL 此寄存器为数据存储器的组合提供附加地址 需注意, 为了在复位后不再向 d_pagesel 寄存器 写值仍能够生成正确的地址 ( 逻辑地址 8000h 等于对应的物理地址 ),PAGESEL 的复位值为 1 不能将 0 值赋给 pagesel 寄存器, 否则将导致 bank 区域 ( 逻辑地址在 8000h-FFFFh) 与物理地址 (0000h-7FFFh) 内容重叠 (11) 定时 / 计数器控制寄存器 TCON TCON 寄存器反映了 8051 定时器 0 和定时器 1 当前状态, 并且控制这些模块的工作 表 3-15 TCON 寄存器 Bit Symbol Description Type tcon.7 tf1 Timer 1 overflow flag Bit set by hardware when Timer1 overflows. This flag can be cleared by software and is automatically cleared when interrupt is processed. tcon.6 tr1 Timer1 Run control If cleared, Timer 1 stops. tcon.5 tf0 Timer 0 overflow flag Bit set by hardware when Timer 0 overflows. This flag can be cleared by software and is automatically cleared when interrupt is processed. tcon.4 tr0 Timer 0 Run control Web: Page 40 of 100

41 Bit Symbol Description Type tcon.3 ie1 If cleared, Timer 0 stops. External interrupt 1 flag Set by hardware, when external interrupt int1 (edge/level, depending on settings) is observed. Cleared by hardware when interrupt is processed. tcon.2 it1 External interrupt 1 type control If set, external interrupt 1 is activated at falling edge on input pin. If cleared, external interrupt 1 is activated at low level on input pin. tcon.1 ie0 External interrupt 0 flag Set by hardware, when external interrupt int0 (edge/level, depending on settings) is observed. Cleared by hardware when interrupt is processed. tcon.0 it0 External interrupt 0 type control If set, external interrupt 0 is activated at falling edge on input pin. If cleared, external interrupt 0 is activated at low level on input pin. tf0, tf1( 定时器 0 和定时器 1 溢出中断请求标志 ),ie0 和 ie1( 外部 0 和 1 中断请求标志 ), 在进入对 应的中断服务程序时会被硬件自动清零 (12) 定时器模式寄存器 TMOD TMOD 寄存器用于配置 8051 的定时器 0 和定时器 1 表 3-16 TMOD 寄存器 Bit Symbol Description Type tmod.7 gate Timer 1 gate control If set, enables external gate control (pin int(1) ) for Counter 1. When int(1) is high, and tr1 bit is set (Table 18), the Counter 1 is incremented every falling edge on t1 input pin tmod.6 c/t Timer 1 counter/timer select Selects Timer or Counter operation. When set to 1, a Counter operation is performed, when cleared to 0, the Timer/Counter 1 will function as a Timer. tmod.5 m1 Timer 1 mode tmod.4 m0 Selects mode for Timer/Counter 1, as shown in table below. tmod.3 gate Timer 0 gate control If set, enables external gate control (pin int(0) ) for Counter 0. When int(0) is high, and tr0 bit is set (Table 18), the Counter 0 is incremented every falling edge on t0 input pin tmod.2 c/t Timer 0 counter/timer select Selects Timer or Counter operation. When set to 1, a Counter operation is performed, when cleared to 0, the Timer/Counter 0 will function as a Timer. tmod.1 m1 Timer 0 mode tmod.0 m0 Selects mode for Timer/Counter 0, as shown in table below. Web: Page 41 of 100

42 表 3-17 定时 / 计数方式 m0 m1 Mode Function 0 0 Mode 0 13-bit Counter/Timer, with 5 lower bits in tl0 (tl1) register and 8 bits in th0 (th1) register (for Timer 0 or Timer 1, respectively). Note, that unlike in 80C51, the 3 high-order bits of tl0 (tl1) are zeroed whenever Mode 0 is enabled. 0 1 Mode 1 16-bit Counter/Timer Mode 2 Mode 3 8 -bit auto-reload Counter/Timer. The reload value is kept in th0 (th1), while tl0 (tl1) is incremented every machine cycle. When tl0 (tl1) overflows, a value from th0 (th1) is copied to tl0 (tl1). For Timer1: Timer1 is stopped. For Timer0: Timer 0 acts as two independent 8 bit Timers / Counters tl0, th0. - tl0 uses the Timer0 control bits and sets tf0 flag on overflow - th0 operates as Timer. It is enabled by tr1 bit and sets tf1 flag on overflow. (13) 定时器 0 TH0,TL0 寄存器反映了定时器 0 的状态 TH0 存储高字节,TL0 存储低字节 定时器 0 可配置为定时器或计 数器 (14) 定时器 1 TH1,TL1 寄存器反映了定时器 1 的状态 TH1 存储高字节,TL1 存储低字节 定时器 0 可配置为定时器或计 数器 (15) 定时器 2 控制寄存器 T2CON T2CON 寄存器反映 8051 中定时器 2 的当前状态, 并用于控制定时器 2 工作 表 3-18 T2CON 寄存器 Bit Symbol Description Type t2con.7 t2ps Prescaler select t2ps = 0 Timer 2 is clocked with 1/12 of the oscillator frequency. t2ps = 1 Timer 2 is clocked with 1/24 of the oscillator frequency. t2con.6 i3fr Active edge selection for external interrupt int3, (used also as compare and capture signal) 0 - falling edge 1 - rising edge t2con.5 i2fr Active edge selection for external interrupt int2 0 - falling edge 1 - rising edge t2con.4 t2r1 Timer 2 reload mode selection: t2con.3 t2r0 0X reload disabled 10 Mode 0 11 Mode 1 t2con.2 t2cm Timer 2 compare mode selection Web: Page 42 of 100

43 Bit Symbol Description Type t2con.1 t2i1 0 Mode 0 1 Mode 1 Timer 2 input selection: (t2i1, t2i0) 00 Timer 2 stopped 01 input frequency f/12 or f/24 10 Timer 2 is incremented by falling edge detection at pin t2 t2con.0 t2i0 11 input frequency f/12 or f/24 gated by external pin t2 (16) 定时器 2 TH2,TL2 寄存器反映了定时器 2 的状态 TH2 存储高字节,TL2 存储低字节 定时器 2 可以被配置工作在比 较 / 捕获 / 重载模式 (17) 比较 / 捕获功能配置寄存器 CCEN CCEN 寄存器为与定时器 2 相关的比较 / 捕获单元的配置寄存器 ( 详细描述参见 3.7.3) 表 3-19 CCEN 寄存器 Bit Symbol Description Type ccen.7 cocah3 compare/capture mode for CC3 register ccen.6 cocal3 cocah3 cocal3 Description 0 0 compare/capture disabled 0 1 capture on rising edge at pin cc0 1 0 compare enabled 1 1 capture on write operation into register cc3 ccen.5 cocah2 compare/capture mode for CC2 register ccen.4 cocal2 cocah2 cocal2 Description 0 0 compare/capture disabled 0 1 capture on rising edge at pin cc1 1 0 compare enabled 1 1 capture on write operation into register ccl2 ccen.3 cocah1 compare/capture mode for CC1 register ccen.2 cocal1 cocah1 cocal1 Description 0 0 compare/capture disabled 0 1 capture on rising edge at pin cc2 1 0 compare enabled 1 1 capture on write operation into register cc1 ccen.1 cocah0 compare/capture mode for CRC register ccen.0 cocal0 cocah0 cocal0 Description 0 0 compare/capture disabled 0 1 capture on falling/rising edge at pin cc3 1 0 compare enabled 1 1 capture on write operation into register crcl (18) 比较 / 捕获寄存器 CC1,CC2,CC3 比较 / 捕获寄存器 (CC1,CC2,CC3) 为 16 位的寄存器, 用于定时器 2 相关的比较 / 捕获单元的操作 ( 详细描述参考 3.7.3) CCn 寄存器中,CCHn 存储高字节,CCLn 存储低字节 Web: Page 43 of 100

44 CCL1,CCH1,CCL2,CCH2,CCL3,CCH3 寄存器位于 SFR 存储器空间 (19) 比较 / 重装入 / 捕获寄存器 CRCH,CRCL 比较 / 重装入 / 捕获寄存器 CRC 为 16 位宽的寄存器, 用于与定时器 2 相关的对比 / 捕获单元的操作 ( 详细描述参见 3.7.3) CRCH 存储高字节,CRCL 存储低字节 (20) 串口 0 控制寄存器 S0CON S0CON 寄存器控制串口 0 的功能 表 3-20 S0CON 寄存器 Bit Symbol Description Type s0con.7 sm0 Serial Port 0 mode select s0con.6 sm1 (see 表 3-21 串口 0 工作方式与波特率 ) s0con.5 sm20 Multiprocessor communication enable (see (2) UART0 多处理器通 信 ). s0con.4 ren0 Serial reception enable If set HIGH serial reception at Serial Port 0 is enabled. Otherwise serial reception at Serial Port 0 is disabled. s0con.3 tb80 Transmitter bit 8 This bit is used while transmitting data through Serial Port 0 in Modes 2 and 3. The state of this bit corresponds with the state of the 9th transmitted bit (e.g. parity check or multiprocessor communication). It is controlled by software. s0con.2 rb80 Received bit 8 This bit is used while receiving data through Serial Port 0 in Modes 2 and 3. It reflects the state of the 9th received bit. In Mode 1, if multiprocessor communication is enabled (sm20 = 0), this bit is the stop bit that was received ( 参见 (2) UART0 多处理器通信 ). In Mode 0 this bit is not used. s0con.1 ti0 Transmit interrupt flag It indicates completion of a serial transmission at Serial Port 0. It is set by hardware at the end of bit 8 in mode 0 or at the beginning of a stop bit in other modes. It must be cleared by software. s0con.0 ri0 Receive interrupt flag It is set by hardware after completion of a serial reception at Serial Port 0. It is set by hardware at the end of bit 8 in mode 0 or in the middle of a stop bit in other modes. It must be cleared by software. 表 3-21 串口 0 工作方式与波特率 sm0 sm1 Mode Description Baud Rate 0 0 Mode 0 shift register Fclk/ Mode 1 8-bit UART Variable (details below the table) Web: Page 44 of 100

45 sm0 sm1 Mode Description Baud Rate 1 0 Mode 2 9-bit UART Depends on smod (pcon.7) value smod 0 Fclk/64 1 Fclk/32 Baud Rate 1 1 Mode 3 9-bit UART Variable (details below the table) 串口 0 在方式 1 或 3 下工作的波特率为 : bd(adcon.7=0): bd(adcon.7=1): 波特率 = SMOD 2 *Fclk *( 定时器 1 overflow rate) 32 波特率 2 = 64* SMOD * Fclk ( 2 10 s0rel) 图 3-8 UART0 波特率的计算 smod(pcon.7) 串口 0 波特率选择标 s0rel S0REL 寄存器的值 (s0relh,s0rell)( 见 P45) bd(adcon.7) adcon 寄存器最高有效位 (21) 串口 0 数据缓冲寄存器 S0BUF 将数据写入该寄存器时, 在串口输出缓冲设置数据, 并通过串口 0 进行发送 从 S0BUF 读取数据时, 从串口接收缓冲读取数据 (22) 串口 0 重装入寄存器 S0RELH,S0RELL 串口 0 重装入寄存器用于生成串口 0 波特率 ( 参见图 3-8 UART0 波特率的计算 ) 共占用了 10 位, 其中低 8 位来自 S0RELL, 高 2 位来自 S0RELH (s0relh.1, s0relh.0) (23) 串口 1 控制寄存器 S1CON S1CON 寄存器控制串口 1 的功能 表 3-22 S1CON 寄存器 Bit Symbol Description Type s1con.7 sm Serial Port 1 mode select sm = 0: Mode A selected for Serial Port 1-9-bit UART sm = 1: Mode B selected for Serial Port 1-8-bit UART s1con.6 - not used, read as 0 R s1con.5 sm21 Multiprocessor communication enable (see3.11.2(2)uart1 多处理器通信 ). s1con.4 ren1 Serial reception enable If set HIGH serial reception at Serial Port 1 is enabled. Otherwise serial reception at Serial Port 1 is disabled. s1con.3 tb81 Transmitter bit 8 This bit is used while transmitting data through Serial Port 1 in Mode A. The state of this bit corresponds with the state of the 9th transmitted bit (e.g. parity check or multiprocessor communication). It is controlled by software. Web: Page 45 of 100

46 Bit Symbol Description Type s1con.2 s1con.1 s1con.0 rb81 ti1 ri1 串口 1 波特率 : Received bit 8 This bit is used while receiving data through Serial Port 1 in Mode A. It reflects the state of the 9th received bit. In Mode B, if multiprocessor communication is enabled (sm21 = 0), this bit is the stop bit that was received (see (2) UART0 多处理器通信 ). Transmit interrupt flag It indicates completion of a serial transmission at Serial Port 1. It is set by hardware at the beginning of a stop bit in mode A or B. It must be cleared by software. Receive interrupt flag It is set by hardware after completion of a serial reception at Serial Port 1. It is set by hardware in the middle of a stop bit in mode A or B. It must be cleared by software. 波特率 = 32* Fclk ( 2 10 s1rel) 图 3-9 UART1 波特率计算 s1rel S1REL 寄存器的值 ( s1relh, s1rell )( 参见 P46) (24) 串口 1 数据缓冲 S1BUF 将数据写入该寄存器, 在串口输出缓冲设置数据, 并经过串口 1 发送 读取 S1BUF 时, 从串口接收缓冲接收数据 (25) 串口 1 重装入寄存器 S1RELH,S1RELL 串口重装入寄存器用于产生串口 1 波特率 ( 参见图 3-9 UART1 波特率计算 ) 共占用了 10 位, 其中低 8 位来自 S1RELL, 高 2 位来自 S1RELH(s1relh.1,s1relh.0) (26) 看门狗重装入寄存器 WDTREL WDTREL 寄存器存储看门狗定时器高 7 位的重载值 ( 见 3.8 看门狗 ), 同时配置看门狗定时器的预分 频 表 3-23 WDTREL 寄存器 Bit Symbol Description Type wdtrel.7 - Prescaler select When set, the watchdog is clocked through an additional divideby-16 prescaler. wdtrel.6 - Watchdog reload value wdtrel.5 wdtrel.4 wdtrel.3 wdtrel.2 wdtrel.1 wdtrel.0 Reload value for the highest 7 bits of the watchdog Timer. This value is loaded to the Watchdog Timer when a refresh is triggered by a consecutive setting of bits wdt (ien0.6) and swdt (ien1.6). For details see Watchdog Timer description (3.8 看门狗 ). Web: Page 46 of 100

47 (27) 中断允许寄存器 0 IEN0 实现了外部中断使能标志位 实现了看门狗刷新标志位 实现了定时器 0 中断使能标志位 实现了定时器 1 中断使能标志位 实现了定时器 2 中断使能标志位 实现了串口 0 中断使能标志位 表 3-24 IEN0 寄存器 Bit Symbol Description Type ien0.7 eal Interrupts enable When set to 0 all interrupts are disabled Otherwise enabling each interrupt is done by setting the corresponding interrupt enable bit ien0.6 wdt Watchdog Timer refresh flag Set to initiate a refresh of the watchdog Timer. Must be set directly before swdt (ien1.6) is set to prevent an unintentional refresh of the watchdog Timer. The wdt bit is cleared by hardware after the next instruction executed after the one that had set this bit, so that watchdog refresh can be done only with direct sequence of setting wdt and swdt. ien0.5 et2 Timer 2 interrupt enable When et2=0 Timer 2 interrupt is disabled. When et2=1 and eal=1 Timer 2 interrupt is enabled. ien0.4 es0 Serial Port 0 interrupt enable When es0=0 Serial Port 0 interrupt is disabled. When es0=1 and eal=1 Serial Port 0 interrupt is enabled. ien0.3 et1 Timer 1 overflow interrupt enable When et1=0 Timer 0 overflow interrupt is disabled. When et1=1 and eal=1 Timer 1 overflow interrupt is enabled. ien0.2 ex1 External interrupt 1 enable When ex1=0 external interrupt 1 is disabled. When ex1=1 and eal=1 external interrupt 1 is enabled. ien0.1 et0 Timer 0 overflow interrupt enable When et0=0 Timer 0 overflow interrupt is disabled. When et0=1 and eal=1 Timer 0 overflow interrupt is enabled. ien0.0 ex0 External interrupt 0 enable When ex0=0 external interrupt 0 is disabled. When ex0=1 and eal=1 external interrupt 0 is enabled. (28) 中断允许寄存器 1 IEN1 实现了外部中断使能标志位 实现了定时器 2 中断使能标志位 实现了看门狗定时器启动 / 刷新标志位 Web: Page 47 of 100

48 表 3-25 IEN1 寄存器 Bit Symb ol Description ien1.7 exen2 Timer 2 external reload interrupt enable When exen2=0, Timer 2 external reload interrupt 2 is disabled. When exen2=1 and eal=1, Timer 2 external reload interrupt 2 is enabled. Type ien1.6 swdt Watchdog Timer start/refresh flag. Set to activate/refresh the watchdog Timer. When set directly after setting wdt (ien0.6), a watchdog Timer refresh is performed. This bit is immediately cleared by hardware. ien1.5 ex6 External interrupt 6 enable When ex6=0 external interrupt 6 is disabled. When ex6=1 and eal=1 external interrupt 6 is enabled. ien1.4 ex5 External interrupt 5 enable When ex5=0 external interrupt 5 is disabled. When ex5=1 and eal=1 external interrupt 5 is enabled. ien1.3 ex4 External interrupt 4 enable When ex4=0 external interrupt 4 is disabled. When ex4=1 and eal=1 external interrupt 4 is enabled. ien1.2 ex3 External interrupt 3 enable When ex3=0 external interrupt 3 is disabled. When ex3=1 and eal=1 external interrupt 3 is enabled. ien1.1 ex2 External interrupt 2 enable When ex2=0 external interrupt 2 is disabled. When ex2=1 and eal=1 external interrupt 2 is enabled. ien1.0 ex7 External interrupt 7 enable When ex7=0 external interrupt 7 is disabled. When ex7=1 and eal=1 external interrupt 7 is enabled. (29) 中断允许寄存器 2 IEN2 实现了串口 1 中断使能标志位 表 3-26 IEN2 寄存器 Bit Symbol Description Type ien2.7 - not used, read as 0 R ien2.6 - ien2.5 ex12 External interrupt 12 enable R Not used in the Astro Ⅱ device, read as 0 ien2.4 ex11 External interrupt 11 enable R Not used in the Astro Ⅱ device ien2.3 ex10 External interrupt 10 enable R Not used in the Astro Ⅱ device, read as 0 ien2.2 ex9 External interrupt 9 enable R Not used in the Astro Ⅱ device, read as 0 Web: Page 48 of 100

49 Bit Symbol Description Type ien2.1 ien2.0 ex8 es1 External interrupt 8 enable Not used in the Astro Ⅱ device, read as 0 Serial Port 1 interrupt enable When es1=0 Serial Port 1 interrupt is disabled. When es1=1 and eal=1 Serial Port 1 interrupt is enabled. (30) 中断优先级寄存器 IP0,IP1 13 个中断源可分为 6 个优先组 每个组都有 4 个优先级可供选择 通过设定 IP0 和 IP1 寄存器内相 应的值, 可以实现选定的优先级 中断优先级寄存器中的值按照下表对每个中断源进行了优先级的定义 实现了看门狗定时器状态标志位 表 3-27 IP0 寄存器 Bit Symbol Description Type ip0.7 - not used, read as 0 R ip0.6 wdts Watchdog Timer status flag Set by hardware when the watchdog Timer reset occurs. ip0.5 - Interrupt priority ip0.4 - Each bit together with corresponding bit from IP1 register specifies the ip0.3 - priority level of the respective interrupt priority group. ip0.2 - ip0.1 - ip0.0 - R 表 3-28 IP1 寄存器 Bit Symbol Description Type ip1.7 - not used, read as 0 R ip1.6 - ip1.5 - Interrupt priority ip1.4 - Each bit together with corresponding bit from IP0 register specifies the ip1.3 - priority level of the respective interrupt priority group. ip1.2 - ip1.1 - ip1.0 - 表 3-29 优先组 Group Corresponding interrupt bits 0 ip1.0, ip0.0 External interrupt 0 1 ip1.1, ip0.1 Timer 0 Interrupt Highest priority lowest priority (in the same interrupt group) Serial channel Not used External interrupt 7 1 interrupt Not used Not used External interrupt 2 Web: Page 49 of 100

50 Group Corresponding interrupt bits 2 ip1.2, ip0.2 External interrupt 1 3 ip1.3, ip0.3 Timer 1 Interrupt 4 ip1.4, ip0.4 Serial channel 0 interrupt 5 ip1.5, ip0.5 Timer 2 Interrupt Highest priority lowest priority (in the same interrupt group) Not used Not used External interrupt 3 Not used Not used External interrupt 4 Not used Not used External interrupt 5 Not used Not used External interrupt 6 表 3-30 优先级 ip1.x ip0.x 0 0 Level 0 ( lowest ) 0 1 Level Level Level 3 ( highest ) X 是优先组的组号 (31) 中断请求控制寄存器 IRCON 实现了外部中断允许标志位 实现了定时器 2 溢出 / 重装入标志位 表 3-31 IRCON 寄存器 Bit Symbol Description Type ircon.7 exf2 Timer 2 external reload flag ircon.6 tf2 Timer 2 overflow flag ircon.5 iex6 External interrupt 6 edge flag ircon.4 iex5 External interrupt 5 edge flag ircon.3 iex4 External interrupt 4 edge flag ircon.2 iex3 External interrupt 3 edge flag ircon.1 iex2 External interrupt 2 edge flag ircon.0 iex7 External interrupt 7 edge flag (32) 电源控制寄存器 PCON pmw 用于实现程序存储器写模式 表 3-32 PCON 寄存器 Bit Symbol Description Type pcon.7 smod Serial Port 0 baud rate select (see 表 3-21) (baud rate doubler) pcon.6 wdt_tm Watchdog Timer Test Mode flag When set to 1, the fclk/12 divider at the input of the Watchdog Timer is skipped pcon.5 isr_tm Interrupt Service Routine Test Mode flag Web: Page 50 of 100

51 Bit Symbol Description Type pcon.4 pmw When set to 1, the interrupt vectors assigned to Timer 0 & 1, Serial Port 0 & 1, SPI and I 2 C interfaces can be triggered only with the use of external inputs of the core Program memory write mode Setting this bit enables the program memory write mode pcon.3 p2sel High-order address byte configuration bit Chooses the higher byte of address ( memaddr[15:8] ) during operations; when 0, the memaddr[15:8] = p2reg when 1, the memaddr[15:8] = ADDR_HIGH_RI The p2reg is the contents of Port2 output register. The ADDR_HIGH_RI = 8 h0 is the parameter defined before synthesis. pcon.2 gf0 General Purpose Flag pcon.1 stop Stop mode control Setting this bit activates the Stop Mode. This bit is always read as 0 pcon.0 idle Idle mode control Setting this bit activates the Idle Mode. This bit is always read as 0 (33) 时钟控制寄存器 CKCON 寄存器的值定义了在读取 / 写入外部数据 程序存储器时内部生成的等待状态的个数 表 3-33 CKCON 寄存器 Bit Symbol Description Type ckcon.7 - not used, read as 0 R ckcon.6 - Program memory wait state control ckcon.5 - ckcon.4 - ckcon.3 - not used, read as 0 R ckcon.2 - External data memory stretch cycle control ckcon.1 - ckcon.0 - 表 3-34 代码存储器等待状态周期的宽度 CKCON Register Wait Read Signals Width Write Signals Width ckcon.6 ckcon.5 ckcon.4 Value memaddr mempsrd memaddr mempsrd Web: Page 51 of 100

52 表 3-35 外部数据存储器等待状态周期的宽度 CKCON Register Strech Read Signals Width Write Signals Width ckcon.6 ckcon.5 ckcon.4 Value memaddr memrd memaddr memwr (34) 串口 0 波特率选择寄存器 ADCON 寄存器的最高有效位用于生成串口 0 的波特率 ( 参见 表 3-21) 表 3-36 ADCON 寄存器 Bit Symbol Description Type adcon.7 bd Serial Port 0 baud rate select (in modes 1 and 3) adcon.6 - adcon.5 - adcon.4 - adcon.3 - adcon.2 - adcon.1 - adcon.0 - When 1, additional internal baud rate generator is used, otherwise Timer 1 overflow is used not used, read as 0 R (35) 乘法 / 除法寄存器 MD0,MD1,MD2,MD3,MD4,MD5 MD0 MD5 是用于 MDU 操作的寄存器 关于 MDU 功能的详细描述, 请参见 3.5 乘 - 除单元 (36) 算术控制寄存器 ARCON ARCON 寄存器用于控制 MDU 操作, 并报告 MDU 当前状态 表 3-37 ARCON 寄存器 Bit Symbol Description Type arcon.7 mdef MDU Error flag MDEF R Indicates an improperly performed operation (when one of the arithmetic operations has been restarted or interrupted by a new operation). arcon.6 mdov MDU Overflow flag MDOV R Overflow occurrence in the MDU operation. arcon.5 slr Shift direction slr = 0 - shift left operation. slr = 1 - shift right operation. arcon.4 sc.4 Shift counter Web: Page 52 of 100

53 Bit Symbol Description Type arcon.3 sc.3 When set to all 0 s, normalize operation is selected. After normalization, the sc.0 sc.4 contain the number of normalizing arcon.2 sc.2 shifts performed. arcon.1 sc.1 arcon.0 sc.0 When at least one of these bit is set high shift operation is selected. The number of shifts performed is determined by the number written to sc.4.., sc.0, where sc.4 is the MSB. (37) I 2 C 数据寄存器 I2CDAT I2CDAT 寄存器包含一个从 I 2 C 总线发送或接收的字节 当这一 SFR 未处于移位状态时,CPU 可以通过 直接寻址的方式读写该 8 位 SFR 由于 I2CDAT 寄存器没有影子寄存器或双重缓冲, 用户只能在 I 2 C 中断服 务程序中读取 I2CDAT 有关 I 2 C 端口功能的详尽描述, 请见 节 I2C (38) I 2 C 地址寄存器 I2CADR I2CADR 寄存器存储 8051 I2C 作为从设备时的地址 此地址用于识别 I 2 C 总线上是否有外部设备试图 寻址该 8051 从设备 I 2 C 接口功能描述请参见 节 I2C 表 3-38 I2CADR 寄存器 Bit Symbol Description Type i2cadr.7 adr Own I 2 C slave address (7 bit) i2cadr.6 i2cadr.5 i2cadr.4 i2cadr.3 i2cadr.2 i2cadr.1 i2cadr.0 gc General Call Address Acknowledge If this bit is set, the general call address is recognized; otherwise it is ignored. (39) I 2 C 控制寄存器 I2CCON I2CCON 寄存器控制 I 2 C 接口的操作 CPU 可以通过直接寻址的方式读写该 8 位 SFR 其中, 寄存器 中 2 位受 I 2 C 硬件影响 : 当串行中断请求发生时, 硬件置 1 si,i 2 C 总线规定的 STOP 状态在出现在总线 时硬件清 0 sto 位 I 2 C 接口功能的详细描述请参见 节 I2C 关于时钟率设置, 请参见 3.9.2(3) 表 3-39 I2CCON 寄存器 Bit Symbol Description Type i2ccon.7 cr2 Clock rate bit 2 i2ccon.6 ens1 I 2 C enable bit When ens1= 0 the sdao and sclo outputs are set to 1, that drives the output pads of the chip in high impedance, and sdai and scli input signals are ignored. When ens1= 1 I 2 C component is enabled. i2ccon.5 sta START Flag When sta= 1, the I 2 C component checks the I 2 C bus status and if the bus is free a START condition is generated. i2ccon.4 sto STOP Flag Web: Page 53 of 100

54 Bit Symbol Description Type i2ccon.3 si When sto= 1 and I 2 C interface is in master mode, a STOP condition is transmitted to the I 2 C bus. Serial Interrupt Flag The si is set by hardware when one of 25 out of 26 possible I 2 C states is entered ( ). The only state that does not set the si is state F8h, which indicates that no relevant state information is available. The si flag must be cleared by software. In order to clear the si bit, 0 must be written to this bit. Writing a 1 to si bit does not change value of the si. i2ccon.2 aa Assert Acknowledge Flag When aa= 1, an acknowledge will be returned when: - the own slave address has been received - the general call address has been received while gc bit in i2cadr register was set - a data byte has been received while I 2 C was in master receiver mode - a data byte has been received while I 2 C was in slave receiver mode When aa= 0, an not acknowledge will be returned when: - a data byte has been received while I 2 C was in master receiver mode - a data byte has been received whilei 2 C was in slave receiver mode i2ccon.1 cr1 Clock rate bit 1 i2ccon.0 cr0 Clock rate bit 0 (40) I 2 C 状态寄存器 I2CSTA I2CSTA 寄存器的值反映了 I 2 C 接口电路当前状态 有关 I 2 C 接口功能详细描述, 请参考 节 I2C 表 3-40 I2CSTA 寄存器 Bit Symbol Description Type i2csta.7 - I 2 CStatus Code R i2csta.6 i2csta.5 i2csta.4 i2csta.3 i2csta.2 i2csta.1 i2csta.0 - Not implemented, read as 0 R (41) SPI 串口外设状态寄存器 SPSTA SPSTA 寄存器包含多个标志位, 有数据传送完成标志, 写冲突状态标志, ssn ( 从选择 ) 管脚 ( 模 式错误异常 ) 逻辑电平不一致 表 3-41 SPSTA 寄存器 Bit Symbol Description Type spsta.7 spif Serial Peripheral Data Transfer Flag R Set by hardware upon data transfer completion. Web: Page 54 of 100

55 Bit Symbol Description Type spsta.6 wcol Cleared by hardware when data transfer is in progress. Can be also cleared by reading the spsta register with the spif bit set, and then reading the spdat register. Write Collision Flag R Set by hardware upon write collision to spdat. Cleared by hardware upon data transfer completion when no collision has occurred. Can be also cleared by an access to spsta register and an access to spdat register. spsta.5 sserr Synchronous Serial Slave Error Flag R Set by hardware when ssn input is de-asserted before the end of receive sequence. Cleared by disabling the SPI module (clearing spen bit in spcon register). spsta.4 modf Mode Fault Flag R Set by hardware when the ssn pin level is in conflict with actual mode of the SPI controller (configured as master while externally selected as slave). Cleared by hardware when the ssn pin is at appropriate level. Can be also cleared by software by reading the spsta register with modf bit set. spsta.3 spsta.2 spsta.1 spsta.0 - not used, read as 0 R (42) SPI 串行外设控制寄存器 SPCON 串行外设控制寄存器用于配置 SPI 模块 SPCON 选择主时钟频率, 将模块配置为主设备或从设备, 选择串行时钟极性和相位, 使能 ssn 输入, 使能 / 禁止整个 SPI 模块的工作 表 3-42 SPCON 寄存器 Bit Symbol Description Type spcon.7 spr2 Serial Peripheral Rate 2 Together with spr1 and spr0 defines the clock rate in master mode. spcon.6 spen Serial Peripheral Enable When cleared disables the SPI interface. When set enables the SPI interface. spcon.5 ssdis SS Disable When cleared enables the ssn input in both Master and Slave modes. When set disables the ssn input in both Master and Slave modes. In Slave mode, this bit has no effect if cpha =0. When ssdis is set, no modf interrupt request will be generated. spcon.4 mstr Serial Peripheral Master When cleared configures the SPI as a Slave. When set configures the Web: Page 55 of 100

56 Bit Symbol Description Type spcon.3 cpol SPI as a Master. Clock Polarity When cleared, the sck is set to 0 in idle state. When set, the sck is set to 1 in idle state. spcon.2 cpha Clock Phase When cleared, data is sampled when the scki / scko leaves the idle state (see cpol ). When set, data is sampled when the scki / scko returns to idle state (see cpol ). spcon.1 spr1 Serial Peripheral Rate spcon.0 spr0 Together with spr2 specify the serial clock rate in Master mode. spr2 spr1 spr0 Serial Peripheral Rate Fclk / Fclk / Fclk / Fclk / Fclk / Fclk / Fclk / the master clock is not generated ( when cpol = 1 on the scko output is high level, otherwise is low level) (43) SPI 串行外设数据寄存器 SPDAT SPDAT 是 接收数据 寄存器的读 / 写缓冲 当向 SPDAT 写数据时, 数据被直接放置到移位寄存 器 ( 没有发送缓冲器 ) 读取 SPDAT 时, 返回位于接收缓存中的值, 而不是移位寄存器中的值 (44) SPI 串行外设从选择寄存器 SPSSN 对 SPSSN 寄存器低 4 位的读 / 写用于控制 CPU 输出信号 spssn [3:0] 对 spssn [3:0] 写入 数据可以立即出现在 SPSSN[3:0] 输出信号上 输出每一位都可以选择一个外部独立的 SPI 从设备 (45) 软件复位寄存器 SRST 软件复位可通过 SRST SFR 寄存器实现 SRST 寄存器中的内容如下 表 3-43 SRST 寄存器 Bit Symbol Description Type srst.7 - not used, read as 0 R srst.6 - srst.5 - srst.4 - srst.3 - srst.2 - srst.1 - srst.0 srstreq Software reset request. Web: Page 56 of 100

57 Bit Symbol Description Type Writing 0 value to this bit will have no effect. Single writing 1 value to this bit will have no effect. Double writing 1 value (in two consecutive instructions) will generate an internal software reset. Reading this bit will inform about the reset source: if 0 source of last reset sequence was not a software reset (hardware, watchdog or debugger reset); if 1 source of last reset sequence was a software reset (caused by double writing 1 value to the srstreq bit). 3.4 扩展特殊功能寄存器 AstroⅡ 扩展了一些专用 SFR 下表对扩展的 SFR 进行了详细描述 表 3-44 外部特殊功能寄存器映射 register locati attribute Reset value description on I2CSPISEL ABh 8 H00 Bit0: SPI interface source. must be 1 Bit1:I 2 C IO select, contro the device IO attribute 0: the IO is used as general user IO 1: the IO is used as fixed I 2 C IO Bit[7:2] Reserved ISCADDR0 Ach 8 H00 Reconfiguration start address [7:0] ISCADDR1 ADh 8 H00 Reconfiguration start address [15:8] ISCADDR2 AEh 8 H00 Reconfiguration start address [23:16] ISCADDR3 AFh 8 H00 Reconfiguration start address [31:24] MISCCON F8h 8 H00 Bit0 ISCEN: reconfiguration enable, be used to trigger the reconfiguration sequence 0: disable 1:enable BIT1 DPRAMWP: DPRAM write protect from FP 0:disable write 1:enable write Bit2 PLLLOCK: read only pll_lock, the status of pll 0: not lock 1: lock Bit3 PLLPWD: pll_pwrdn, pll power down 0: open the pll power 1: close the pll power Bit4 CLKCPUTRIG: Triggers CLKCPUON and make it active when changes from 0 to 1. Bit5 CLKO0TRIG: Triggers CLKO0CON and make it active when changes from 0 to 1. Bit6 CLKO1TRIG: Triggers CLKO1CON and make it active when changes from 0 to 1. Web: Page 57 of 100

58 Bit7 CLKO2TRIG: Triggers CLKO2CON and make it active when changes from 0 to1. CLKCPUCON F9h 8 H00 Clk configuration for clkcpu or clkper Bit[2:0] the ratio of divider 000: bypass 001: divided by 2 010: divided by 4 011: divided by 8 100: divided by : divided by : divided by : divided by 128 Bit3:switch_gclk 0: from CLKN(clock pin or OSC) 1: from PLL Bit[7:4] Reserved CLKO0CON FAh 8 H00 Clk configuration for clkout0 Bit[2:0] the ratio of divider 000: bypass 001: divided by 2 010: divided by 4 011: divided by 8 100: divided by : divided by : divided by : divided by 128 Bit3:switch_gclk 0: from CLKN(clock pin or OSC) 1: from PLL Bit[7:4] Reserved CLKO1CON FBh 8 H00 Clk configuration for clkout1 Bit[2:0] the ratio of divider 000: bypass 001: divided by 2 010: divided by 4 011: divided by 8 100: divided by : divided by : divided by : divided by 128 Bit3:switch_gclk 0: from CLKN(clock pin or OSC) 1: from PLL Web: Page 58 of 100

59 Bit[7:4] Reserved CLKO2CON FCh 8 H00 Clk configuration for clkout2 Bit[2:0] the ratio of divider 000: bypass 001: divided by 2 010: divided by 4 011: divided by 8 100: divided by : divided by : divided by : divided by 128 Bit3:switch_gclk 0: from CLKN(clock pin or OSC) 1: from PLL Bit[7:4] Reserved 注意事项 : 请谨慎使用 PLL 电源开关功能 关掉 PLL 电源时,MISCCON [7:4] 必须有一位同时置位 如果重 新打开 PLL 电源时,MISCCON [7:3] 必须同时清零 3.5 乘 - 除单元 MDU 概述 MDU 乘法 - 除法器, 是片上算术协处理器, 允许 8051 可以执行扩展的算术操作 乘法 - 除法器提供 32 位的除法和 16 位的乘法, 以及移位和规格化操作 这些操作都是无符号的整数操作 MDU 由 7 个寄存器控制, 这 7 个寄存器存储映像为特殊功能寄存器 (SFR) 算术单元允许与 CPU 之间独立的并行操作 操作数和操作结果保存在 md0 md5 寄存器中 ( 参见 3.3.3(35) 第 52 页 ) 这一模块由 arcon 寄存器 (3.3.3(36) P52) 控制 MDU 的计算都会覆盖它的操作数 MDU 操作说明 MDU 操作包含三个阶段 : (1) 装载 mdx 寄存器 MDC 执行的运算类型由 mdx 寄存器写入顺序决定 表 3-45 MDU 寄存器写入顺序 Operation 32 bit/16 bit 16 bit / 16 bit 16 bit x 16 bit shifting normalizing first write md0 D endl md0 D endl md0 M andl md0 LSB md1 D end md1 D endh md4 M erl md1 md2 D end md1 M andh md2 md3 D endh md3 MSB md4 D orl md4 D orl last write md5 D orh md5 D orh md5 M erh arcon 写入 md0 可启动后续操作 后面的写操作必须按照 表 3-45 MDU 寄存器写入顺序 中的执行, Web: Page 59 of 100

60 用于决定特定的 MDU 操作 最后一次的写操作启动所选的操作 SFR 控制器检测上述某些操作并将控制传输到算术操作 FSM 写入操作访问 md0 最后到达 md5, 其中一个写访问发生在 md2 或 md3 时, 会选中 32 位 /16 位的除法 其他情况下, 在最终写入 md5 之前, 写操作发生在 md1 或 md4, 则会选择一个 16 位 /16 位的除法或乘 法 写入 md4 选择 16 位 /16 位除法, 写入 md1 选择 乘法 在复位之后, MDU 将设置 乘法 作为默认操作 任何写入 arcon 的访问都会强制移位或规格化 (2) 执行计算 在执行操作的过程中,MDU 并行于 CPU 独立工作 表 3-46 MDU 操作执行次数 Operation Number of clock cycles Division 32bit/16bit 17 clock cycles Division 16bit/16bit 9 clock cycles Multiplication 11 clock cycles Shift min 3 clock cycles (sc = 01h) max 18 clock cycles (sc = 1Fh) Normalize min 4 clock cycles (sc <- 01h) max 19 clock cycles (sc <- 1Fh) (3) 从 mdx 寄存器中读取结果 表 3-47 MDU 寄存器读取顺序 Operation 32 bit/16 bit 16 bit / 16 bit 16 bit x 16 bit Shifting normalizing first read md0 QuoL md0 QuoL md0 PrL md0 LSB md1 Quo md1 QuoH md1 Pr md1 md2 Quo md2 Pr md2 md3 QuoH md4 RemL md4 RemL last read md5 RemH md5 RemH md3 PrH md3 MSB mdx 寄存器读取的顺序并不重要, 但是最后的读取操作 ( 从 md5 - 除法和 md3 - 乘法, 移位或规格化 ) 决定了整个计算过程的结束 ( 阶段三的最终点 ) (4) 规格化 左移操作移除存储在 md0 md3 寄存器中 32 位无符号整数变量所有前导的 0 当 md3 寄存器中的最高有效位是一个 1 时, 整个操作完成 规格化之后, arcon.4 (MSB) arcon0 (LSB) 包含已完成的左操作次数 (5) 移位 在移位操作中, 存储在 md0 md3 寄存器 ( 后者包含 MSB) 中 32 位的整数变量被左移或 右移特定位数 slr 位 ( arcon.5 ) 定义移位方向, arcon.4 arcon0 位指定移位个数 ( 一定 为非 0) 在移位操作中, 右移时 0 从最左边进入 md3, 左移时 0 从最右边进入 md0 (6) mdef 标志 (arcon,7- 表 3-37 ARCON 寄存器 ) mdef 错误标志表明运行了不正确的操作 ( 当某个算术操作重启或被新操作打断 ) 第一个写操 作到 md0 时错误判断机制自动使能, 在最后从阶段三 md3 ( 乘法或移位 / 规格 ) 或 md5 ( 除 法 ) 读取指令时错误判断机制禁用 错误标志设置条件 : MDU 操作的阶段二 ( 重启或运算中断 ), 写入 mdx 寄存器 ( md0 md5 和 arcon 中的任一个 ) Web: Page 60 of 100

61 错误标志机制使能,MDU 操作的第二阶段, 读取 mdx 寄存器 这种情况下会设置错误标志但是计算不会中断 只有读取 arcon 寄存器之后, 错误标志才会被复位 错误标志位是只读的 (7) mdov 标志 (arcon.6- 表 3-37 ARCON 寄存器 ) mdov 溢出标志在如下情况之一发生时设置 : 除 0 乘法结果大于 0000 FFFFH md3 的 MSB 设置后 ( md3.7 = 1 ), 开始规格化 MDU 中不符合上述情况的任一操作都会清零溢出标志 需注意, 溢出标志只受硬件控制, 软件不可写 3.6 中断控制器 8051 有 13 个中断源 : 8 个外部中断 ( 有些与比较 / 捕获单元中断相结合 ) 3 个定时器中断 (Timer 0,1 和 2) 2 个串口中断 (serial 0,1) 13 个中断源分为 6 个优先组 每个优先组有 4 个优先级, 可以任选其一 每个中断源都有独立标志, 向量和使能位 这些中断可以全局使能或禁用 中断源 (1) 外部中断 0 和 1 外部中断 0 和 1 可编程为低电平触发或下降沿事件触发, 这取决于 IT0 和 IT1 位 寄存器 TCON 中的 IE0 和 IE1 位是检测产生中断的标志 在边沿触发方式中,INTx 输入在每个机器周期中被采样 如果在一个周期中采样为高, 而下一个周期中为低, 则检测到了下降沿事件, 需设置 IEx 标志中断请求 同理, 上升沿事件也是这样检测出来的 标志位请求中断 由于外部中断是在每个机器周期被采样, 因此需要至少一整个机器周期的高采样结果或低采样结果 IEx 标志在中断服务程序被调用时自动清零 若选择了低电平触发方式, 则请求源会保持管脚低电平直到中断响应 IEx 标志不会由于进入中断服务程序而被硬件清零 如果继续保持中断低电平甚至在服务程序结束后还是低电平, 则处理器会从相同的中断源发送另一个中断请求, 在这种情况下 ISR 中必须能够强制外部设备释放中断请求信号 中断可以通过在软件上设置中断请求响应标志位来触发 (2) 外部中断 2 外部中断 2 可以编程为上升沿事件触发或下降沿事件触发, 这取决于 T2CON 寄存器中的 I2FR 位 T2CON 寄存器中的 I2FR 位是检测产生中断的标志 调用请求服务程序时, 标志位被自动清零 (3) 外部中断 3 外部中断 3 可以编程为上升沿事件触发或下降沿事件触发, 这取决于 T2CON 寄存器中的 I3FR 位 IRCON 寄存器中的 I3FR 位是检测产生中断的标志 此外, 标志位可以由比较 / 捕获单元 (0) 设置 ( 以及中断调用 ) 比较/ 捕获方式设置为比较方式时 (CCEN 寄存器中标志 cocal0=0,cocah0=1) 且定时器 2 中的值与比较寄存器 CRC 中的值相等时, 比较 / 捕获单元设置标志位 外部中断配置 ( 上升沿或下降沿 ) 在这里也可以应用 当产生中断时,I3FR 定义边沿, 这意味着当定时器 2 中的值与 CRC 寄存器的值不相等时也可能生成中断 Web: Page 61 of 100

62 只有在 cocal0=0 且 cocah0=1 时, 标志位由比较 / 捕获单元设置 在其他情况下, 只有当外接管脚检测到相应的边沿时才能设置标志位 不能同时使用外部中断和 CCU 中的中断 调用服务程序时, 标志位被自动清零 (4) 外部中断 4 外部中断 4 仅仅由上升沿事件触发产生, 寄存器 IRCON 中的 IEX4 位是检测中断生成的标志 此外, 标志位可以由比较 / 捕获单元 (0) 设置 ( 以及中断调用 ) 当比较/ 捕获方式设置为比较方式 (CCEN 寄存器中标志 cocal0=0,cocah0=1) 且定时器 2 中的值与比较寄存器 CC1 中的值相等时, 比较 / 捕获单元设置标志位 调用中断服务程序时, 标志位被自动清零 (5) 外部中断 5 外部中断 5 仅仅由上升沿事件触发产生, 寄存器 IRCON 中的 IEX5 位是检测中断生成的标志 此外, 标志位可以由比较 / 捕获单元 (0) 设置 ( 以及中断调用 ) 当比较/ 捕获方式设置为比较方式 (CCEN 寄存器中标志 cocal0=0,cocah0=1) 且定时器 2 中的值与比较寄存器 CC2 中的值相等时, 比较 / 捕获单元设置标志位 调用中断服务程序时, 标志位被自动清零 (6) 外部中断 6 外部中断 6 仅仅由上升沿事件触发产生, 寄存器 IRCON 中的 IEX6 位是检测中断生成的标志 此外, 标志位可以由比较 / 捕获单元 (0) 设置 ( 以及中断调用 ) 当比较/ 捕获方式设置为比较方式 (CCEN 寄存器中标志 cocal0=0,cocah0=1) 且定时器 2 中的值与比较寄存器 CC3 中的值相等时, 比较 / 捕获单元设置标志位 (7) 外部中断 7 外部中断 7 仅仅由上升沿事件触发产生, 寄存器 IRCON 中的 IEX7 位是检测中断生成的标志 调用中断服务程序时, 标志位被自动清零 (8) 定时器中断定时器 0 和 1 由 TF0 和 TF1 标志生成 这些标志由定时器 0 和 1 中的溢出 int 设置 当定时器中断响应时,TF0 和 TF1 被硬件自动清零 定时器 2 中断是由 TF2 中断与 EXF2 中断逻辑或产生的 这些标志由定时器 2 操作中的溢出或捕获 / 重载事件设置 当定时器 2 中断执行时, 硬件不会清零标志 软件需要查询 TF2 和 EXF2 判断中断的来源并清零恰当的标志 (9) 串口中断串口 0 在接收或发送时能够产生中断 接收或发送完成后, 硬件自动把 S0CON SFR 中的 RI0 或 TI0 位置为 1 这些位不会被硬件自动清零, 需要用户使用软件清零 串口 1 可以在接收或发送时产生中断 串口 1 有两种中断源, 分别被 S1CON SFR 中的 RI1 和 TI1 位获得 这些位不会被硬件自动清零, 需要用户使用软件清零 (10) 使能 / 禁用位设置或清空在 IE0, IE1, IE2 SFR 中相应的位, 可以独立的使能或禁用每个中断源 IE0 有一个全局使能 / 禁用位 EAL, 清零 EAL 位会即刻禁用所有中断 中断优先级 8051 的中断源可分为 6 个中断组 每组都有 4 个优先级可供选择 给 IP0 和 IP1 寄存器设置恰当值可以设定 6 组中断源的优先级 详情请参见 表 3-29 优先组 Web: Page 62 of 100

63 中断组内部的中断优先结构由硬件确定 第一列中断源有最高优先级 ( 限于本组内 ), 第二列中断源有中等优先级, 第三列中断源的优先级最低 组内中断优先级不可更改 中断组之间也有中断优先结构 group0 有最高优先级,group5 的优先级最低 中断组之间的优先权可以通过改变优先级 ( 优先级可从 0 到 3 设置 ) 来实现 详情参见表 3-30 优先级 调用 1 个以上的中断时, 所有优先类型都要考虑在内 最重要的是优先级由 IP0 和 IP1 寄存器设置的, 其次是组之间的自然优先级, 最后是组内部的优先权 赋予中断最高优先权 ( 以第一顺序实现 ), 需要以下步骤 : 从各组之中选择拥有最高优先权的几个组 最高优先权组中选取一个具有最高自然优先级的组 再从最高优先权组中选择内部最高优先权的中断重要的是当前运行的中断服务子程序只能被更高优先级的中断打断 相同优先级或低优先级不能打断正在运行的中断服务子程序 因此服务程序中最多可以同时有 4 个中断 注意 : 当中断优先级为 X 的中断提出请求时, 即使在被调用的中断服务子程序中改变了该中断源的中断优先级, 该中断服务也仅仅能被优先级高于 X 的中断请求打断 中断源概要表 3-48 描述了中断源 标志位 向量地址 使能位 中断组 优先权位和组优先级 表 3-48 中断源概要 Source Flag Vector Enable Interrupt Interrupt Priority in Flag address bit Group Priority group cleared by External IE0 0003H EX0 0 Highest Hardware, IP1.0, IP0.0 Interrupt 0 software Timer0 TF0 000BH ET0 1 Highest Hardware, IP1.1, IP0.1 overflow software External IE1 0013H EX1 2 Highest Hardware, IP1.2, IP0.2 Interrupt 1 software Timer1 TF1 001BH ET1 3 Highest Hardware, IP1.3, IP0.3 overflow software Serial Port 0 interrupt Timer2 interrupt External Interrupt 7 External Interrupt 2 External Interrupt 3 External Interrupt 4 External Interrupt 5 RI H ES0 4 Highest Software IP1.4, IP0.4 TI0 TF2 002BH ET2 5 Highest Software IP1.5, IP0.5 IEX7 0043H EX7 0 Lowest Hardware, IP1.0, IP0.0 software IEX2 004BH EX2 1 Lowest Hardware, IP1.1, IP0.1 software IEX3 0053H EX3 2 Lowest Hardware, IP1.2, IP0.2 software IEX4 005BH EX4 3 Lowest Hardware, IP1.3, IP0.3 software IEX5 0063H EX5 4 Lowest Hardware, IP1.4, IP0.4 software External IEX6 006BH EX6 5 IP1.5, IP0.5 Lowest Hardware, Web: Page 63 of 100

64 Source Flag Vector Enable Interrupt Interrupt Priority in Flag address bit Group Priority group cleared by Interrupt 6 software Serial Port 1 interrupt RI1 + TI1 0083H ES1 0 IP1.0, IP0.0 Middle Software 3.7 定时器 AstroⅡ 中有三个定时器 ( 定时器 0, 定时器 1 和定时器 2) 和一个看门狗 (WDT) 定时器 0 (1) 概述定时器 0 是 16 位的寄存器, 可以配置为计数器或定时器工作模式 同样可以当做 SFR 访问 : th0 和 tl0 (P (13) 定时器 0 TH0,TL0) (2) 功能方式定时器 0 支持多方式 方式 0 和方式 1 方式 0 中, 定时器 0 配置成 13 位的寄存器 ( tl0 =5 位, th0 =8 位 ) tl0 中较高的 3 位固定可以忽略 方式 1 中, 定时器 0 配置成 16 位的寄存器方式 2 此方式下定时器 0 配置为带有常数自动重装入的 8 位寄存器 方式 3 方式 3 中, 定时器 0 配置为 1 个 8 位的定时 / 计数器和一个 8 位的定时器 当定时器 0 在方式 3 下工作时, 定时器 1 仍可被串口作为波特率发生器继续在其他方式下使用, 或者其它不需要调用从定时器 1 中断的应用 (3) 说明定时器方式下, 定时器 0 每 12 个时钟周期中加 1 在计数器方式下, 定时器 0 相应的输入引脚 t0 处检测到下降沿时, 定时器 0 递增 由于需要 2 个时钟周期来识别一个 1-to-0 事件, 最大输入计数率是振荡器频率的 1/2 占空比没有限制, 但为保证正确的识别 0 1 状态, 输入 0 或 1 电平应至少在一个时钟周期内保持稳定 定时器 0 有 4 种工作方式可供选择 2 个特殊功能寄存器 : tmod ( 参见 P (12) 定时器模式寄存器 ) 和 tcon (0) 都可用于选择恰当的方式 方式 0 下的定时 / 计数器 0 调用此方式需要设置 tmod 寄存器的标志 tmod[1:0] = 00 ( 参见 P (12) 定时器模式寄存器 ) 在此方式中, 计数率来自定时器模式中的 clk 输入或计数器模式的 t0 输入 tmod[2] 置 0 时选定时器工作模式, 否则就选计数器工作模式 定时 / 计数器可分为一个低字节一个高字节, 共计 2 个 8 位的寄存器 低字节在此工作方式下又被分 Web: Page 64 of 100

65 成 2 个部分 低 5 位和高 3 位, 低字节的低 5 位与高字节组成为一个 13 位的定时 \ 计数器, 且每 12 个时钟周期或当外部信号 t0 检测到下降沿时加 1 当定时 / 计数器 0 溢出时, 通过输出引脚 tf0 置位标志 tcon[5] 并发出中断请求 当中断响应信号 ( int0ack ) 到达时, 此位被硬件清零 定时 / 计数器可以由软件和硬件控制 运行定时器 0 则必须置位 tcon[4] 标志 使能门控标志 tmod[3] 时, 可以通过输入信号 int0 停止计数 方式 1 下的定时 / 计数器 0 调用此方式需要设置 tmod 寄存器的标志 tmod[1:0] = 01 ( 参见 P (12) 定时器模式寄存器 ) 此方式与方式 0 唯一的不同在于, 低字节不会被分为 5 位和 3 位 2 个部分, 而是整个低字节作为计数器 定时 / 计数器 0 在方式 1 下是一个 16 位的计数器 方式 2 下的定时 / 计数器 0 调用此方式需要设置 tmod 寄存器的标志 tmod[1:0] = 10 ( 参见 P (12) 定时器模式寄存器 ) 此工作方式中, 计数率来自定时器模式中的 clk 输入或计数器模式的 t0 输入 tmod[2] 位置 0 选取定时器工作模式, 直 1 则选取计数器工作模式 低字节 ( tl0 ) 每 12 个时钟周期或当外部信号 t0 的值从 1 变为 0 时, 加 1 定时 / 计数器工作在 8 位常数自动重装入方式下 定时 / 计数器的低字节溢出时, 通过输出引脚 tf0 置位标志 tcon[5] 并发出中断请求 当中断响应确认信号 ( int0ack ) 到达时, 此位被硬件清零 此外, 当溢出发生时, 低字节 ( tl0 ) 会从高字节 ( th0 ) 重新载入新值 定时 / 计数器由软件和硬件控制 运行定时器 0 则必须置位 tcon[4] 标志, 使能门控标志 tmod[3] 时, 可以通过输入信号 int0 停止计数 方式 3 下的定时 / 计数器 0 调用此方式需要设置 tmod 寄存器的标志 tmod[1:0] = 00 ( 参见 P (12) 定时器模式寄存器 ) 此工作方式中, 计数率来自定时器模式中的 clk 输入或计数器模式的 t0 的输入 通过清零 tmod[2] 标志选择定时器选项, 否则选取计数器选项 低字节 ( tl0 ) 在每 12 个时钟周期或外部信号 t0 的值从 1 变为 0 时加 1 高字节( tl0 ) 每 12 个时钟周期加 1 当定时/ 计数器的低字节溢出时, 通过输出引脚 tf0 置位标志 tcon[5] 并发出中断请求 当定时 / 计数器的高字节溢出时, 通过输出引脚 tf1 置位标志 tcon[7] 并发出中断请求 当中断响应确认信号 ( int0ack, int1ack ) 分别到达时, 硬件清零相应的位 这种工作方式下, 定时 / 计数器 0 的低字节由 tcon[4] 位和 int0 输入控制 将 tcon[4] 位置 1 可使能定时器工作模式 当强制 int0 为 0 并开启门控位 tmd[3] 时, int0 停止计数 高字节只由 tcon[6] 位控制, 设置后使能计数 定时器 1 (1) 概述定时器 1 是 16 位寄存器, 可以配置为计数器或定时器工作模式 可以作为 SFR 访问 : tl1, th1 (P (14)) (2) 功能方式方式 0 和方式 1 方式 0 时, 定时器 1 配置为 13 位的寄存器 ( tl1 =5 位, th1 =8 位 ) tl1 中较高的 3 个位 Web: Page 65 of 100

66 固定不变可忽略 方式 1 时, 定时器 1 被配置为 16 位的计数器 方式 2 在此方式中, 定时器 1 被配置为带有常数自动重装入的 8 位计数器 方式 3 在方式 3 中, 定时器 1 不启用 (3) 说明在定时器模式下, 定时器 1 每 12 个时钟周期加 1 在计数器模式下, 当定时器 1 的相应输入引脚 t1 处检测到下降沿时定时器 1 加 1 由于需要 2 个时钟周期来识别一个 1 到 0 的事件, 最大输入计数率为振荡器频率的 1/2 尽管对占空比没有限制, 但为确保正确识别 0 1 状态, 输入 0 或 1 电平应至少在一个时钟周期内保持稳定 定时器 1 有四种工作方式可供选择 2 个特殊功能寄存器 : tmod (P41) 和 tcon (0), 用于选择适当的工作方式 方式 0 下的定时 / 计数器 1 调用此方式需设置 tmod 寄存器的 tm0d[5:4] = 00 (P41) 在这种方式下, 计数率源于定时器模式的 clk 输入或计数器模式的 t1 输入 tmod[6] 位置 0 选定时器模式, 置 1 则选计数器模式 定时 / 计数器 1 分成一个低字节一个高字节, 共计 2 个 8 位的寄存器 低字节又被分成两个部分 低 5 位和高 3 位, 低字节的低五位和高字节组成一个 13 位的计数器, 且每 12 个时钟周期或外部信号 t1 从 1 变成 0 时加 1 当定时/ 计数器 1 溢出时, 通过输出引脚 tf1 置位标志 tcon[7] 并发出中断请求 当中断响应确认信号 ( int1ack ) 到达时, 硬件清零此位 定时 / 计数器 1 可以通过软件或硬件进行控制 运行定时器 1 则必须置位 tcon[6] 标志 使能门控标志 tmod[7] 时, 可以通过输入信号 int1 停止计数 方式 1 下的定时 / 计数器 1 调用此方式需设置 tmod 寄存器 tm0d[5:4] = 01 (P41) 此方式仅有一处与方式 0 不同, 即低字节不被分成 5 位和 3 位, 而是整个低字节作为一个计数器 定时 / 计数器 1 在方式 1 下是一个 16 位的计数器 方式 2 下的定时 / 计数器 1 调用此方式需要置位 tmod 寄存器 tmod[5:4] = 10 (P41) 在此方式中, 计数率源于定时器模式中的输入 clk 或计数器选模式的输入 t1 tmod[6] 置位 0 选择定时器工作模式, 置 1 则选计数器工作模式 定时 / 计数器工作在 8 位常数自动重装入方式下 12 个时钟周期或外部信号 t0 的值从 1 变为 0 时, 低字节 ( tl0 ) 加 1 当定时/ 计数器的低字节溢出时, 通过输出引脚 tf1 置位标志 tcon[7] 并发出中断请求 当中断响应确认信号 ( int1ack ) 到达时, 硬件清零该位 此外, 当溢出发生时, 低字节 ( tl0 ) 会从高字节 ( th0 ) 重新载入数值 定时 / 计数器可以通过软件和硬件控制 运行定时器 1 必须置位 tcon[6] 标志 使能门控标志 tmod[7] 时, 可以通过输入信号 int1 停止计数 方式 3 下的定时 / 计数器 1 调用此方式需要设置 tmod 寄存器 tmod[5:4] = 11 (P41) 在此方式中, 定时 / 计数器 1 Web: Page 66 of 100

67 禁用 ( 方式 3 中只能运行定时 / 计数器 0) 定时器 2( 带有比较 / 捕获单元 ) (1) 概述定时器 2 可以配置为计数器或定时工作模式, 或者配置为定时器 2 的子模块比较 / 捕获单元 (2) 定时器 2 说明定时器 2 可以作为定时器 事件计数器 门控定时器进行操作 定时器方式调用这种工作方式需设置寄存器 t2con 标志, t2i0=1 和 t2i1=0 ( 见 P42) 在此方式中, 计数率源于定时器选项中的输入 clk 根据预分频系数, 定时器 2 每 12 个时钟周期或 24 个时钟周期加 1 寄存器 t2con 的 t2ps 选择预分频系数 (P42) 当 t2ps =0 时, 定时器每 12 个时钟周期自动加 1, 否则每 24 个时钟周期加 1 事件计数器方式调用此方式需置位寄存器 t2con 标志 t2i0=1 和 t2i1=1 ( 见 P42) 此方式下, 当外部信号 t2 从 1 变成 0 时, 定时器 2 加 1 在每个时钟的上升沿, 输入 t2 都进行采样 检测到切换的下一个时钟周期是定时器 2 加 1 最大计数率是时钟频率的 1/2 门控定时器方式调用此方式需置位寄存器 t2con 标志 t2i0=1 和 t2i1=1 ( 见 P42) 定时器 2 每 12 或 24 个时钟周期加 1( 由 t2ps 标志决定 ), 但除此以外还由外部信号 t2 门控 当 t2 =0 时定时器 2 停止工作 t2 输入被采样寄存后停止定时器 2 自增 定时器 2 自动重装入寄存器 crc 中的 16 位常数重装入可以在以下 2 种方式下运行 : 重装入方式 0: 重装入启动信号是由定时器 2 溢出产生的 ( 自动重装入 ); 重装入方式 1: 重装入启动信号是由相应的输入引脚 t2ex 负跳变产生的 (3) 比较功能说明比较 / 捕获单元包括四个寄存器 cc1, cc2, cc3 和 cc4 (P43) 和 crc (P44) 每个寄存器都可以配置在比较器方式下工作 寄存器内存储的值会与定时器 2 中的值相比较 比较器输出驱动 p1 端口 ( p1.0 p1.3 ) 的低 4 位 : p1.0 是与寄存器 crc 关联的比较输出结果 ( ccubus.0 ); p1.1 是与寄存器 cc1 关联的比较输出结果 ( ccubus.1 ); p1.2 是与寄存器 cc2 关联的比较输出结果 ( ccubus.2 ); p1.3 是与寄存器 cc3 关联的比较输出结果 ( ccubus.3 ) 由寄存器 t2con 中的 t2cm 位选择两种比较方式 比较方式 0 调用此方式需设定寄存器 t2con 标志 t2cm =0( 见 P42) 当定时器 2 中的值等于比较寄存器中的值时, 比较器输出由低变高 当定时器 2 溢出时, 输出又变低 此方式下对端口 1( p1 ) 的写操作无效, 因为内部总线的输入线路和写入寄存器线路不连接 Web: Page 67 of 100

68 比较方式 1 调用这种方式, 需置 1 寄存器 t2con 的标志 t2cm (P42) 比较方式 1 中, 输出信号的切换由软件决定 一个定时器 2 溢出不会引起输出改变 此方式下, 两种信号输出切换都可以被控制 先将值写入 影子寄存器 中,compare 信号有效后, 这个值会被传输到输出寄存器中 捕获功能说明 4 个 16 位的 CCU 寄存器, 都可配置在捕获方式下运行 此方式下, 定时 / 计数器实际值会根据外部事件 (0 方式 ) 或软件写操作 (1 方式 ) 保存在 CCU 寄存器中 捕获方式 0 方式 0 下, 捕获定时器 2 内容的条件 : 输入 cc1 中检测到上升沿 ( cc1 寄存器在捕获方式下运行 ) 输入 cc2 中检测到上升沿 ( cc2 寄存器在捕获方式下运行 ) 输入 cc3 中检测到上升沿 ( cc3 寄存器在捕获方式下运行 ) 输入 cc0 中检测到上升沿或下降沿, 取决于 i3fr 位 ( crc 寄存器在捕获方式下运行 ) 定时器 2 中的内容会被适当的捕获寄存器锁存 此方式下不会产生中断请求 捕获方式 1 方式 1 中, 定时器 2 捕获操作是由任意写入特定捕获寄存器低位字节的操作引起的 此功能与写入捕获寄存器的值无关 定时器 2 中的内容会被恰当的捕获寄存器锁存 此方式不产生中断请求 3.8 看门狗 (1) 概述看门狗是 15 位的计数器, 每 24 或 384 个时钟周期加 1 用于提供系统监管, 可防止软 硬件崩溃 如果软件不能在 或 个时钟周期 ( 使用 12MHz 时钟 65ms 或 1s) 内刷新看门狗, 会产生内部复位 (2) 说明看门狗包含一个 15 位的计数器 ( 不能作为 SFR 访问 ), 常数自动重装入寄存器 wdtrel (P46), 前置 2 分频 16 分频和控制逻辑 看门狗的计数率取决于 wdtrel 寄存器的 MSB 当 wdtrel.7 =1 时, 看门狗每 12*32=384 个时钟周期加 1, 则整个周期长达 12*32*256*128= 个时钟周期 当 wdtrel.7 =0 时, 看门狗每 12*2=24 个时钟周期加 1, 整个周期长达 12*2*256*128= 个时钟周期 当 wdt_tm 测试方式输入置为 1 时, 看门狗的计数率为 clkper 时钟频 ( 所有分频器 1/12, 1/8, 1 / 2,1/16 等等都被删除 ), 可缩短看门狗溢出所需要的时间 ( 用于进行验证 ) 启动步骤启动看门狗有两种方式 一种方式是硬件自动启动, 在外部复位信号有效时检测输入信号 swd 的电平 swd 在复位信号变低之前保持高电平, 此时看门狗从默认设置下自动运行 ( 所有寄存器都置为 0) 另一个方法是用软件启动看门狗 置 1 ien1 寄存器中的 swdt 标志来启动看门狗 (P47) 仅置位 swdt 标志来启动看门狗, 不能自动对重装入看门狗定时器重装入 Web: Page 68 of 100

69 一旦启动, 只能在硬件使用 reset 引脚复位时禁用 swd 输入引脚, 才能停止看门狗 当看门狗计数器进入 7FFCh 状态, wdts 输出信号有效, 产生内部复位 ip0 寄存器 (P49) 的标志 wdts 因看门狗复位而复位, 因外部硬件 reset 信号而清零 wdts 信号不能使运行中的看门狗复位 当 wdts 信号从 7FFFh 溢出到 0000h, wdts 的输出无效, 而 ip0 寄存器的 wdts 标志置 1 从而允许软件查询复位是由外部输入引起或看门狗超时引起 ip0 寄存器的标志 wdts 也可由软件修改 刷新看门狗看门狗必需定时刷新以防复位请求信号 ( wdts ) 有效 编程人员需要使用两条俩徐的指令来实现对看门狗的刷新 第一条指令置位 ien0 寄存器中的 wdt ( 参照表 3-24 IEN0 寄存器 ), 第二条指令置位 ien1 寄存器中的 swdt ( 参见表 3-25 IEN1 寄存器 ) wdt 和 swdt 之间的置 1 操作最大允许延时为 1 个指令周期 ( 即这 2 个标志的置位指令不允许被其它指令隔开 ) 置位后, wdt 标志自动清零 这样无论 swdt 是否置位, 都可以防止看门狗自动重装入 看门狗定时器的 7 个高位自动重装入 wdtrel ( 参见 P46) 的值, wdtrel 中的值越大, 看门狗刷新所需的周期越短 3.9 I 2 C I 2 C 概述 AstroⅡ 集成了一个符合 Philips I 2 C 总线特性的 I 2 C 总线外设, 支持 I 2 C 总线的所有传输模式 I 2 C 使用 2 条总线在设备之间传输信息, scl 为串行时钟线, sda 为串行数据线 AstroⅡ 的 I 2 C2 线连到 AstroⅡ 固定的 I/O 上, 需要在总线外部用电阻上拉 说明与总线连接的每个设备都有唯一的地址 I 2 C 是真正的多主控总线, 能够实现包括冲突 检测 仲裁等功能以防止两个或多个控制同时发出数据传输而造成数据失效 (1) 操作模式 I 2 C 执行 8 比特的双向数据传输, 可以运行下面四种模式 : 主传输模式 scl 输出连续时钟时, 通过 sda 输出连续数据 主接收模式 scl 输出连续时钟, 通过 sda 接收连续数据 从接收模式通过 sda 和 scl 接受连续数据和连续时钟 从传输模式连续数据通过 sda 传输, 通过 scl 输入连续时钟 (2) 仲裁在主模式中, 仲裁逻辑检验 sda 上的每个传输高状态 ( 1 ), 若总线上的其他装置重新写了高状态并将 sda 线拉回低状态 ( 0 ), 仲裁将会丢失,I 2 C 会立即从主传输模式变为从接收模式 (3) 串行时钟生成器当 I 2 C 处在主模式时, 可编程的时钟脉冲生成器产生 scl 时钟脉冲 当 I 2 C 在从属模式下时, 时钟生成器被抑制 时钟生成器的功能由 i2ccon 寄存器的 cr0, cr1, cr2 等比特控制 ( 参见 P (39) I2C 控制寄存器 I2CCON) 下表显示了 clko 在主模式下可能的频率 表中的 bclk 输入与 Timer1 Web: Page 69 of 100

70 输出溢出相关联 这表明 I 2 C 的波特率可由 Timer1 控制 表 3-49 I 2 C 时钟频率比特设置 cr2 cr1 cr0 Bit frequency Clk divided by 6 MHz 12 MHz 16 MHz 24 MHz bclk 输入 8 分频 (4) 地址比较器 接收到的 7 位大小的从地址会与 I 2 C 自己的从地址相比较 自身的从地址可以通过 i2cadr 寄存器 ( 参见 P (38)) 设置 同样, 接收到的第一个字节也会和广播地址 (00H) 进行比较, 这取决于 i2cadr 寄存器的 gc 位 ( 参见 P (38)) 如果相等, 则设置 i2ccon 寄存器的 si 位 ( 参 见 P (39)) 并请求中断 (5) 特殊功能寄存器 微处理器通过四个特殊功能寄存器连接到 I 2 C 上 : i2ccon ( 控制寄存器, 第 53 页 ), i2csta ( 状 态寄存器, 第 54 页 ), i2cdat ( 数据寄存器, 第 53 页 ), i2cadr ( 特有从地址寄存器, 第 53 页 ) i2ccon 寄存器包含全局 I2C 启动比特 ens1, 时钟频设置比特 ( cr0, cr1, cr2, 参见表 3-39 I2CCON 寄存器 ) i2ccon 寄存器提供启动将开始停止到 I 2 C 总线的标志 ( sta 和 sto 比特 ), 以及传输确认标志 aa 当检测到主控制 FSM 有变化时, i2ccon 提供由硬件设置的中断请求 si 标志 更多 FSM 细节, 请参见 i2csta 寄存器描述 i2csta 寄存器反映了 I 2 C 控制器的主要状态 寄存器的低三位一直是 0 有 26 个可能状态编码, 分别在表 3-50 表 3-54 有详述, 其中的 25 个有 I2C FSM 状态中任一状态进入时, 设置 si 标志 ( 参 见 P (39)), 产生中断请求 唯一不生成中断的状态是 F8h 状态 必须由软件向 si 位中写入 0 才能清除标志 写入 1 不会改变 si 中的值 i2cdat 寄存器存放 I 2 C 总线传输的一字节或 I 2 C 总线接收到的一字节 i2cdat 寄存器不能两 次缓冲, 所以仅当 I 2 C 中断时 MCU 才能正确读取接收到的数据 i2cadr 寄存器包含 I 2 C 组件的特有从地址, 以及允许确认广播地址的 gc 标志 共用相同向量的 I 2 C 中断作为外部中断 7 si 标志在进入中断控制器 (ISR) 之前, 与外部中断 7 边沿标志做或运算 为检测真实中断源, si 标志须被中断服务程序检测 由于外部中断 7 标志在引导 服务子程序后会被自动清除, 则只有 si 标志带有真实中断源的信息 下表所示, SLA 指从地址, R 指 位 =1 与从地址一起传输, W 指 位 =0 与从地 址一起传输 表 3-50 主传输器模式下的 I 2 C 状态 Status Status of the I 2 C Application software response code to/from I2CDAT to I2CCON sta sto si aa 08H START condition Load SLA+W X 0 0 X has been Next action taken by the I 2 C hardware SLA+W will be transmitted ACK will be received Web: Page 70 of 100

71 Status Status of the I 2 C code transmitted 10H Repeated START condition has been transmitted 18H SLA+W has been transmitted; ACK has been received 20H SLA+W has been transmitted; not ACK has been received 28H Data byte in i2cdat has been transmitted; ACK has been received Application software response Next action taken by the I 2 C to/from I2CDAT to I2CCON hardware sta sto si aa Load SLA+W or X 0 0 X As above Load SLA+R X 0 0 X SLA+R will be transmitted I 2 C will be switched to master receiver mode Load data byte X Data byte will be transmitted; ACK will be received or no action X Repeated START will be transmitted; or no action X STOP condition will be transmitted; the sto flag will be reset or no action X STOP condition followed by a START condition will be transmitted; the sto flag will be reset Load data byte X Data byte will be transmitted; ACK will be received or no action X Repeated START will be transmitted; or no action X STOP condition will be transmitted; the sto flag will be reset or no action X STOP condition followed by a START condition will be transmitted; the sto flag will be reset Load data byte X Data byte will be transmitted; ACK bit will be received or no action X Repeated START will be transmitted or no action X STOP condition will be transmitted; the sto flag will be reset or no action X STOP condition followed by a START condition will be transmitted; sto flag will be reset Web: Page 71 of 100

72 Status Status of the I 2 C code 30H Data byte in i2cdat has been transmitted 38H Arbitration lost in SLA+ or data bytes Application software response Next action taken by the I 2 C to/from I2CDAT to I2CCON hardware sta sto si aa Data byte X Data byte will be transmitted; ACK will be received or no action X Repeated START will be transmitted; or no action X STOP condition will be transmitted; sto flag will be reset or no action X STOP condition followed by a START condition will be transmitted; sto flag will be reset No action X I 2 C bus will be released; the not addressed slave state will be entered or no action X A START condition will be transmitted when the bus becomes free 表 3-51 主接收器模式下的 I 2 C 状态 Status code Status of the I 2 C Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa 08H START condition has been transmitted 10H Repeated START condition has been transmitted 38H Arbitration lost in not ACK bit 40H SLA+R has been transmitted; ACK Load SLA+R X 0 0 X SLA+R will be transmitted; ACK will be received Load SLA+R or X 0 0 X As above Load X 0 0 X SLA+W will be transmitted; I 2 C SLA+W will be switched to master transmitter mode No X I 2 C bus will be released; I 2 C will action or enter a slave mode no action X A start condition will be transmitted when the bus becomes free No Data byte will be received; action or has been received no action not ACK will be returned Data byte will be received; ACK Web: Page 72 of 100

73 Status Status of the I 2 C code 48H SLA+R has been transmitted; ACK has been received 50H Data byte has been received; ACK has been returned 58H Data byte has been received; ACK has been returned Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa will be returned No X Repeated START condition will action be transmitted no action X STOP condition will be transmitted; the sto flag will be reset no action X STOP condition followed by START condition will be transmitted; the sto flag will be reset Read Data byte will be received; not data ACK will be returned byte or read Data byte will be received; ACK data will be returned byte Read X Repeated START condition will data be transmitted byte or read X STOP condition will be data transmitted; the sto flag will be byte or reset read X STOP condition followed by data START condition will be byte transmitted; the sto flag will be reset 表 3-52 从属接收器模式下 I 2 C 状态 Status code Status of the I 2 C Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa 60H Own SLA+W has No X Data byte will be received and been received; action not ACK will be returned ACK has been or returned no action X Data byte will be received and ACK will be returned 68H Arbitration lost in No X Data byte will be received and SLA+ as master; action not ACK will be returned Web: Page 73 of 100

74 Status code Status of the I 2 C Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa own SLA+W has or been received, no X Data byte will be received and ACK returned action ACK will be returned 70H General call No X Data byte will be received and address (00H) has action not ACK will be returned been received; or ACK has been no X Data byte will be received and returned action ACK will be returned 78H Arbitration lost in No X Data byte will be received and SLA+ as action or not ACK will be returned master; general call address has been no action X Data byte will be received and ACK will be returned received, ACK returned 80H Previously addressed with own SLV address; DATA has been received; ACK returned 88H Previously addressed with own SLA; DATA byte has been received; not ACK returned Read data byte or X Data byte will be received and not ACK will be returned read X Data byte will be received and data ACK will be returned byte Read Switched to not addressed slave data mode; no recognition of own slave byte or address or general call address read Switched to not addressed slave data mode; own slave address or byte or general call address will be recognized read Switched to not addressed slave data mode; no recognition of own slave byte or address or general call address; START condition will be transmitted when the bus becomes free read Switched to not addressed slave data mode; own slave address or byte general call address will be recognized; START condition will be transmitted when the bus becomes free 90H Previously Read X Data byte will be received and Web: Page 74 of 100

75 Status code 98H A0H Status of the I 2 C addressed with general call address; DATA has been received; ACK returned Previously addressed with general call address; DATA has been received; ACK returned STOP condition or repeated START condition has been received while still addressed as SLV/REC or SLV/TRX Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa data not ACK will be returned byte or read data X Data byte will be received and ACK will be returned byte Read data byte or Switched to not addressed slave mode; no recognition of own slave address or general call address read Switched to not addressed slave data mode; own slave address or byte or general call address will be recognized read data byte or Switched to not addressed slave mode; no recognition of own slave address or general call address; START condition will be transmitted when the bus becomes free read Switched to not addressed slave data mode; own slave address or byte general call address will be recognized; START condition will be transmitted when the bus becomes free No Switched to not addressed slave action mode; no recognition of own slave or address or general call address no Switched to not addressed slave action mode; own slave address or or general call address will be recognized no Switched to not addressed slave action mode; no recognition of own slave or address or general call address; START condition will be transmitted when the bus becomes free no Switched to not addressed slave action mode; own slave address or general call address will be Web: Page 75 of 100

76 Status Status of the I 2 C Application software Next action taken by the I 2 C code response hardware to/from to i2ccon I2CDAT sta sto si aa recognized; START condition will be transmitted when the bus becomes free 表 3-53 从属传输器模式下的 I 2 C 状态 Status code A8H Status of the I 2 C Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa Own SLA+R has been received; ACK has been returned B0H Arbitration lost in SLA+ as master; own SLA+R has been received; ACK has been returned B8H Data byte has been transmitted; ACK has been received C0H Data byte has been transmitted; not ACK has been received Load X Last data byte will be data byte or transmitted and ACK will be received load X Data byte will be transmitted; data ACK will be received byte Load X Last data byte will be data transmitted and ACK will be byte or received load X Data byte will be transmitted; data ACK will be received byte Load X Last data byte will be data transmitted and ACK will be byte or received load X Data byte will be transmitted; data ACK will be received byte No Switched to not addressed action slave mode; no recognition of or own slave address or general call address no Switched to not addressed action slave mode; own slave address or or general call address will be recognized no Switched to not addressed action slave mode; no recognition of or own slave address or general call address; START condition will be transmitted when the bus Web: Page 76 of 100

77 Status code C8H Status of the I 2 C Last data byte has been transmitted; ACK has been received Application software response Next action taken by the I 2 C hardware to/from to i2ccon I2CDAT sta sto si aa becomes free no Switched to not addressed action slave mode; own slave address or general call address will be recognized; START condition will be transmitted when the bus becomes free No Switched to not addressed action slave mode; no recognition of or own slave address or general call address no Switched to not addressed action slave mode; own slave address or or general call address will be recognized no Switched to not addressed action slave mode; no recognition of or own slave address or general call address; START condition will be transmitted when the bus becomes free no Switched to not addressed action slave mode; own slave address or general call address will be recognized; START condition will be transmitted when the bus becomes free 表 3-54 I 2 C 状态 混合状态 Status Status of the I 2 C code F8H No relevant state Application software response to/from to i2ccon I2CDAT sta sto si aa No No action action Next action taken by the I 2 C hardware Wait or proceed current transfer Web: Page 77 of 100

78 Status code 00H Status of the I 2 C information available; si=0 Bus error during MST or selected slave modes Application software Next action taken by the I 2 C hardware response to/from to i2ccon I2CDAT sta sto si aa No X Only the internal hardware is affected in action the master or addressed slave modes. In all cases, the bus is released and I 2 C is switched to the not addressed slave mode. The sto flag is reset SPI 概述 AstorII 的 SPI 接口可以实现全双工传输 同步 串行通讯 SPI 模块可以设置为主机或从机, 并具有以下特征 : 全双工传输 三线同步传输器 主 从模式 七个 SPI 主波特率 从机时钟率高达 Fclk/4 3 可编程的极性和相位串行时钟 8 位数据传输, 最高位 (MSB) 先传, 最低位 (LSB) 后传 4 位从机选择输出 说明 SPI 模块包括 SFR 和 INT 中断控制模块以及 TR 传输模块 (1) 特殊功能寄存器 SPI 模块中有三个特殊功能寄存器 表 3-55 SPI 单元特殊功能寄存器 Register Address Reset value Description spcon E2h 14H Serial Peripheral Control register spsta E1h 00H Serial Peripheral Status register spdat E3h 00H Serial Peripheral Data register spssn E4h FFH Serial Peripheral Slave Select register spcon 寄存器 ( 参见表 3-42 SPCON 寄存器 ) 用于配置 SPI 模块 可以控制主时钟输出率 ( spr0, spr1, spr2 位 ), 时钟极性 ( cpol ) 和时钟相位 ( cpha ), 可以将 SPI 配置为主或从 ( mstr ), 允许或禁用 ssn 输入 ( ssdis ) 以及使能或禁用整个 SPI( spen ) 3 Fclk 为 8051 的时钟频率 Web: Page 78 of 100

79 spsta 寄存器反映 SPI 模块的当前状态 标志 spif 表示传输正在进行或传输已经结束 wcol 标志表示在 spdat 上发生写冲突, 如, spdat 寄存器经过 SFR 接口写入, 此时 SPI 接口有一个传输 serr 标志表示当 SPI 配置为从机时 ssn 输入在接收序列完成之前被移除 modf 表示当 ssn 输入与模式实际设置有冲突 ( 如, 当 ssn =0 且 SPI 配置为主机 ) spdat 寄存器 ( 参见 P56) 在传输过程中使用 这个寄存器中的数据可以经由 TR( 传输 / 接收 ) 接口发送, 如数据的字节开始从输出引脚移出 ( mosio - 主模式下, misoo - 从属模式下 ) 同时, 另一字节从输入引脚移入 ( misoi - 在主模式下, mosii - 在从属模式下 ) 传输过程完成后, 可以从 spdat 存储器中读取接收到的数据 (2) TR 块传输 / 接收功能是由 TR 块实现的 数据以位为单位按照主时钟的上升沿 ( cpol = 0 ) 或下降沿 ( cpol = 1 ) 进行发送, 这取决于 SPI 模块的设置 数据按照主时钟的上升沿 ( cpol = 0 ) 或下降沿 ( cpol = 1 ) 进行进行接收 如果设置了 cpha 位, 第一位 (MSB) 会在 scko 的第一个有效沿 mosio / misoo 发送 如果 cpha 位被清除, 则第一位 (MSB) 会在比 scko 的第一个有效沿的提前半个 scko 信号时期发送 而且, 输入数据 ( misoi 主, mosii 从 ) 会在每半个比特传输时进行采样, 在相反的时沿处将数据从 mosio 输出引脚移出 主模式在主模式下 ( 置 1 spcon 寄存器的 mstr 位 ), 执行完写入 spdat 寄存器的操作,SPI 主机开始执行传输 scko 时沿处数据从 mosio 引脚移出 同时, 另一数据开始从从机通过 misoi 引脚移入 从模式首先,SPI 模块配置成为从模式 ( spcon 寄存器的 mstr=0 ) 当然要设置 spen=1 来使能 SPI 模块 从模式下,SPI 等待在 ssn 的低输入 ssn 输入必须保持为低, 直到整个传输完成 传输的开始取决于 SPCON 寄存器的 cpha 位的状态 ( 参见表 3-42 SPCON 寄存器 ) 当 cpha 被清零时, 从机必须开始在第一个 scki 沿之前输出数据, 且用 ssn 的下降沿启动传输 当 cpha 位被置位, 从机使用 scki 输入的第一个沿作为传输的开始信号 (3) 中断生成 SPI 提供 SPI 中断输出 intspi 2 个状态标志可以生成中断请求 ( 参见表 3-56) 表 3-56 SPI 中断标志 Name Description spif When the transmission is finished, this flag is set by hardware. modf This bit is set when the level on ssn input is in conflict with actual mode, i.e. it is 0 in Master mode (if ssdis = 0 ). 当标志 spif 和 modf 被清除时, 中断请求禁用 共用相同向量的 SPI 中断作为外部中断 2 intspi 输出信号在进入中断控制器 (ISR) 之前, 与外部中断 2 的边缘标志进行或计算 为确定此中断, 标志 modf 和 spif 需要在中断子程序中检测 由于外部中断 2 标志定位到服务子程序之后会自动被清除, 只有 modf 和 spif 标志的状态带有关于实际中断源的信息 Web: Page 79 of 100

80 3.11 UART AstroⅡ 有两个串口 (UARTs):UART0 和 UART UART0 UART0 提供灵活的全双工传输同步 / 异步的接收器 / 传输器 它有 4 种操作模式 (1 个同步 3 个异步 ) UART0 在接收端有数据缓冲, 如, 接收寄存器在第二次传输完成后接收新数据, 而前面接收的数据在接收寄存器不会损坏 UART0 与标准 8051 串口完全兼容 (1) UART0 操作模式 UART0 支持 4 种操作模式 模式 0 模式 0 时,UART0 作为同步传输 / 接收器运行 txd0 输出移位时钟 txd0o 输出数据 txd0i 输入数据 8 位数据传输从 LSB 开始 波特率定为主时钟频的 1/12 当置 1 s0con 寄存器的标志 ren0 时启动接收器, 并清除 ri0 标志 将数据写入 s0buf 寄存器可以启动传输 模式 1 模式 1 时,UART0 作为 8 位异步传输 / 接收器运行, 波特率可编程 寄存器 adcon 上的 bd 决定用 Timer1 的溢出标志, 或者是用 s0relh s0rell 的波特率生成器来指定波特率 此外, 如果使用 pcon 寄存器的 smod 位, 可以使波特率提高一倍 写入 s0buf 寄存器可以启动传送 引脚 txd0 输出数据 传送的第一位是启动位 ( 通常为 0), 然后是 8 位的数据, 最后是一个停止位 ( 通常为 1) 引脚 rxd0i 输入数据 接收开始时,UART0 与检测到引脚 rxd0i 的下降沿同步 接收完成后数据存放在 s0buf 寄存器中, 停止位从 s0con 寄存器的 rb80 位获得 接收过程中, s0buf 和 rb80 的值保持不变直到完成 模式 2 模式 2 时,UART0 作为 9 位异步传输 / 接收器运行, 波特率为 Fclkper/32 或 Fclkper/64 的波特率, 这取决于 pcon 寄存器的 smod 比特的设定 写入 s0buf 寄存器可以启动传送 引脚 txd0 输出数据 传输的第一位是起始位 ( 通常为 0), 然后是 9 位的数据, 第 9 位的数据来自 tb80, 最后传输的是一个停止位 ( 通常为 1) 引脚 rxd0i 输入数据 当接收开始时,UART0 与检测到引脚 rxd0i 的下降沿同步 接收完成后数据存放在 s0buf 寄存器中, 第 9 位可以从 s0con 寄存器的 rb80 位获得 在接收过程中, s0buf 和 rb80 的值保持不变直到完成 模式 3 模式 2 和模式 3 唯一的不同在于模式 3 中, 用内部波特率生成器或是定时器 1 来指定波特率 (2) UART0 多处理器通信 UART0 在模式 2 或模式 3 下接收数据的特性可以用于多处理器通信 当 s0con 寄存器的 sm20 位被设为 1, 且第 9 个接收位 ( s0con 寄存器的 rb80 比特 ) 是 1 时, 接收中断生成 否则, 不会因接收而生成中断 要在多处理器通信中利用这一特点, 需置 1 从处理器的 sm20 主处理器传送 8 位从地址和第 9 Web: Page 80 of 100

81 位, 第 9 位为 1, 引起对所有从处理器中断的接收 从处理器软件将接收的字节与自己的网络地址进行对比 如果匹配, 从处理器地址清除自己的 sm20 标志, 继续接收主处理器传来的其他信息, 其中的第 9 位始终为 0 其他从处理器保持 sm20 值为 1, 这样它们可以忽略主处理器传来的剩余信息 UART1 UART1 提供灵活的全双工传输异步的接收器 / 传输器 它可操作 2 个模式 Serial1 在接收端有数据缓冲, 如, 它可以在第二次传输完成后接收新数据, 先前接收的数据不损坏 (1) UART1 运行模式 模式 A 模式 A 时,UART1 作为 9 位异步传输 / 接收器运行, 波特率可编程 用 s1relh s1rell 的波特率生成器来同步输入输出传输 UART1 的波特率不能使用 pcon 寄存器的 smod 位进行修改 写入 s1buf 寄存器可以启动传送 引脚 txd1 输出数据 传送的第一位是启动位 ( 通常为 0), 然后是 9 位数据, 其中第 9 位来自 s1con 寄存器的 tb81, 再传送一个停止位 ( 通常为 1) 引脚 rxd1i 输入数据 接收开始时,UART1 与检测到引脚 rxd1i 的下降沿同步 接收完成后数据存放在 s1buf 寄存器中, 第 9 位可以从 s1con 寄存器的 rb81 位获得 在接收过程中, s1buf 和 rb81 的值保持不变直到完成 模式 B 模式 B 时,UART1 作为 8 位异步传输 / 接收器运行, 波特率可编程 用 s1relh s1rell 的波特率生成器来同步输入输出传输 UART1 的波特率不能使用 pcon 寄存器的 smod 位进行修改 写入 s1buf 寄存器可以启动传送 引脚 txd1 输出数据 传送的第一位是启动位 ( 通常为 0), 然后是 8 位数据, 再传送一个停止位 ( 通常为 1) 引脚 rxd1i 输入数据 当接收器启动时,UART1 与下降沿探测的引脚 rxd1i 同步 在 s0buf 寄存器完成接收后可获得输入数据, 停止位可以从 s1con 寄存器的 rb81 引脚获得 在接收过程中, s1buf 和 rb81 的只保持不变直到完成 (2) UART1 多处理器通信 UART1 的模式 A 的特性可以用于多处理器通信 当 s1con 寄存器的 sm21 位被设为 1, 且第 9 个接收位 ( s1con 寄存器的 rb80 ) 是 1 时, 接收中断生成 否则, 不会因接收而生成中断 要在多处理器通信中利用这一特点, 需要设置从处理器的 sm21 为 1 主处理器传送 8 位从地址和第 9 位, 第 9 位为 1, 引起接收所有从处理器的中断 从处理器软件将接收的字节与自己的网络地址进行对比 如果匹配, 从处理器地址清除自己的 sm21 标志, 继续接收从主处理器传来的其他信息, 其中的第 9 位始终为 0 其他从处理器保持 sm21 值为 1, 这样它们可以忽略主处理器传来的剩余信息 3.12 P 端口 概述 AstroⅡ 中, 有 4 个 8 位寄存器 p0, p1, p2, p3 ( 参见 3.3.3(8)) 可以作为特殊功能寄存器进行访问, 并执行写入或读 - 改 - 写指令 Web: Page 81 of 100

82 某些端口引脚与其他功能引脚多路复用 细节请参见下节 端口引脚的多路复用 某些功能引脚, 例如 : 外部中断 1,UART0,UART1, 定时器 0~2, 和比较 - 捕获单元, 会与端口 1 和端口 3 共享引脚 详见下表描述 表 3-57 端口引脚多重通道 Name Type Polarity Alternate Bus size Port Description External interrupts inputs int0 I Low/Fall port3i[2] External interrupt 0 int1 I Low/Fall port3i[3] External interrupt 1 int2 I Fall/Rise port1i[4] External interrupt 2 int3 I Fall/Rise port1i[0] External interrupt 3 int4 I Rise port1i[1] External interrupt 4 int5 I Rise port1i[2] External interrupt 5 int6 I Rise port1i[3] External interrupt 6 int7 I Rise port1i[6] External interrupt 7 Serial 0 interface rxd0i I 1 port3i[0] Serial 0 receive data rxd0o O 1 port3o[0] Serial 0 transmit data txd0 O 1 port3o[1] Serial 0 transmit data or receive clock in mode 0 Serial 1 interface rxd1 I 1 port1i[0] Serial 1 receive data txd1 O 1 port1o[1] Serial 1 transmit data Timers inputs t0 I Fall port3i[4] Timer 0 external input t1 I Fall port3i[5] Timer 1 external input t2 I Fall port1i[7] Timer 2 external input t2ex I Fall port1i[5] Timer 2 capture trigger Compare Capture Unit cc(0) I Rise/Fall port1i[0] Compare/Capture 0 input cc(1) I Rise port1i[1] Compare/Capture 1 input cc(2) I Rise port1i[2] Compare/Capture 2 input cc(3) I Rise port1i[3] Compare/Capture 3 input Ccubus[0] O 1 port1o[0] Compare/Capture 0 Output Ccubus[1] O 1 port1o[1] Compare/Capture 1 Output Ccubus[2] O 1 port1o[2] Compare/Capture 2 Output Ccubus[3] O 1 port1o[3] Compare/Capture 3 Output Web: Page 82 of 100

83 3.13 电源管理 节电方式 8051 中采取了功耗管理机制, 并附有 2 种节电方式 节电方式受 PCON 寄存器控制 ( 请参见 3.3.3(32) 电源控制寄存器 PCON ) 两种节电方式:STOP 方式和 IDLE 方式 STOP 方式此方式下, clkperen 和 clkcpuen 信号无效, 门控时钟停止, 所有受 clkcpu 和 clkper 时钟控制的同步电路停止工作 IDLE 方式此方式下仅 CPU 停止运行, 即控制单元 ALU 程序/ 数据存储接口和 RAM/SFR 接口都停止工作 clkcpuen 无效, clkperen 仍处于有效状态 退出节电方式 STOP 方式此方式下 clkperen 和 clkcpuen 信号无效, 门控时钟停止 由于没有外设处于工作的状态, 中断控制器无法产生任何中断请求 因此只能通过外部中断 0 或 1 产生中断来结束 STOP 方式 IDLE 方式此方式下只有 CPU 停止工作 中断控制器和其他外设都正常工作, 中断也可以正常生成 因此任何中断都可以结束 IDLE 方式 3.14 MSS 系统控制 MSS 通过对扩展的 SFR 寄存器的操作可以控制 AstroⅡ 的一些特殊功能, 例如,ISC GCLK 控制 电源管理以及 I/O 控制等 相应的 SFR 详见 3.4 扩展特殊功能寄存器 MSS 系统时钟电源管理 (1) PLL 操作 MISCCON.3:PLLPWD 为 1 时关闭 PLL 的电源, 为 0 时接通 PLL 的电源 必须设置 MISCCON.4: CLKCPUEN MISCCON.5:PLLO0EN MISCCON.6:PLLO1EN MISCCON.7: PLLO2EN 任何一位为 1 才能使 MISCCON.3:PLLPWD 设置有效 读 MISCCON.2: PLLLOCK 位可以查看 PLL 时钟是否锁定,0 为没有锁定,1 为锁定 (2) clkcpu clkout0 clkout1 clkout2 操作当在 PLL wizard 中设置 clkcpu 为动态切换模式时,CLKCPUCON 的 0 位选择 MSS 8051 的时钟源,0 来自 clkx,1 来自 plloutx, 其中 clkx 和 plloutx 是在 PLL wizard 中设定的 设置 CLKCPUCON (F9)[2:0] 改变 MSS 的 clkcpu 的分频值, 最多为基频的 128 分频, 基频是在 PLL wizard 中设定的 ; 改变 MISCCON.4: CLKCPUEN 的值使 CLKCPUEN 从 0 变化到 1 完成 clkcpu 的动态切换 ; clkout0 clkout1 clkout2 的动态切换与 clkcpu 的动态切换操作相同, 只是对应的 SFR 不同 Web: Page 83 of 100

84 (3) Fabric 的 gclk 门控操作 8051 有电源管理功能, 利用此功能可以智能的门控 Fabric 的 gclk 时钟, 最大限度的降低 AstroⅡ 的功耗 用 clkcpuen 或 clkperen 作为 Fabric 的 gclk 时钟的门控信号, 利用 8051 的电源管理功能就可以在需要的时候关断 Fabric 的 gclk 时钟 当 8051 cpu 处在 STOP 模式时,clkcpuen 和 clkperen 都为低, 当 8051 cpu 处在 IDLE 模式时,clkcpuen 为低,clkperen 为高 8051 的电源管理详见 3.13 电源管理 MSS SPI 操作必须设置 I2CSPISEL(AB) 的 0 位为 1 才能使 MSS 的 SPI 接口连到固定 I/O 上, 否则 SPI 接口无法使用 把 SPI FLASH 的端口与 MSS 的 SPI interface 通过 Fabric 相连后,AstroⅡ 就具备了 ISP 特征 下面以使用内嵌 SPI FLASH 为例说明 FPGA 设计 : 例化 spi_interface 并连接到 MSS 的 8051SPI 接口上 Firmware 设计 : 设置 I2CSPISEL(AB) 的 0 位为 1 调用 SPI 驱动函数操作 SPI FLASH MSS I 2 C I/O 设置 I 2 C 的 SCL 和 SDA 连到了固定的 I/O 引脚上, 详见 6.2 引脚列表 用 MSS 的 I 2 C 接口连接片外的 I 2 C 器件必须设置 I2CSPISEL(AB) 的 1 位为 1, 使 SCL 和 SDA 对应的 I/O 为 I 2 C 属性 MSS 在系统重配置 AstroⅡ 的配置 Image 由 FPGA 配置数据和 MSS 的程序代码组成,FPGA 配置数据大小基本上一样, MSS 的代码随程序的的大小变化 AstroⅡ 的配置 Image 是按 block 存放在 SPI FLASH 里 Sector 是 Image 存放的最小单位, 大小为 0x10000 一个 Image 可占用多个 block 图 3-10 描述了多个 Image 存放在 SPI FLASH 的映射关系, 其中一个 Image 小于 1 个 block 的大小 在 Primace 中, 可利用 Configuration packer 把多个 Image 组合成.mcf 文件, 再用 Dwonload 把.mcf 里面的多个 Image 文件一次下载到 SPI FALSH 里, 在输出信息里可以看到每个 Image 的开始地址 利用 ISC 特性,AstroⅡ 就可以利用 SPI FLASH 的空间换取 AstroⅡ 的容量, 也就是说某些应用,AstroⅡ 可以实现远大于 1K FPGA LE 的逻辑 ISC 步骤如下 : 向 ISCADDR3~ISCADDR0 4 个 SFR 写入想要配置的 Image 在 SPI FLASH 的起始地址 向 MISCCON(0xF8) 的第 0 位 ISCEN 写入 1 这两步后,AstroII 从虚线指向的地址读取 Image2 的数据, 进行自我配置 在重配置过程中 MSS 是处在复位状态,ISCADDR3~ISCADDR0 以及 ISCEN 都自动清 0 注意 :AstroⅡ 上电复位后,AstroⅡ 仍然是默认读取 Image1 的数据进行配置 Web: Page 84 of 100

85 SPI-FLASH address ISRADDR bitstream Image1 firmware MSS bitstream Image2 firmware bitstream Image3 firmware MISC CON ISCEN Configuration Astro II SPI Interface 图 3-10 ISC MSS 在系统更新利用 ISC 和 ISP 特性就可以实现 AstroⅡ 的在系统更新 利用 ISP 特性把新的 Image 数据编程到 SPI-FLASH 对应的 block 利用 ISC 特性用更新后的 Image 重新配置 AstroⅡ 实例化使用 AstroⅡ 进行设计时, 必须在 RTL 代码中对 8051 宏模块进行实例化 宏模块端口列表 表 端口列表 Name Type Width Description clkcpu I 1 MSS 8051 clock 4 Fabric interface clkcpuen O 1 is low when cpu is in STOP and IDLE mode. clkperen O 1 is low when cpu is in IDLE mode reset I 1 MSS reset,low active ro O 1 MSS core reset output swd I 1 High level on this pin during reset starts the watchdog Timer immediately after reset is released 4 硬件内部已经连到全局时钟, 需要在 PLL wizard 中选择时钟, 不需要设计连接 Web: Page 85 of 100

86 SPI interface scki I 1 Serial clock input scko O 1 Serial clock output scktri O 1 Serial clock tri-state enable ssn I 1 Slave select input misoi I 1 Master input / slave output input pin misoo O 1 Master input / slave output output pin misotri O 1 Master input / slave output tri-state enable mosii I 1 Master output / slave input input pin mosio O 1 Master output / slave input output pin mositri O 1 Master output / slave input tri-state enable spssn O 4 Slave select output register General IO port0i I 8 8-bit input port port0o O 8 8-bit output port port1i I 8 8-bit input port, combine with int2-7, ccu, t2, rxd1 port1o O 8 8-bit output port, combine with ccu, txd1 port2i I 8 8-bit input port port2o O 8 8-bit output port port3i I 8 8-bit input port, combine with int0-1, rxd0, t0, t1 port3o O 8 8-bit output port, combine with txd0, rxd0o EMIF interface clkemif I 1 EMIF interface clock memack I 1 memory acknowledge memdatai I 8 Memory data input memdatao O 8 Memory data output memaddr O 23 Memory address memwr O 1 Memory write enable memrd O 1 Memory read enable DPRAM 4K interface clkb I 1 dpram 4k b port clock cenb I 1 dpram 4k b port chip select,low active wenb I 1 dpram 4k b port write enable, low active ab I 12 dpram 4k b port address db I 8 dpram 4k b port write data qb O 8 dpram 4k b port read output data Web: Page 86 of 100

87 4 配置 4.1 配置模式 AstroⅡ 有三种配置模式 :JTAG,AS,PS 模式 引脚 MSEL 来设置 AstroⅡ 的配置模式, 如下所示 注意 :AstroⅡ 的内带 FLASH 的芯片, 只有 AS 和 JTAG 模式, 没有 MSEL 引脚 表 4-1 配置模式 Mode select pin Mode Description MSEL 0 AS Active Serial mode. The chip will be configured automatically. Configuration data is stored in the SPI flash. 1 PS Chip acts as slave. External microcontroller feeds configuration data into the chip. 0/1 JTAG JTAG-based configuration. This mode takes high privilege over AS and PS modes AS 模式 在 AS 配置模式下,AstroⅡ 上电复位或引脚 nconfig 复位后自动从 SPI flash 0 地址读取配置数据, 配置 FPGA 和 MSS 的内嵌 RAM 图 4-1 描述了不带 FLASH 的 AstroⅡ 在 AS 模式下的连接图 图 4-1 无内嵌 Flash 的 AS 配置图 4-2 描述了带 FLASH 的 AstroⅡ 在 AS 模式下的连接图 Web: Page 87 of 100

88 图 4-2 内嵌 Flash 的 AS 配置 PS 模式在 PS 模式下,AstroⅡ 作为从设备被动接收从外部主控制器发来的配置数据 SPI Master 不能从 AstroⅡ 读出配置数据 图 4-3 描述了 AstroⅡ 在 PS 模式下的连接图 图 4-3 PS 配置 JTAG 模式 JTAG 模式下, 主机通过 AstroⅡ 的 JTAG 端口配置和调试 FPGA 和 MSS JTAG 端口比其他配置模式有更高优先权, 可以在任何配置模式下优先访问配置和调试 Web: Page 88 of 100

89 4.2 非易失性存储器 用于配置 AstroⅡ 的 SPI-Flash, 无论是内嵌还是片外的在配置完成后, 都可以在用户模式下操作 使用内嵌的 SPI-Flash 存储器时, 需要在 Primace wizard 中调用 spi interface 内嵌的 SPI-Flash 的 datasheet 见 GD25QXX_Rev1.0.pdf 表 4-2 SPI Interface 端口 Port name Type Description sclk Input spi flash input clock sdo output spi flash serial output data cson Input spi flash chip select,low active sdi Input spi flash serial input data 使用外挂的 SPI-Flash 存储器时, 需要如图 4-1 所示连接, 并且要在用户设计中把 SPI 对应的 I/O 配 置成用户 I/O, 见 ISC ISC(In System Configuration) 可以使 MSS 对 AstroⅡ 进行静态或动态的重新配置 只有在 AS 模式下, 才可实现 ISC 静态重配置就是 AstroⅡ 在运行过程中,MSS 程序向相应 ISC 的 SFR 里写入的地址和命令就可以使 AstroⅡ 重新从 SPI FLASH 指定的地址读取对应的 Image 重新配置 AstroⅡ 动态重配置就是 AstroⅡ 在运行过程中,MSS 程序从外界读取 Image( 通过串口或其他接口 ), 通过 SPI 接口写到相应的 Image 空间里, 更新 Image,MSS 程序再向相应 ISC SFR 里写入地址和命令就可以用新的 Image 配置 AstroⅡ 具体操作详见 3.14 MSS 系统控制 4.4 安全 AstroⅡ 安全机制 : 配置数据加密 保护外部 flash 数据 基于密钥 flash 访问控制 保护内部 flash 数据 配置 memory 保护 保护 FPGA 配置 配置数据加密 配置数据文件可加密 使用 LSFR 算法给配置数据加密, 用户可以自定义 128 位的密钥 FLASH 的操作控制 JTAG 操作保护使能后, 在 AS 模式下 JTAG 不能读取 SPI FLASH 的数据, 也不能操作 FPGA 和调试 MSS 的 8051 程序 1 位的 JTAG 操作保护使能标志和配置数据一起编程到 FLASH 里 JTAG 操作保护使能后, 只有 BE 指令 ( 芯片擦除 ) 和 RDSR 指令 ( 读取状态寄存器 ) 有效, 其他指令都会被 AstroII 内部的安全机制过滤 在 FLASH 中实施块擦除后, 禁止标志被去除,JTAG 可以正常操作 FLASH JTAG 启动保护使能后,AstroⅡ 禁止 JTAG 对 AstroⅡ 的配置 Memory 操作 也就是说 JTAG 不能配置 AstroⅡ, 也不能在线调试 MSS 8051 这个状态下的 AstroⅡ 就是用户自定义的 ASIC, 只有使用擦除指令, 才能重新配置 AstorⅡ Web: Page 89 of 100

90 AstroⅡ 的这些安全特性不仅能够保护用户的 FPGA 设计也能保护用户的固件 注意, 上述功能需要在 Primace 中设置才能实现 4.5 AstroⅡ 上电复位 AstroⅡ 有内部 POR 电路用于监控 VCCINT 和 VCCIO 电压电平 上电后,POR 使芯片一直保持复位状态, 直到 VCCINT 和 VCCIO 都达到触发电平 当 AstroⅡ 进入用户方式后,POR 电路只监控 VCCINT 是否掉电, 不再监控 VCCIO POR 同时也受外部 nconfig 引脚控制, 低则复位芯片 POR 电路特点如下 : 加电监控, 触发点 : - VCCINT: 0.75V-1.08V - VCCIO : 1.8V-2.97V 断电监控, 触发点 : - VCCINT : 0.65V-0.9V 对 VCCINT 的低电压监控延时 : 典型值是 4.9ms, 范围是 3.3ms~7.4ms 5 电气特性 5.1 LVCMOS33 D.C. 规格 表 5-1 LVCMOS33 D.C. 特性 Parameter Symbol Condition Min Typ Max Units Supply Voltage VCCIO V Input Voltage Low VIL V Input Voltage High VIH V Output Voltage Low VOL lol = 8mA V Output Voltage High VOH loh= 8mA V 5.2 LVTTL33 D.C. 规格 表 5-2 LVTTL33 D.C. 特性 Parameter Symbol Condition Min Typ Max Units Supply Voltage VCCIO V Input Voltage Low VIL V Input Voltage High VIH V Output Voltage Low VOL lol = 8mA V Output Voltage High VOH loh= 8mA V 提示 : (1) 上面表格中的缩写描述如下 : Web: Page 90 of 100

91 VCCIO 为单端输入和输出驱动提供电压 lol VOL 检测到的情况下输出电流状态 loh VOH 检测到的情况下输出电流状态 VIL 低逻辑电平的输入电压 VIH 高逻辑电平的输入电压 VOL 低逻辑电平的输出电压 VOH 高逻辑电平的输出电压 (2) 绝对最大额定参数为压力等级 使用或超过上表中的参数对设备进行操作会造成不可恢复的损坏 注意, 上表中的数值基于测试条件为 : 温度 =25,VCCINT=1.2V, VCCIO=3.3V 6 引脚及封装 6.1 引脚定义 表 6-1 电源引脚 Name Type Description VCCIO Power Digital supply to the FPGA fabric I/O bank,typical is 3.3V VCCINT Power Digital supply to the FPGA core,typical is 1.2V VCCA_PLL Power Analog supply to the PLL,typical is 1.2V GND Ground Digital ground GNDA_PLL Ground Analog ground to PLL 表 6-2 JTAG 引脚 Name Type Description TMS input JTAG input pin. TDI input JTAG input pin. TCK input JTAG input pin. TDO output JTAG output pin. 表 6-3 SPI 引脚 Name Type Description SCLK inout Input (PS 5 mode) output (AS mode) In passive serial configuration mode, SCLK is a clock input used to clock configuration data from external device source into device. In active serial configuration mode, SCLK is a clock output from device. SDI input Dedicated configuration data input pin. SDO output Active serial data output from the CLD device. In passive serial 5 带 FLASH 的封装没有 MSEL 和 PS 模式 Web: Page 91 of 100

92 Name Type Description configuration, this pin becomes a user I/O pin. ncso output Chip select output to enable/disable a serial configuration device. This output is used during active serial configuration mode. In passive serial configuration mode this pin become user I/O. 所有 SPI 引脚若不作为 SPI 功能, 可以用作普通 I/O 表 6-4 配置相关引脚表 Name Type Description nconfig input Chip global reset input. Active low CONF_DONE output Configuration status. configuration success: output high level configuration fail or not configured: output low level This pin can be used as general user I/O after configuration. MSEL 5 input Dedicated mode select control pins for the configuration mode for the device: 0: Active Serial (Active serial Configuration), 1: Passive Serial This pin can be used as general user I/O after configuration. 表 6-5 用户引脚列表 Pin Name Pin Type Description XIN input Crystal Input. This pin is for the oscillator circuit for a crystal or ceramic resonator. If overdriven by an external CMOS clock, this becomes the system clock input. This pin is better to connect to GND if it is not used. XOUT output Crystal Output. This pin is the excitation driver for a crystal or ceramic resonator. SCL inout I 2 C clock This pin can be used as general user I/O if it is not used as I 2 C SCL. SDA inout I 2 C data This pin can be used as general user I/O if it is not used as I 2 C SDA. CLKx input Dedicated global clock input This pin can be used as general user I/O if it is not used as CLK input. IOxxx inout user I/O Web: Page 92 of 100

93 6.2 引脚列表 目前,AstroⅡ 系列有 4 款产品 :AS2E5F1KL144 AS2E5F1KAL144 AS2E5F1KAT100 AS2E5F1KT100; 分 2 种封装 :LQFP-144 和 TQFP-100 AS2E5F1KL144 和 AS2E5F1KAL144 在电源和 I/O 上兼容 ;AS2E5F1KAT100 AS2E5F1KT100 在电源和 I/O 上兼容 详细描述请参见表 TQFP-100 封装引脚列表 表 6-6 TQFP-100 引脚列表 No. AS2E5F1KT100 AS2E5F1KAT100 1 IO1 IO1 2 IO2 IO2 3 IO3 IO3 4 IO4 IO4 5 IO5 IO5 6 IO6 IO6 7 SDO /IO7 IO7 8 SCLK/IO8 IO8 9 VCCIO VCCIO 10 GND GND 11 GND GND 12 CLK0 /IO9 CLK0 /IO9 13 VCCINT VCCINT 14 CLK1 /IO10 CLK1 /IO10 15 IO11 IO11 16 IO12 IO12 17 XOUT XOUT 18 XIN XIN 19 IO13 IO13 20 IO14/SCL IO14/SCL 21 IO15/SDA IO15/SDA 22 TMS TMS 23 TDI TDI 24 TCK TCK 25 TDO TDO 26 VCCA_PLL VCCA_PLL 27 GNDA_PLL GNDA_PLL 28 CONF_DONE /I O16 CONF_DONE /I O16 29 IO17 IO17 30 nconfig nconfig 31 VCCIO VCCIO 32 GND GND 33 MSEL/ I O18 IO18 34 IO19 IO19 No. AS2E5F1KT100 AS2E5F1KAT IO20 IO20 36 IO21 IO21 37 GND GND 38 IO22 IO22 39 VCCINT VCCINT 40 IO23 IO23 41 IO24 IO24 42 IO25 IO25 43 IO26 IO26 44 IO27 IO27 45 VCCIO VCCIO 46 GND GND 47 IO28 IO28 48 IO29 IO29 49 IO30 IO30 50 IO31 IO31 51 IO32 IO32 52 IO33 IO33 53 IO34 IO34 54 IO35 IO35 55 IO36 IO36 56 IO37 IO37 57 IO38 IO38 58 CSON /IO39 IO39 59 VCCIO VCCIO 60 GND GND 61 SDI /IO40 IO40 62 CLK2/IO41 CLK2/IO41 63 VCCINT VCCINT 64 CLK3/IO42 CLK3/IO42 65 GND GND 66 IO43 IO43 67 IO44 IO44 68 IO45 IO45 69 IO46 IO46 Web: Page 93 of 100

94 No. AS2E5F1KT100 AS2E5F1KAT IO47 IO47 71 IO48 IO48 72 IO49 IO49 73 IO50 IO50 74 IO51 IO51 75 IO52 IO52 76 IO53 IO53 77 IO54 IO54 78 IO55 IO55 79 GND GND 80 VCCIO VCCIO 81 IO56 IO56 82 IO57 IO57 83 IO58 IO58 84 IO59 IO59 No. AS2E5F1KT100 AS2E5F1KAT IO61 IO61 87 IO62 IO62 88 VCCINT VCCINT 89 IO63 IO63 90 GND GND 91 IO64 IO64 92 IO65 IO65 93 GND GND 94 VCCIO VCCIO 95 IO66 IO66 96 IO67 IO67 97 IO68 IO68 98 IO69 IO69 99 IO70 IO IO71 IO71 85 IO60 IO LQFP-144 封装引脚列表 表 6-7 LQFP-144 引脚列表 No. AS2E5F1KL144 AS2E5F1KAL144 1 IO1 IO1 2 IO2 IO2 3 IO3 IO3 4 IO4 IO4 5 IO5 IO5 6 IO6 IO6 7 SDO/ IO7 IO7 8 SCLK/ IO8 IO8 9 VCCIO VCCIO 10 GND GND 11 IO9 IO9 12 IO10 IO10 13 IO11 IO11 14 IO12 IO12 15 IO13 IO13 16 IO14 IO14 17 GND GND 18 CLK0/IO15 CLK0/IO15 19 VCCINT VCCINT No. AS2E5F1KL144 AS2E5F1KAL CLK1/IO16 CLK1/IO16 21 IO17 IO17 22 IO18 IO18 23 IO19 IO19 24 IO20 IO20 25 VCCIO VCCIO 26 GND GND 27 XOUT XOUT 28 XIN XIN 29 IO21 IO21 30 IO22/SCL IO22/SCL 31 IO23/SDA IO23/SDA 32 IO24 IO24 33 TMS TMS 34 TDI TDI 35 TCK TCK 36 TDO TDO 37 VCCA_PLL VCCA_PLL 38 GNDA_PLL GNDA_PLL Web: Page 94 of 100

95 No. AS2E5F1KL144 AS2E5F1KAL CONF_DONE/ IO25 CONF_DONE/ IO25 40 IO26 IO26 41 IO27 IO27 42 IO28 IO28 43 IO29 IO29 44 IO30 IO30 45 nconfig nconfig 46 VCCIO VCCIO 47 GND GND 48 MSEL/ IO31 IO31 49 IO32 IO32 50 IO33 IO33 51 IO34 IO34 52 IO35 IO35 53 IO36 IO36 54 GND GND 55 IO37 IO37 56 VCCINT VCCINT 57 IO38 IO38 58 IO39 IO39 59 IO40 IO40 60 IO41 IO41 61 IO42 IO42 62 IO43 IO43 63 IO44 IO44 64 VCCIO VCCIO 65 GND GND 66 IO45 IO45 67 IO46 IO46 68 IO47 IO47 69 IO48 IO48 70 IO49 IO49 71 IO50 IO50 72 IO51 IO51 73 IO52 IO52 74 IO53 IO53 75 IO54 IO54 76 IO55 IO55 77 IO56 IO56 78 IO57 IO57 79 IO58 IO58 80 IO59 IO59 No. AS2E5F1KL144 AS2E5F1KAL SCON/ IO60 IO60 82 VCCIO VCCIO 83 GND GND 84 SDI /IO61 IO61 85 IO62 IO62 86 IO63 IO63 87 IO64 IO64 88 IO65 IO65 89 CLK2/IO66 CLK2/IO66 90 VCCINT VCCINT 91 CLK3/IO67 CLK3/IO67 92 GND GND 93 IO68 IO68 94 IO69 IO69 95 IO70 IO70 96 IO71 IO71 97 IO72 IO72 98 IO73 IO73 99 Gnd Gnd 100 VCCIO VCCIO 101 IO74 IO IO75 IO IO76 IO IO77 IO IO78 IO IO79 IO IO80 IO IO81 IO IO82 IO IO83 IO IO84 IO IO85 IO IO86 IO IO87 IO GND GND 116 VCCIO VCCIO 117 IO88 IO IO89 IO IO90 IO IO91 IO IO92 IO IO93 IO93 Web: Page 95 of 100

96 No. AS2E5F1KL144 AS2E5F1KAL IO94 IO IO95 IO IO96 IO VCCINT VCCINT 127 IO97 IO GND GND 129 IO98 IO IO99 IO IO100 IO IO101 IO101 No. AS2E5F1KL144 AS2E5F1KAL IO103 IO GND GND 136 VCCIO VCCIO 137 IO104 IO IO105 IO IO106 IO IO107 IO IO108 IO IO109 IO IO110 IO IO102 IO IO111 IO111 注意 : 1. 引脚属性在前的为默认值, 使用别的引脚属性需要配置 例如引脚 SDO /IO7,SDO 是默认值, 若 用作 IO, 需要重配置 IO 属性 2. 内带 Flash 的 AstroⅡ 没有 MSEL, 此类器件只有 AS 模式, 没有 PS 模式 3. I 2 C 的 SCL 和 SDA 只能从固定的引脚出来, 该引脚默认为普通 IO, 要用作 I 2 C, 详见 封装信息 TQFP-100 封装, 如图 6-1 所示 图 6-1 TQFP-100 封装 LQFP-144 封装, 如图 6-2 所示 Web: Page 96 of 100

97 图 6-2 LQFP 开发工具 Capital Microelectronics 的开发工具可以使开发者在 AstroⅡ 芯片上简单方便地实现两种设计 : FPGA 设计和嵌入式 software 设计 Capital Microelectronics 的 Primace Integrated Design Environment (IDE) 支持全部 Capital Microelectronics 公司的芯片, 能够实现 synthesis mapper placement routing bitgen simulation 等全流程的 FPGA 设计 支持第三方 EDA 工具 :Leondaro Spectrum 和 Modelsim Primace 内嵌 Keil-C 的 Capital Microelectronics 的 AGDI 接口, 嵌入式软件开发者可以在 Keil-C 编译和在线调试 8051firmware AstroⅡ 的 MSS 具有片上调试 (OCDS) 性能能帮助用户轻松调试 8051 程序 更多信息, 请参见 AstroⅡ 8051 调试用户手册 请购买 Keil-C 软件工具, 应用于 8051 编程 编译 调试等 更多信息, 请参照 目前, 不支持其它第三方开发环境 请将您的意见和需求发送给我们 support@capital-micro.com MSS 的 OCDS 调试接口与 FPGA 共用同一个 JTAG 接口 Capital Microelectronics 提供的下载电缆和软件工具自动识别并操作 MSS 的 OCDS 或 FPGA 的 JTAG, 但两者不能同时使用 8 商务指南 8.1 AstroⅡ 系列产品列表 目前,AstroⅡ 系列有 6 个产品 若有其他需求请联系 capital-micro 详细描述请参见表 8-1 Web: Page 97 of 100

DPJJX1.DOC

DPJJX1.DOC 8051 111 2K 1 2 3 ' ' 1 CPU RAM ROM / A/D D/A PC CPU 40 68 10 20 8 51 PIII 8051 2 MCS51 8051 8031 89C51 8051 8031 89C51? MCS51 INTEL INTEL 8031 8051 8751 8032 8052 8752 8051 8051 8051 MCS51 8031 8031

More information

注意 2014 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查

注意 2014 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查 CME-M1 系列 数据手册 2014 年 3 月 京微雅格 ( 北京 ) 科技有限公司 注意 2014 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查并认为是完全可靠的

More information

注意 3 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查并认为

注意 3 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查并认为 CME-M FPGA 简易版数据手册 3 年 5 月 京微雅格 ( 北京 ) 科技有限公司 注意 3 京微雅格 ( 北京 ) 科技有限公司版权所有未经京微雅格 ( 北京 ) 科技有限公司书面许可, 不得以任何形式或方式, 如电子 机械形式, 包括影印 录音或其他数据储存和检索系统形式复制或转移此文档的任何部分, 或将其翻译为其它任何语言或计算机语言 声明本手册中包含的信息已经仔细检查并认为是完全可靠的

More information

1-1 SH79F6431 A. 2( ) 9~15V ( 12V) U2 U3 3.3V SH79F B. 1(VCC/GND) SH79F6431 C. VDDIO SH79F6431 P4 P5 P0.6 P0.7 VDDIO VDDIO=5V D. 2 V 1.0

1-1 SH79F6431 A. 2( ) 9~15V ( 12V) U2 U3 3.3V SH79F B. 1(VCC/GND) SH79F6431 C. VDDIO SH79F6431 P4 P5 P0.6 P0.7 VDDIO VDDIO=5V D. 2 V 1.0 SH79F6431 1. SH79F6431 1T 8051 FLASH SH79F JET51 Keil µ vision JTAG 1.1. SH79F6431 LQFP64 1.2. (Target Board) SH79F6431 1 V 1.0 1-1 SH79F6431 A. 2( ) 9~15V ( 12V) U2 U3 3.3V SH79F6431 1 2 1 B. 1(VCC/GND)

More information

目 录

目 录 1 Quick51...1 1.1 SmartSOPC Quick51...1 1.2 Quick51...1 1.3 Quick51...2 2 Keil C51 Quick51...4 2.1 Keil C51...4 2.2 Keil C51...4 2.3 1 Keil C51...4 2.4 Flash Magic...9 2.5 ISP...9 2.6...10 2.7 Keil C51...12

More information

W77E58中文手册

W77E58中文手册 W77E58 77E58 8051 8051 8051 77E58 8051 1.5 3 COMS 32K EEPROM 1K SRAM 1 8 2 40M 4 3 8051 4 8051 5 4 8 I/O 6 4 I/O 44 PLCC QFP 7 16 / 8 12 9 10 11 1K 12 13 16 DPTR 14 15 DIP40 W77E58 25/40 PLCC44 W77E58P

More information

1 TPIS TPIS 2 2

1 TPIS TPIS 2 2 1 1 TPIS TPIS 2 2 1. 2. 3. 4. 3 3 4 5 4 TPIS TPIS 6 5 350 Mark Coil F3/F6 350 M 150 M 25 M 7.12M 8 M F3 F6 F4 F7 F8 8M AA 7 350 28V 5V IC HCPL2731 0.5mA 6 8 (TPIS) TPIS 9 7 IC AT89C2051 AT89C2051 CMOS8

More information

Microsoft Word - 專題封面.doc

Microsoft Word - 專題封面.doc 逢 甲 大 學 資 訊 工 程 學 系 專 題 研 究 報 告 8051 小 遊 戲 -21 點 指 導 教 授 : 陳 德 生 學 生 : 許 博 益 中 華 民 國 九 十 六 年 六 月 I 目 錄 第 一 章 緒 論 1 1-1 研 究 背 景 1 1-2 研 究 動 機 2 1-3 研 究 目 的 3 1-3-1 21 點 源 起 3 1-3-2 21 點 規 則 3 第 二 章 微 電

More information

2 Keil µ vision 2.1 1) Keil µ vision2 V2.34 µ vision3 2) Sino_Keil.exe Keil c:\keil\ 3) JET51 USB PC C:\Keil\ USB PC 4) S-L

2 Keil µ vision 2.1 1) Keil µ vision2 V2.34 µ vision3 2) Sino_Keil.exe   Keil c:\keil\ 3) JET51 USB PC C:\Keil\ USB PC 4) S-L 1 SH88F516 8051 64K FLASH 1024 EEPROM SH88F516 JET51 S-Lab Keil µ vision ISP51 Keil µ vision ISP51 ISP51 PC RS232 MCU SH88F516 SH88F516 1.1 SH88F516 1.1 SH88F516 SH88Fxx: QFP44, DIP40 RAM Flash E2 ADC

More information

CH559指令周期.doc

CH559指令周期.doc CH55X 汇编指令周期表 CH55X 汇编指令概述 : 型号包含 : a. 指令单周期型号 :CH557 CH558 CH559; b. 指令 4 周期型号 :CH551 CH552 CH553 CH554; c. 非跳转指令的指令周期数与指令字节数相同 ; d. 跳转指令含 MOVC/RET/CALL 通常比字节数多若干个周期 ; e.movc 指令多 4 或 5 个周期 ( 下条指令地址为奇数时多

More information

1.1 ML_ONOFF = 1 Q 3 Q 8 C 0.3V M 2 L 1 ML_ONOFF = 0 Q 3 Q 8 C 1. + R31 VCC R21 10K ML_ONOFF R15 0:off 1:on 1K Green Light VCC=5V L1 Q VDD=12V C

1.1 ML_ONOFF = 1 Q 3 Q 8 C 0.3V M 2 L 1 ML_ONOFF = 0 Q 3 Q 8 C 1. + R31 VCC R21 10K ML_ONOFF R15 0:off 1:on 1K Green Light VCC=5V L1 Q VDD=12V C AUTOMATIC TROLLEY H K Hwang K K Chen J-S Lin S-C Wang M-L Li C-C Lin W-B Lin Dept. Of Electrical Engineering Far East College ABSTRACT This paper proposes an automatic trolley which can move automatically

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_15

Microsoft PowerPoint - C15_LECTURE_NOTE_15 THE 8051 MICROCONTROLLER THE 8051 MICROCONTROLLER 15.1 Introduction 15.2 The 8051 Architecture 15.3 Interfacing to External Memory 15.4 The 8051 Instruction Set 15.5 Timer Operations 15.6 Serial Port Operations

More information

微處理機期末專題

微處理機期末專題 微 處 理 機 期 末 專 題 自 動 鋼 琴 組 員 :b92611004 羅 鈞 瑋 b92611008 吳 妍 儂 b92611038 吳 韋 靜 b92611042 林 佳 穎 一 簡 介 本 組 的 主 題 是 自 動 鋼 琴 在 播 放 音 樂 的 同 時, 鋼 琴 會 自 動 按 下 琴 鍵, 被 按 下 的 琴 鍵 所 對 應 到 的 音 階, 就 是 正 在 撥 放 的 樂 曲 的

More information

7688使用手冊V10.doc

7688使用手冊V10.doc TP-7688 . 2 2. 3 3. 5 4. 5 5. 6 6. 7 7. 8 8. 9 9.. 4. 7 2 2., 7x9 / 6x9 7x9.3() x 3.()mm 6x9 2.84() x 3.()mm 3 ASCII 7x9 95 ASCII 6x9 95 6x9 7 BIG5 6x9 3973 6x9 28 7x9 24 24 55 6x9 2 2 27 4.23mm (/6 inch)

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

Computer Architecture

Computer Architecture ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Prev: Basic computer concepts

More information

学习MSP430单片机推荐参考书

学习MSP430单片机推荐参考书 MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP

More information

Bus Hound 5

Bus Hound 5 Bus Hound 5.0 ( 1.0) 21IC 2007 7 BusHound perisoft PC hound Bus Hound 6.0 5.0 5.0 Bus Hound, IDE SCSI USB 1394 DVD Windows9X,WindowsMe,NT4.0,2000,2003,XP XP IRP Html ZIP SCSI sense USB Bus Hound 1 Bus

More information

專題最終版.doc

專題最終版.doc The Principle and Application of the Electric Combination Lock The Principle and Application of the Electric Combination Lock Abstract Recently, there are more and more burglaries in the society. It's

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

Microsoft PowerPoint - STU_EC_Ch08.ppt

Microsoft PowerPoint - STU_EC_Ch08.ppt 樹德科技大學資訊工程系 Chapter 8: Counters Shi-Huang Chen Fall 2010 1 Outline Asynchronous Counter Operation Synchronous Counter Operation Up/Down Synchronous Counters Design of Synchronous Counters Cascaded Counters

More information

SST SPAC SST SoftICE SST89C5x/SST89x554RC /564RD /SST89x516/5xRD / SoftICE SoftICE MCU SoftICE SS

SST SPAC SST SoftICE SST89C5x/SST89x554RC /564RD /SST89x516/5xRD / SoftICE SoftICE MCU SoftICE SS SST SoftICE SST89C5x/SST89x554RC /564RD /SST89x516/5xRD2 1...2 1.1...2 1.2...2 1.3 /...2 2 SoftICE...2 3 SoftICE MCU...2 4 SoftICE...3 4.1 SST BootLoader SOFTICE...3 4.2 SoftICE SST MCU...6 5 SoftICE...7

More information

PowerPoint 簡報

PowerPoint 簡報 微算機原理與實驗 (UEE 2301/1071 ) Chap 5. MCS-51 Addressing Modes 宋開泰 Office:EE709 Phone:5731865( 校內分機 :31865) E-mail:ktsong@mail.nctu.edu.tw URL:http://isci.cn.nctu.edu.tw 1 Addressing Modes Addressing mode is

More information

P4i45GL_GV-R50-CN.p65

P4i45GL_GV-R50-CN.p65 1 Main Advanced Security Power Boot Exit System Date System Time Floppy Drives IDE Devices BIOS Version Processor Type Processor Speed Cache Size Microcode Update Total Memory DDR1 DDR2 Dec 18 2003 Thu

More information

12232A LED LED LED EL EL CCFL EL CCF

12232A LED LED LED EL EL CCFL EL CCF 12232A 0 50-20 +70-30 +85 LED LED LED EL EL CCFL EL CCF 122 x 32 1/32Duty 1/5Bias 6:00 STN( ), EL LED EL/100VAC 400HZ LED/4.2VDC 1 / VDD-VSS 0 6.5 V Ta=25 LCD VDD-V0 0 12.0 V V1 0 VDD V VDD-VSS - 4.75

More information

µPSD3000 系列

µPSD3000 系列 8032 FLASH MCU µpsd3251f-40t6 µpsd3251 8032 FlashPSD Flash SRAM I/O I 2 C, ADC and PWM 8032, 16 / FlashPSD µpsd32 JTAG ISP 2K SRAM Flash - 64K Flash - 16K Flash - Flash 8032 12 I2C ADC 6 I/O 37 I/O 16

More information

*_* IAP In Applications Program, *_* ROM RAM A/D D/A KELL C51 2 0531-86213622 Micro Controller Unit( ) INTEL MCS-48 MCS-51 MCS-96 51 MCS-51 8 MCS-96 16 INTEL / 51 87 LPC W78L DS87 GSM97 ATMEL 89C51

More information

HD61202 HD HD61203 HD61202, HY HY HD61202 HD61202 HD61203 HD =4096 RAMRAM LCD 2HD HD HD /32--

HD61202 HD HD61203 HD61202, HY HY HD61202 HD61202 HD61203 HD =4096 RAMRAM LCD 2HD HD HD /32-- HD61202 C-7 1 HD61202 HD61202 8 HD61203 HD61202, HY-12864 HY-19264 HD61202 HD61202 HD61203 HD61202 1 6464=4096 RAMRAM LCD 2HD61202 64 3HD61202 68 68 4HD61202 1/32--1/64 HD61202 HD61202 2 CS1,CS2,CS3 CS1

More information

System Design and Setup of a Robot to Pass over Steps Abstract In the research, one special type of robots that can pass over steps is designed and se

System Design and Setup of a Robot to Pass over Steps Abstract In the research, one special type of robots that can pass over steps is designed and se 8051 8051 System Design and Setup of a Robot to Pass over Steps Abstract In the research, one special type of robots that can pass over steps is designed and setup. This type of robot uses two kinds of

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information

Microsoft PowerPoint - chap5.ppt

Microsoft PowerPoint - chap5.ppt 邏輯運算指令的動作 0 1 0 1 0 0 1 1 OR 1 0 1 1 1 0 0 1 1 1 1 1 1 0 1 1 (a) OR 運算 0 1 0 1 0 0 1 1 XOR 1 0 1 1 1 0 0 1 1 1 1 0 1 0 1 0 (c) XOR 運算 希望設定為 1 的位元 罩網標的位元組 新標的位元組 不改變的位元 希望取補數的位元 罩網標的位元組 新標的位元組 不改變的位元 1

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_05.ppt

Microsoft PowerPoint - C15_LECTURE_NOTE_05.ppt 8088/8086 MICROPROCSOR PROGRAMMING INTEGER INSTRUCTIONS AND COMPUTATIONS The MOVE The move (MOV) instruction is used to transfer a byte or a word of data from a source operand to a destination operand

More information

1 CPU

1 CPU 2000 Tel 82316285 82317634 Mail liuxd@buaa.edu.cn 1 CPU 2 CPU 7 72 A B 85 15 3 1/2 M301 2~17 : 3/4 1/2 323 IBM PC 1. 2. 3. 1. 2. 3. 1.1 Hardware Software 1.2 M3 M2 M1 1.2 M3 M1 M2 M2 M1 M1 M1 1.2 M3 M1

More information

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor 1 4.1.1.1 (Load) 14 1.1 1 4.1.1.2 (Save) 14 1.1.1 1 4.1.2 (Buffer) 16 1.1.2 1 4.1.3 (Device) 16 1.1.3 1 4.1.3.1 (Select Device) 16 2 4.1.3.2 (Device Info) 16 2.1 2 4.1.3.3 (Adapter) 17 2.1.1 CD-ROM 2 4.1.4

More information

FM1935X智能非接触读写器芯片

FM1935X智能非接触读写器芯片 FM3316/3315 MCU 2017.06 FM3316/3315 MCU 2.21 (http://www.fmsh.com/) FM3316/3315 MCU 2.22 ... 3 1... 4 2... 5 2.1... 5 2.2... 5 2.3... 6 2.3.1... 6 2.3.2... 6 2.4... 9 2.5... 10 2.5.1 LQFP64... 10 2.5.2

More information

untitled

untitled EDM16080-01 Model No.: Editor: 1. ----------------------------------------------------3 2. ----------------------------------------------------3 3. ----------------------------------------------------3

More information

邏輯分析儀的概念與原理-展示版

邏輯分析儀的概念與原理-展示版 PC Base Standalone LA-100 Q&A - - - - - - - SCOPE - - LA - - ( Embedded ) ( Skew ) - Data In External CLK Internal CLK Display Buffer ASIC CPU Memory Trigger Level - - Clock BUS Timing State - ( Timing

More information

Microsoft PowerPoint - CA_03 Chapter5 Part-II_multi _V1.ppt

Microsoft PowerPoint - CA_03 Chapter5 Part-II_multi _V1.ppt Chapter5-2 The Processor: Datapath and Control (Multi-cycle implementation) 臺大電機系 吳安宇教授 V1. 03/27/2007 For 2007 DSD Course 臺大電機吳安宇教授 - 計算機結構 1 Outline 5.1 Introduction 5.2 Logic Design Conventions 5.3

More information

ICD ICD ICD ICD ICD

ICD ICD ICD ICD ICD MPLAB ICD2 MPLAB ICD2 PIC MPLAB-IDE V6.0 ICD2 usb PC RS232 MPLAB IDE PC PC 2.0 5.5V LED EEDATA MPLAB ICD2 Microchip MPLAB-IDE v6.0 Windows 95/98 Windows NT Windows 2000 www.elc-mcu.com 1 ICD2...4 1.1 ICD2...4

More information

a b c d e f g C2 C1 2

a b c d e f g C2 C1 2 a b c d e f g C2 C1 2 IN1 IN2 0 2 to 1 Mux 1 IN1 IN2 0 2 to 1 Mux 1 Sel= 0 M0 High C2 C1 Sel= 1 M0 Low C2 C1 1 to 2 decoder M1 Low 1 to 2 decoder M1 High 3 BCD 1Hz clk 64Hz BCD 4 4 0 1 2 to 1 Mux sel 4

More information

MICROCHIP EVM Board : APP APP001 PICmicro Microchip APP001 40pin PDIP PICmicro Design Tips Character LCM Temperature Sensor Application I/O Pi

MICROCHIP EVM Board : APP APP001 PICmicro Microchip APP001 40pin PDIP PICmicro Design Tips Character LCM Temperature Sensor Application I/O Pi MICROCHIP EVM Board : APP001 1-1. APP001 PICmicro Microchip APP001 40pin PDIP PICmicro Design Tips Character LCM Temperature Sensor Application I/O Pin 16 I/O Extension Interface 1-2. APP001 Block_A Block_B

More information

() () () () () () () () DDRAM () II

() () () () () () () () DDRAM () II 液晶模块说明书 SPEC NO YM2232A REV NO. 液晶显示模块产品说明书 产品类型 : 产品型号 : 产品描述 : 标准产品 YM2232A 22x32 图形点阵模块, 控制器 :SED52,LED 背光 客户名称 : 客户确认 : 编写 : Dexun Zou 审核 : HCC 批准 : Jingxi Yang 发行日期 : 22.8 大连佳显电子有限公司 地址 : 大连市沙河口区工华街

More information

第5章:汇编语言程序设计

第5章:汇编语言程序设计 第 5 章 : 汇编语言程序设计 程 汇编语言指令格式 系统伪指令 存储器选择方式 常用子程序 1 汇编语言程序设计 PIC 指令系统 语言系统 指 CPU 编 器语言 器语言 器语言 设计 用 语言 设计 语言 汇编语言 2 汇编语言指令格式 汇编语言指令格式 ( 指令 ) label opcode operand comment 指令 用 存 指令 指令语 3 汇编语言指令格式 1 指令 用 指令

More information

FM1935X智能非接触读写器芯片

FM1935X智能非接触读写器芯片 FM33A0xx MCU 2017. 05 2.0 1 (http://www.fmsh.com/) 2.0 2 ... 3 1... 4 1.1... 4 1.2... 4 1.3... 5 1.3.1... 5 1.3.2... 5 1.4... 8 1.4.1 LQFP100... 8 1.4.2 LQFP80... 9 1.4.3... 9 2... 15 2.1 LQFP100... 15

More information

投影片 1

投影片 1 2 理 1 2-1 CPU 2-2 CPU 理 2-3 CPU 類 2 什 CPU CPU Central Processing Unit ( 理 ), 理 (Processor), CPU 料 ( 例 ) 邏 ( 例 ),, 若 了 CPU, 3 什 CPU CPU 了, 行, 利 CPU 力 來 行 4 什 CPU 5 2-2-1 CPU CPU 了 (CU, Control Unit) / 邏

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_05.ppt

Microsoft PowerPoint - C15_LECTURE_NOTE_05.ppt 8088/8086 MICROPROCESSOR PROGRAMMING INTEGER INSTRUCTIONS AND COMPUTATIONS 8088/8086 MICROPROCESSOR PROGRAMMING INTEGER INSTRUCTIONS AND COMPUTATIONS 5.1 Data-Transfer Instructions 5.2 Arithmetic Instructions

More information

untitled

untitled EDM12832-08 : 25-1 : 116600 : (0411)7612956 7632020 7631122 : (0411)7612958 Model No.: Editor: LCD 1. ----------------------------------------------------3 2. ----------------------------------------------------3

More information

目录

目录 ALTERA_CPLD... 3 11SY_03091... 3 12SY_03091...4....5 21 5 22...8 23..10 24..12 25..13..17 3 1EPM7128SLC.......17 3 2EPM7032SLC.......18 33HT46R47......19..20 41..20 42. 43..26..27 5151DEMO I/O...27 52A/D89C51...28

More information

untitled

untitled 8086/8088 CIP /. 2004.8 ISBN 7-03-014239-X.... TP313 CIP 2004 086019 16 100717 http://www.sciencep.com * 2004 8 2004 8 1 5 500 787 1092 1/16 16 1/2 391 000 1 2 ii 1 2 CAI CAI 3 To the teacher To the student

More information

Microsoft PowerPoint - chap4.ppt

Microsoft PowerPoint - chap4.ppt 定址方式 定址方式 格式 有效位址 立即資料定址 #data8 暫存器定址 Rn (R0 ~ R7) 直接定址 addr8 addr8 絕對定址 addr11 addr11 長程 ( 絕對 ) 定址 addr16 addr16 ( 暫存器 ) 間接定址 @Ri (@R0 @R1) 或 @DPTR R0 R1 或 DPTR ( 暫存器 ) 相對定址 disp8 PC+ 符號擴展之 disp8 ( 基底

More information

AN-8203 FCM8531 用户手册

AN-8203 FCM8531 用户手册 www.fairchildsemi.com AN-8203 FCM8531 用户手册 所有指令兼容二进制代码, 与业界标准的 8051 微控制器执行的功能相同 表 1. 指令集和寻址模式 符号 说明 Rn 当前选择的寄存器区中的寄存器 R0 ~ R7 直接 内部 DATA RAM 位置 (0~127) 或特殊功能寄存器 (SFR) @Ri 间接内部 (0~255) 或外部 RAM 位置由寄存器 R0

More information

Microsoft PowerPoint - CA_02 Chapter5 Part-I_Single _V2.ppt

Microsoft PowerPoint - CA_02 Chapter5 Part-I_Single _V2.ppt Chapter5- The Processor: Datapath and Control (Single-cycle implementation) 臺大電機系吳安宇教授 V. 3/27/27 V2. 3/29/27 For 27 DSD Course 臺大電機吳安宇教授 - 計算機結構 Outline 5. Introduction 5.2 Logic Design Conventions 5.3

More information

PTS7_Manual.PDF

PTS7_Manual.PDF User Manual Soliton Technologies CO., LTD www.soliton.com.tw - PCI V2.2. - PCI 32-bit / 33MHz * 2 - Zero Skew CLK Signal Generator. - (each Slot). -. - PCI. - Hot-Swap - DOS, Windows 98/2000/XP, Linux

More information

USB解决方案.ppt

USB解决方案.ppt USB USB? RS232 USB USB HID U modem ADSL cable modem IrDA Silabs USB CP210x USB UART USB RS-232 USB MCU 15 USB 12 FLASH MCU 3 USB MCU USB MCU C8051F32x 10 ADC 1.5%, Vref CPU 25MIPS 8051 16KB Flash -AMUX

More information

» n ¹ú KS0108 x ÍÍÙ q n KS0108 KS KS0107 KS0108 KS *32 128*64 192*64 KS0108 KS0108 KS0107 KS =4096 RAM RAM LCD 2 KS

» n ¹ú KS0108 x ÍÍÙ q n KS0108 KS KS0107 KS0108 KS *32 128*64 192*64 KS0108 KS0108 KS0107 KS =4096 RAM RAM LCD 2 KS KS0108 KS0108 8 KS0107 KS0108 KS0108 128*32128*64 192*64 KS0108 KS0108 KS0107 KS0108 1 6464=4096 RAMRAM LCD 2KS0108 64 3KS0108 68 68 4KS0108 1/48--1/64 KS0108 CS1,CS2,CS3 CS1 CS2 CS3 E E KS0108 E R/W R/W=1

More information

untitled

untitled FBC0409 V1.0 1.0 05.06.22 SIA 2005 SIA SIA SIA SIA SIA 114 86-24-23970133 HTTP://WWW.SIA.CN YANG@SIA.CN 2 ...5...5...6 PIN...6...7 1 CPU...8 2...8 4...8 5 DMA...9 7....9 8...9 9...10 A...10 B...10...11.

More information

Tel:010-62981668-2930 1

Tel:010-62981668-2930  1 Access 93C46 with SPI function V1.0.0 Jan. 31, 2005 http://www.sunplusmcu.com Tel:010-62981668-2930 http://www.sunplusmcu.com E-mail:mcu@sunplus.com.cn 1 0 0...2 1...3 2...4 2.1...4 2.2...5 3...6 3.1 AT93C46...6

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

More information

Contents 1 简介 ISC 原理示意图 ISC SFR 描述 ISC 步骤 在线更新 外部 SPI FLASH 内部集成 SPI FLASH ISC 实例 FP

Contents 1 简介 ISC 原理示意图 ISC SFR 描述 ISC 步骤 在线更新 外部 SPI FLASH 内部集成 SPI FLASH ISC 实例 FP AstroII ISC 用户指南 Version 1.0 January 2010 Capital Microelectronics, Inc. CME 1 Contents 1 简介...1 2 ISC...1 2.1 原理示意图...2 2.2 ISC SFR 描述...2 2.3 ISC 步骤...3 3 在线更新...3 3.1 外部 SPI FLASH...3 3.2 内部集成 SPI FLASH...4

More information

Microsoft Word - MSP430 Launchpad 指导书.docx

Microsoft Word - MSP430 Launchpad 指导书.docx Contents 3... 9... 14 MSP430 LAUNCHPAD 指导书 3 第一部分第一个工程 New Project File > New > CCS Project Project name: ButtonLED Device>Family: MSP430 Variant: MSP430G2553 Project templates and examples : Empty Project

More information

微處理機

微處理機 3-1 指令格式 標記運算碼運算元註解 標記 1. 標記前不可有空白, 否則會被視為運算碼 2. 標記代表一個 16 位元的記憶體實際位址 3. 標記名稱最多 32 個字元 ( 視組譯器不同而有所不同 ) 4. 標記有大小寫之分 5. 標記可有可無 運算碼 1. 運算碼與標記名稱間, 至少必須空一格, 如果沒有標記名稱, 則運算碼前最少要空一格, 否則會被視為標記 2. 運算碼大小寫相同 3. 可以是

More information

2/80 2

2/80 2 2/80 2 3/80 3 DSP2400 is a high performance Digital Signal Processor (DSP) designed and developed by author s laboratory. It is designed for multimedia and wireless application. To develop application

More information

Ch03_嵌入式作業系統建置_01

Ch03_嵌入式作業系統建置_01 Chapter 3 CPU Motorola DragonBall ( Palm PDA) MIPS ( CPU) Hitachi SH (Sega DreamCast CPU) ARM StrongARM CPU CPU RISC (reduced instruction set computer ) CISC (complex instruction set computer ) DSP(digital

More information

ARM Cortex-M3 (STM32F) STMicroelectronics ( ST) STM32F103 Core: ARM 32-bit Cortex -M3 CPU 72 MHz, 90 DMIPS with 1.25 DMIPS/MHz Single-cycle multiplica

ARM Cortex-M3 (STM32F) STMicroelectronics ( ST) STM32F103 Core: ARM 32-bit Cortex -M3 CPU 72 MHz, 90 DMIPS with 1.25 DMIPS/MHz Single-cycle multiplica CP Chip Power ARM Cortex-M3 (STM32F) ARM Cortex-M3 (STM32F) STMicroelectronics ( ST) STM32F103 Core: ARM 32-bit Cortex -M3 CPU 72 MHz, 90 DMIPS with 1.25 DMIPS/MHz Single-cycle multiplication and hardware

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt MACHINE LANGUAGE CODING AND THE DEBUG SOFTWARE DEVELOPMENT PROGRAM OF THE PC General instruction format for machine code 611 37100 微處理機原理與應用 Lecture 04-4 MACHINE LANGUAGE CODING AND THE DEBUG SOFTWARE

More information

Ps22Pdf

Ps22Pdf ( ) ( 150 ) 25 15 20 40 ( 25, 1, 25 ), 1. A. B. C. D. 2. A. B. C. D. 3., J = 1 H = 1 ( A B, J', J, H ) A. A = B = 1, J' =0 B. A = B = J' =1 C. A = J' =1, B =0 D. B = J' = 1, A = 0 4. AB + AB A. AB B. AB

More information

<4D F736F F D20B5DAC8FDCBC4D5C2D7F7D2B5B4F0B0B82E646F63>

<4D F736F F D20B5DAC8FDCBC4D5C2D7F7D2B5B4F0B0B82E646F63> 第三章 Q3 1 1. 省略了 I/O 操作的复杂逻辑, 易实现, 耗费低 ; 2. 可以利用丰富的内存寻址模式实现灵活的 I/O 操作 Q3 2 假设存储单元 ds1 处寄存器地址为 0x2000, 代码如下 #define ds1 0x2000 while ( *ds1 == 0 ) ; Q3 3 假设设备 (dev1) 中有两个寄存器 ds1 和 dd1,dev1 的地址为 0x1000,ds1

More information

Microsoft Word - ~ doc

Microsoft Word - ~ doc EEPROM 功能使用方法 1 适用产品 : 1.1 SM39R16A2/ SM39R12A2/ SM39R08A2 1.2 SM39R4051/ SM39R2051 1.3 SM39R04G1/ SM39R02G1 2 EEPROM 功能概述 : 2.1 使用 code flash 仿真为 Internal EEPROM, 在程序执行时, 可将 code flash 作为 data flash 储存数据使用

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt MACHINE LANGUAGE CODING AND THE DEBUG SOFTWARE DEVELOPMENT PROGRAM OF THE PC MACHINE LANGUAGE CODING AND THE DEBUG SOFTWARE DEVELOPMENT PROGRAM OF THE PC 4.1 Converting Assembly Language Instructions to

More information

<4D6963726F736F667420576F7264202D203130B5A5C6ACBBFACAB5D1E9D6B8B5BCCAE92E646F63>

<4D6963726F736F667420576F7264202D203130B5A5C6ACBBFACAB5D1E9D6B8B5BCCAE92E646F63> 单 片 机 及 接 口 技 术 实 验 指 导 书 张 勇 编 计 算 机 与 通 信 工 程 学 院 信 息 与 通 信 工 程 系 2004.12 1 - 前 言 单 片 机 及 接 口 技 术 是 通 信 工 程 专 业 的 专 业 技 能 课 程, 在 专 业 知 识 结 构 体 系 中 具 有 十 分 重 要 的 地 位, 课 程 的 实 践 性 很 强, 学 习 必 须 理 论 和 实

More information

9 什 么 是 竞 争 与 冒 险 现 象? 怎 样 判 断? 如 何 消 除?( 汉 王 笔 试 ) 在 组 合 逻 辑 中, 由 于 门 的 输 入 信 号 通 路 中 经 过 了 不 同 的 延 时, 导 致 到 达 该 门 的 时 间 不 一 致 叫 竞 争 产 生 毛 刺 叫 冒 险 如

9 什 么 是 竞 争 与 冒 险 现 象? 怎 样 判 断? 如 何 消 除?( 汉 王 笔 试 ) 在 组 合 逻 辑 中, 由 于 门 的 输 入 信 号 通 路 中 经 过 了 不 同 的 延 时, 导 致 到 达 该 门 的 时 间 不 一 致 叫 竞 争 产 生 毛 刺 叫 冒 险 如 FPGA 工 程 师 面 试 试 题 一 1 同 步 电 路 和 异 步 电 路 的 区 别 是 什 么?( 仕 兰 微 电 子 ) 2 什 么 是 同 步 逻 辑 和 异 步 逻 辑?( 汉 王 笔 试 ) 同 步 逻 辑 是 时 钟 之 间 有 固 定 的 因 果 关 系 异 步 逻 辑 是 各 时 钟 之 间 没 有 固 定 的 因 果 关 系 3 什 么 是 " 线 与 " 逻 辑, 要 实

More information

逢 甲 大 學

逢  甲  大  學 益 老 年 不 易更 例 不 異 列 - I - 錄 錄 流 錄 六 來 錄 - II - 錄 錄 錄 錄 錄 錄 參 料 錄 - III - 料 讀 讀 錄 讀 數 錄 錄 錄 錄 錄 - IV - 錄 錄 行 錄 錄 錄 錄 讀 錄 錄 錄 讀 錄 錄 - V - 了 說 力 兩 了 - 1 - 列 邏 路 列 不 不 FLEX 10K Devices at a Glance Feature

More information

Microsoft Word - IRFWX_A051_C_SyncMOS_with_STC_APN_SC_.doc

Microsoft Word - IRFWX_A051_C_SyncMOS_with_STC_APN_SC_.doc EEPROM 应用说明 1 适用产品 :SM59D03G2 SM59D04G2 series 2 应用范围 : 针对需使用 EEPORM 功能替换 STC 89C5X 的应用及汇编语言之范例程序 ( 使用内部扩充内存为暂存区 ) 3 功能说明 : 3.1 本公司上述产品 EEPORM 功能皆可替换 STC89C5X, 仅需对特殊功能缓存器定义 ( 详见表 1) 及 ISP 命令定义 ( 详见表 2)

More information

untitled

untitled USING THE DESIGN ASSISTANT PanDeng 2004 05 Quartus help/search Design Assistant TMG6480 Design Assistant warning 1. Combinational logic used as clock signal should be implemented according to Altera standard

More information

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10 Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10 Ác Åé å Serial ATA ( Silicon Image SiI3114) S A T A (1) SATA (2)

More information

,768 32,767 32K JMP Jnnn (386+) LOOP CALL [Label:] JMP short/near/far address L10: jmp jmp L20: L10 L20

,768 32,767 32K JMP Jnnn (386+) LOOP CALL [Label:] JMP short/near/far address L10: jmp jmp L20: L10 L20 (Jump) (Loop) (Conditional jump) CMP CALL AND SAR/SHR TEST JMP NOT SAL/SHL Jnnn* OR RCR/ROR LOOP XOR RCL/ROL RETn * nnn, JNE JL -128 127-32,768 32,767 32K JMP Jnnn (386+) LOOP CALL [Label:] JMP short/near/far

More information

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666

More information

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2 Terminal Mode No User User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2 Mon1 Cam-- Mon- Cam-- Prohibited M04 Mon1 Cam03 Mon1 Cam03

More information

P4V88+_BIOS_CN.p65

P4V88+_BIOS_CN.p65 1 Main H/W Monitor Boot Security Exit System Overview System Time System Date [ 17:00:09] [Wed 12/22/2004] BIOS Version : P4V88+ BIOS P1.00 Processor Type : Intel (R) Pentium (R) 4 CPU 2.40 GHz Processor

More information

TSINGTEK DISPLAY CO.,LTD LCD CONTROLLER & DRIVER ST7920 OR EQUIVALENT (f) 639 2A f B1

TSINGTEK DISPLAY CO.,LTD LCD CONTROLLER & DRIVER ST7920 OR EQUIVALENT (f) 639 2A f B1 TSINGTEK DISPLAY CO.,LTD LCD CONTROLLER & DRIVER ST7920 OR EQUIVALENT 588 4 1 0571-85121224 85121742 85121304(f) 639 2A095 0571-88256346 89902095 f B1618 010-62051209 62000662 62568913 82036512 f http://www.tsingtek.com

More information

untitled

untitled MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12

More information

Microsoft Word - ISSFA-0134_A_AP_User-definedDownload_SC_.doc

Microsoft Word - ISSFA-0134_A_AP_User-definedDownload_SC_.doc 自定义下载应用说明 一 适用产品 :SM59XX 系列 SM59D XX 系列 SM59R XX 系列二 应用方式 : 可以让使用者自定义 command 作为进入 ISP 刻录的通关指令, 透过 UART 连接 ISAP 软件做联机更新三 操作说明 ( 使用 SM59D04G2 为例 ): 1. ISAP 操作方式 : 1.1 先将主程序及 ISP 服务程序烧进 MCU 中 1.2 将 MCU 放至系统版上,

More information

untitled

untitled EDM12864-GR 1 24 1. ----------------------------------------------------3 2. ----------------------------------------------------3 3. ----------------------------------------------------3 4. -------------------------------------------------------6

More information

Section1_16bit Arc.ppt

Section1_16bit Arc.ppt 16-bit Elite Program 2009 Summer Section-1 Microchip 16-bit 2005 Microchip Technology Incorporated. All Rights Reserved. Slide 1 MCU CPU (NOP),, (Data Memory), I/O CPU w. ALU/Working Reg. Data Mem. Data

More information

R/W

R/W (HD44780 KS0066 ) 3 3 5 6 10 14 HD44780/KS0066 16 2 LCM 8 1 40 4 LCD HD44780/KS0066 HD44100 IC PCB 0.1 CMOS 1. 2. 3. 4. 5. RH60% 6. 1. 2. 3. PCB 3 4. 5. 6. 1. 280 C 2. 3 4s 3. 4. 5. 3 5 1. 2. IC 3. DC-DC

More information

穨control.PDF

穨control.PDF TCP congestion control yhmiu Outline Congestion control algorithms Purpose of RFC2581 Purpose of RFC2582 TCP SS-DR 1998 TCP Extensions RFC1072 1988 SACK RFC2018 1996 FACK 1996 Rate-Halving 1997 OldTahoe

More information

Edge-Triggered Rising Edge-Triggered ( Falling Edge-Triggered ( Unit 11 Latches and Flip-Flops 3 Timing for D Flip-Flop (Falling-Edge Trigger) Unit 11

Edge-Triggered Rising Edge-Triggered ( Falling Edge-Triggered ( Unit 11 Latches and Flip-Flops 3 Timing for D Flip-Flop (Falling-Edge Trigger) Unit 11 Latches and Flip-Flops 11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch 11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop 11.6 J-K Flip-Flop 11.7 T Flip-Flop 11.8 Flip-Flops with additional Inputs

More information

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與 程 式 編 写 語 言 在 完 成 這 章 後, 你 將 能 夠 了 解 程 式 編 写 語 言 的 功 能 了 解 高 階 語 言 和 低 階 語 言 之 間 的 分 別 知 道 翻 譯 程 式 的 意 義 和 能 夠 把 翻 譯 程 式 分 類 為 : 匯 編 程 式 編 譯 程 式 和 解 譯 程 式 認 識 不 同 翻 譯 程 式 的 優 點 和 缺 點 程 式 是 指 揮 電 腦 的 指

More information

DR2010.doc

DR2010.doc DR/2010 HACH 11-8-96-2 HACH. DR/2010, / UL E79852 CSA C22.223 LR 58275 VDE GS 1015-92 FCC"A" 15 : AMADOR CORP, HACH. EN50 011/CISPR 11 "B" (EMI)/89/336/EEC/EMC: AMADOR CORP, HACH.. EN50 082-1( )/89/226/EEC

More information

AL-M200 Series

AL-M200 Series NPD4754-00 TC ( ) Windows 7 1. [Start ( )] [Control Panel ()] [Network and Internet ( )] 2. [Network and Sharing Center ( )] 3. [Change adapter settings ( )] 4. 3 Windows XP 1. [Start ( )] [Control Panel

More information

Microsoft PowerPoint - STU_EC_Ch02.ppt

Microsoft PowerPoint - STU_EC_Ch02.ppt 樹德科技大學資訊工程系 Chapter 2: Number Systems Operations and Codes Shi-Huang Chen Sept. 2010 1 Chapter Outline 2.1 Decimal Numbers 2.2 Binary Numbers 2.3 Decimal-to-Binary Conversion 2.4 Binary Arithmetic 2.5

More information

B 6 A A N A S A +V B B B +V 2

B 6 A A N A S A +V B B B +V 2 B 6 A A N A S A +V B B B +V 2 V A A B B 3 C Vcc FT7 B B 1 C 1 V cc C 2 B 2 G G B 3 C 3V cc C B ND ND GND V A A B B C 1 C 3 C 2 C V cc V cc V 220Ωx B 1 B 2 B 3 B GND GND A B A B 1 1 0 0 0 2 0 1 0 0 3 0

More information

untitled

untitled XZL024 http://item.taobao.com/item.htm?id=6321822194 1 1 1.1 1.2 1.3 1.4 2 2.1 2.2 2.3 3 USBee Suite 3.1 3.2 3.3 3.4 4 RS232 RS485 RS422 CAN http://item.taobao.com/item.htm?id=6321822194 2 1 XZL024 PC

More information

LK110_ck

LK110_ck Ck 电子琴 LK110CK1A Ck-1 1. 2. 1. 2. 3. (+) ( ) Ck-2 1. 2. 3. * 1. 2. 3. Ck-3 Ck-4 LCD LCD LCD LCD LCD LCD 15 * * / MIDI Ck-5 100 50 100 100 100 1 2 MIDI MIDI Ck-6 ... Ck-1... Ck-6... Ck-8... Ck-9... Ck-10...

More information

2005.book

2005.book ...4... 4... 7...10... 10... 10... 10... 10... 11... 11 PCC... 11 TB170... 12 /... 12...13... 13 BP150 / BP151 / BP152 / BP155... 14...15... 15... 15... 15... 15... 15... 15... 16 PS465 / PS477... 17 PS692

More information

ARM JTAG实时仿真器安装使用指南

ARM JTAG实时仿真器安装使用指南 ARM JTAG Version 1.31 2003. 11. 12 ARM JTAG ARM JTAG.3 ARM 2.1.4 2.2.4 ARM JTAG 3.1 18 3.2 18 3.2.1 Multi-ICE Server.18 3.2.2 ADS..21 ARM JTAG 4.1 Multi-ICE Server 33 4.1.1 Multi-ICE Server..... 33 4.1.2

More information

<4D F736F F D20B3E6B4B9A4F930365F32A443AC71C5E3A5DCBEB9B1B1A8EE2E646F63>

<4D F736F F D20B3E6B4B9A4F930365F32A443AC71C5E3A5DCBEB9B1B1A8EE2E646F63> 七段顯示器控制電路四位數 _ 使用解碼器驅動 +5 V 10 uf 8.2 k 12 MHz 20 pf 1 2 3 4 5 6 7 8 9 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RESET 10 P3.0 11 12 13 14 15 16 17 18 19 20 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 XTAL2 XTAL1

More information

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP Serial ATA ( Sil3132)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 10 (5) S A T A... 12 Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS

More information

GH1220 Hall Switch

GH1220 Hall Switch Unipolar Hall Switch - Medium Sensitivity Product Description The DH220 is a unipolar h all switch designed in CMOS technology. The IC internally includes a voltage regulator, Hall sensor with dynamic

More information

CA24064B LED LED LED EL EL CCFL EL CCF /

CA24064B LED LED LED EL EL CCFL EL CCF / CA24064B 0 50-20 +70-30 +85 LED LED LED EL EL CCFL EL CCF 39 2 6 0755-81995643/27890716 0 13713911853 0755-27890716 1 : VDD-VSS 0 6 V LCD VDD-V0 Ta=25 0 28.0 V VI 0 VDD V : VDD-VSS --- 4.75 5.0 5.25 V

More information