logo资料库

R8C中文资料.pdf

第1页 / 共436页
第2页 / 共436页
第3页 / 共436页
第4页 / 共436页
第5页 / 共436页
第6页 / 共436页
第7页 / 共436页
第8页 / 共436页
资料共436页,剩余部分请下载后查看
封面
Notes regarding these materials
关于利用本资料时的注意事项
产品使用上的注意事项
本手册的使用方法
目录
地址-页速查表
1. 概要
1.1 特点
1.1.1 用途
1.1.2 规格概要
1.2 产品一览
1.3 框图
1.4 引脚配置图
1.5 引脚功能的说明
2. 使用注意事项
2.1 时钟发生电路的使用注意事项
2.1.1 停止模式
2.1.2 等待模式
2.1.3 振荡停止检测功能
2.1.4 振荡电路常数
2.2 中断的使用注意事项
2.2.1 地址00000h的读取
2.2.2 SP的设定
2.2.3 外部中断和键输入中断
2.2.4 中断源的更改
2.2.5 中断控制寄存器的更改
2.3 定时器
2.3.1 定时器RA的使用注意事项
2.3.2 定时器RB的使用注意事项
2.3.3 定时器RC的使用注意事项
2.3.4 定时器RD的使用注意事项
2.4 串行接口的使用注意事项
2.5 硬件LIN的使用注意事项
2.6 A/D转换器的使用注意事项
2.7 闪存的使用注意事项
2.7.1 CPU改写模式
2.8 有关噪声的注意事项
2.8.1 作为噪声和闩锁对策,在VCC-VSS引脚之间插入旁路电容
2.8.2 端口控制寄存器的噪声误动作对策
3. 中央处理器(CPU)
3.1 数据寄存器(R0、R1、R2、R3)
3.2 地址寄存器(A0、A1)
3.3 帧基址寄存器(FB)
3.4 中断表寄存器(INTB)
3.5 程序计数器(PC)
3.6 用户堆栈指针(USP)和中断堆栈指针(ISP)
3.7 堆栈基址寄存器(SB)
3.8 标志寄存器(FLG)
3.8.1 进位标志(C标志)
3.8.2 调试标志(D标志)
3.8.3 零标志(Z标志)
3.8.4 符号标志(S标志)
3.8.5 寄存器组指定标志(B标志)
3.8.6 上溢标志(O标志)
3.8.7 中断允许标志(I标志)
3.8.8 堆栈指针指定标志(U标志)
3.8.9 处理器中断优先级(IPL)
3.8.10 保留位
4. 存储器
4.1 R8C/2K群
4.2 R8C/2L群
5. SFR
6. 复位
6.1 硬件复位
6.1.1 电源稳定的情况
6.1.2 接通电源的情况
6.2 上电复位功能
6.3 电压监视0复位
6.4 电压监视1复位
6.5 电压监视2复位
6.6 看门狗定时器复位
6.7 软件复位
7. 电压检测电路
7.1 VCC输入电压的监视
7.1.1 Vdet0的监视
7.1.2 Vdet1的监视
7.1.3 Vdet2的监视
7.2 电压监视0复位
7.3 电压监视1中断和电压监视1复位
7.4 电压监视2中断和电压监视2复位
8. 可编程输入/输出端口
8.1 可编程输入/输出端口的功能
8.2 对外围功能的影响
8.3 可编程输入/输出端口以外的引脚
8.4 端口的设定
8.5 未使用引脚的处理
9. 处理器模式
9.1 处理器模式的种类
10. 总线控制
11. 时钟发生电路
11.1 XIN时钟
11.2 内部振荡器时钟
11.2.1 低速内部振荡器时钟
11.2.2 高速内部振荡器时钟
11.3 CPU时钟和外围功能时钟
11.3.1 系统时钟
11.3.2 CPU时钟
11.4 功率控制
11.4.1 标准运行模式
11.4.2 等待模式
11.4.3 停止模式
11.5 振荡停止检测功能
11.5.1 振荡停止检测功能的使用方法
11.6 时钟发生电路的使用注意事项
11.6.1 停止模式
11.6.2 等待模式
11.6.3 振荡停止检测功能
11.6.4 振荡电路常数
12. 保护
13. 中断
13.1 中断概要
13.1.1 中断分类
13.1.2 软件中断
13.1.3 特殊中断
13.1.4 外围功能中断
13.1.5 中断和中断向量
13.1.6 中断控制
13.2 INT中断
13.2.1 INTi中断(i=0、1、3)
13.2.2 INTi输入滤波器(i=0、1、3)
13.3 键输入中断
13.4 地址匹配中断
13.5 定时器RC中断和定时器RD中断(有多个中断请求源的中断)
13.6 中断的使用注意事项
13.6.1 地址00000h的读取
13.6.2 SP的设定
13.6.3 外部中断和键输入中断
13.6.4 中断源的更改
13.6.5 中断控制寄存器的更改
14. ID代码区
14.1 概要
14.2 功能
14.3 ID代码区的使用注意事项
14.3.1 ID代码区的设定例子
15. 选项功能选择区
15.1 概要
15.2 OFS寄存器
15.3 选项功能选择区的使用注意事项
15.3.1 选项功能选择区的设定例子
16. 看门狗定时器
16.1 计数源保护模式无效时
16.2 计数源保护模式有效时
17. 定时器
17.1 定时器RA
17.1.1 定时器模式
17.1.2 脉冲输出模式
17.1.3 事件计数器模式
17.1.4 脉宽测量模式
17.1.5 脉冲周期测量模式
17.1.6 定时器RA的使用注意事项
17.2 定时器RB
17.2.1 定时器模式
17.2.2 可编程波形发生模式
17.2.3 可编程单触发发生模式
17.2.4 可编程等待单触发发生模式
17.2.5 定时器RB的使用注意事项
17.3 定时器RC
17.3.1 概要
17.3.2 定时器RC的关联寄存器
17.3.3 有关多个模式的共同事项
17.3.4 定时器模式(输入捕捉功能)
17.3.5 定时器模式(输出比较功能)
17.3.6 PWM模式
17.3.7 PWM2模式
17.3.8 定时器RC中断
17.3.9 定时器RC的使用注意事项
17.4 定时器RD
17.4.1 计数源
17.4.2 缓冲器运行
17.4.3 同步运行
17.4.4 脉冲输出的强制截止
17.4.5 输入捕捉功能
17.4.6 输出比较功能
17.4.7 PWM模式
17.4.8 复位同步PWM模式
17.4.9 互补PWM模式
17.4.10 PWM3模式
17.4.11 定时器RD中断
17.4.12 定时器RD的使用注意事项
18. 串行接口
18.1 时钟同步串行I/O模式
18.1.1 极性选择功能
18.1.2 LSB先或者MSB先的选择
18.1.3 连续接收模式
18.2 时钟异步串行I/O(UART)模式
18.2.1 位速率
18.3 串行接口的使用注意事项
19. 硬件LIN
19.1 特点
19.2 输入/输出引脚
19.3 寄存器构成
19.4 运行说明
19.4.1 主模式
19.4.2 从属模式
19.4.3 总线冲突检测功能
19.4.4 硬件LIN的结束处理
19.5 中断请求
19.6 硬件LIN的使用注意事项
20. A/D转换器
20.1 单次模式
20.2 重复模式
20.3 采样&保持
20.4 A/D转换周期数
20.5 模拟输入内部等效电路
20.6 A/D转换时传感器的输出阻抗
20.7 A/D转换器的使用注意事项
21. 闪存
21.1 概要
21.2 存储器的配置
21.3 闪存改写的禁止功能
21.3.1 ID码的检查功能
21.3.2 ROM码的保护功能
21.4 CPU改写模式
21.4.1 寄存器的说明
21.4.2 状态的检查方法
21.4.3 EW0模式
21.4.4 EW1模式
21.5 标准串行输入/输出模式
21.5.1 ID码的检查功能
21.6 并行输入/输出模式
21.6.1 ROM码的保护功能
21.7 闪存的使用注意事项
21.7.1 CPU改写模式
22. 功耗的减少
22.1 概要
22.2 功耗减少的要点和处理方法
22.2.1 电压检测电路
22.2.2 端口
22.2.3 时钟
22.2.4 等待模式和停止模式
22.2.5 外围功能时钟的停止
22.2.6 定时器
22.2.7 A/D转换器
22.2.8 内部电源的功耗减少
22.2.9 闪存的停止
22.2.10 低消耗电流读模式
23. 电特性
24. On-chip调试器的注意事项
附 录
附录1. 外形尺寸图
附录2. 串行编程器和on-chip调试仿真器的连接例子
附录3. 振荡评价电路例子
索引
修订记录
底页
地址栏
封 底
致尊敬的顾客 关于产品目录等资料中的旧公司名称 NEC电子公司与株式会社瑞萨科技于2010年4月1日进行业务整合(合并),整合后的 新公司暨“瑞萨电子公司”继承两家公司的所有业务。因此,本资料中虽还保留有旧公司 名称等标识,但是并不妨碍本资料的有效性,敬请谅解。 瑞萨电子公司网址:http://www.renesas.com 2010年4月1日 瑞萨电子公司 【发行】瑞萨电子公司(http://www.renesas.com) 【业务咨询】http://www.renesas.com/inquiry
Notice 1. 2. 3. 4. All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software, and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 5. When exporting the products or technology described in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations. You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein. Renesas Electronics products are classified according to the following three quality grades: “Standard”, “High Quality”, and “Specific”. The recommended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below. You must check the quality grade of each Renesas Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any application categorized as “Specific” without the prior written consent of Renesas Electronics. Further, you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as “Specific” or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics. The quality grade of each Renesas Electronics product is “Standard” unless otherwise expressly specified in a Renesas Electronics data sheets or data books, etc. “Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots. “High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anti- 6. 7. “Specific”: crime systems; safety equipment; and medical equipment not specifically designed for life support. Aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or systems for life support (e.g. artificial life support devices or systems), surgical implantations, or healthcare intervention (e.g. excision, etc.), and any other applications or purposes that pose a direct threat to human life. 8. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you. 9. 10. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations. 11. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas Electronics. 12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products, or if you have any other inquiries. (Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority- owned subsidiaries. (Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
封 RCJ09B0056-0100 H a r d w a r e M a n u a l R8C/2K群、 R8C/2L 群 16 瑞萨单片机 M16C族/R8C/Tiny 系列 www.renesas.com Rev.1.00 2008.02
Notes regarding these materials Notes regarding these materials 1. This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document. 2. Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document, including, but not limited to, product data, diagrams, charts, programs, algorithms, and application circuit examples. 3. You should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use. When exporting the products or technology described herein, you should follow the applicable export control laws and regulations, and procedures required by such laws and regulations. 4. All information included in this document such as product data, diagrams, charts, programs, algorithms, and application circuit examples, is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas products listed in this document, please confirm the latest product information with a Renesas sales office. Also, please pay regular and careful attention to additional and different information to be disclosed by Renesas such as that disclosed through our website. (http://www.renesas.com ) 5. Renesas has used reasonable care in compiling the information included in this document, but Renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document. 6. When using or otherwise relying on the information in this document, you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application. Renesas makes no representations, warranties or guaranties regarding the suitability of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or Renesas products. 7. With the exception of products specified by Renesas as suitable for automobile applications, Renesas products are not designed, manufactured or tested for applications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems, or equipment or systems for transportation and traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or undersea communication transmission. If you are considering the use of our products for such purposes, please contact a Renesas sales office beforehand. Renesas shall have no liability for damages arising out of the uses set forth above. 8. Notwithstanding the preceding paragraph, you should not use Renesas products for the purposes listed below: (1) artificial life support devices or systems (2) surgical implantations (3) healthcare intervention (e.g., excision, administration of medication, etc.) (4) any other purposes that pose a direct threat to human life Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renesas Technology Corp., its affiliated companies and their officers, directors, and employees against any and all damages arising out of such applications. 9. You should use the products described herein within the range specified by Renesas, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas shall have no liability for malfunctions or damages arising out of the use of Renesas products beyond such specified ranges. 10. Although Renesas endeavors to improve the quality and reliability of its products, IC products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other applicable measures. Among others, since the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you. 11. In case Renesas products listed in this document are detached from the products to which the Renesas products are attached or affixed, the risk of accident such as swallowing by infants and small children is very high. You should implement safety measures so that Renesas products may not be easily detached from your products. Renesas shall have no liability for damages arising out of such detachment. 12. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written approval from Renesas. 13. Please contact a Renesas sales office if you have any questions regarding the information contained in this document, Renesas semiconductor products, or if you have any other inquiries.
关于利用本资料时的注意事项 “Cautions” 1. 2. 3. 4. (http://www.renesas.com) 5. 6. 7. 8. 1 2 3 4 9. 10. 11. 12. 13.
产品使用上的注意事项 本文对适用于所有单片机产品的 “使用注意事项”进行说明,有关个别的使用注意事项请参照正文。此 外,如果出现与本手册的正文不同的记载,以本文的记载为准。 1. 未使用引脚的处理 【注意】将未使用的引脚按照本文的 “未使用引脚的处理”进行处理。 CMOS 产品的输入引脚一般为高阻抗输入。如果单片机在未使用的输入引脚处于开放状态下运行, 就可能因感应而LSI 周围的噪声外加到未使用的输入引脚,导致在LSI内部产生穿透电流,或者被 误认为是输入信号,引起误动作。未使用的引脚必须按照本文的 “未使用引脚的处理”的指示进 行处理。 2. 接通电源时的处理 【注意】接通电源时产品处于不定状态。 接通电源时, LSI内部电路、寄存器的设定和各引脚处于不确定状态。对于用外部复位引脚进行复 位的产品,在接通电源到复位有效的期间,不能保证引脚的状态。 同样,对于用内部上电复位功能进行复位的产品,在接通电源到达到复位所需规定电压的期间,不 能保证引脚的状态。 3. 禁止存取保留地址 【注意】禁止存取保留地址 在地址区域中分配有用作将来功能扩展的保留地址。因为无法保证存取这些地址时的运行,所以请 不要进行存取。 4. 关于时钟 【注意】复位时,必须在时钟稳定后解除复位。 在程序执行中切换时钟时,必须在切换目的时钟稳定之后进行。复位时,对于通过使用外部振荡器 (或者外部振荡电路)的时钟开始运行的系统,必须在时钟充分稳定后解除复位。另外,在程序执 行中切换成使用外部振荡器 (或者外部振荡电路)的时钟时,必须在切换目的时钟充分稳定后进 行。 5. 关于产品间的差异 【注意】在更换不同型号的产品时,必须事先确认是否没问题。 即使是同一个群中的单片机,如果产品型号不同,就可能因内部存储器、版图模式等的不同而引起 特性的不同。因此,在更换不同型号的产品时,必须对每一个型号的产品进行系统评价测试。
1 目的和对象 本手册的使用方法 本手册是一本帮助用户理解本单片机的硬件功能和电特性的手册,它以设计本单片机应用系统的用户为对 象。在使用本手册时,需要具备电路、逻辑电路以及单片机的基础知识。 本手册由产品概要、 CPU、系统控制功能、外围功能、电特性、使用注意事项等几部分组成。 必须在充分确认过注意事项后使用本单片机。注意事项记载在各章的正文中、各章的最后和注意事项的章节 中。 修订记录归纳了对旧版本记载内容的更正或追加的主要位置,但是没有记录全部的修订内容。详细内容请通 过本手册的正文确认。 为 R8C/2K 群、 R8C/2L 群准备了以下的文献。请使用最新的文献,最新版本刊登在瑞萨科技的主页上。 文献的种类 记载内容 资料名 数据表 硬件的概要和电特性 硬件手册 硬件的说明 (引脚配置、存储器映像、外围 功能的说明、电特性、时序)和运行说明 ※有关外围功能的使用方法,请参照应用注 意事项。 CPU 指令设定的说明 R8C/2K 群、 R8C/2L 群 数据表 R8C/2K 群、 R8C/2L 群 硬件手册 资料号 REJ03B0219 本硬件手册 R8C/Tiny 系列软件手册 RCJ09B0006 软件手册 应用手册 外围功能的使用方法、应用例子 刊登在瑞萨科技的主页上 参考程序 汇编语言、 C 语言的编程方法 有关产品规格、文献等的速报 RENESAS TECHNICAL UPDATE 2 数字、符号的表示 本手册使用的寄存器名或位名、数字或符号的表示范例如下所示。 1. 寄存器名、位名、引脚名 在正文中用符号表示。符号后面带有寄存器、位、引脚字样加以区别。 (例) PM0 寄存器的 PM03 位 P3_5 引脚、 VCC 引脚 2. 数字的表示 2 进制数的后面带有 “b”,但是在只有 1 位时数字后面什么也没有; 16 进制数后面带有 “h”; 十进制数后面什么也没有。 (例) 2 进制数:11b 16 进制数:EFA0h 10 进制数:1234
3 寄存器图表的阅读方法 说明在寄存器图表中使用的符号和用语 b7 b6 b5 b4 b3 b2 b1 b0 0 *1 00h 0 1 b1 b0 0 0 0 1 1 0 1 1 (b2) (b4 - b3) 5 6 7 0 1 *5 RW RW RW *2 *3 WO *4 RW RW RO *1 空白 :按用途,置 “0”或 “1”。 0 :置 “0”。 1 :置 “1”。 × :什么也不指定。 *2 RW :可读,可写。 RO :可读,写数据无效。 WO :可写,不能读取位的状态。 - :什么也不指定。 *3 · 保留位 保留位,必须写指定值。 *4 · 什么也不指定 对该位,什么也不指定。根据将来外围功能的发展,可能出现新的功能。写数据时只能写 “0”。 · 不能设定 不保证设定后的运行。 · 功能根据运行模式而不同 位功能根据外围功能的模式发生变化,请参照各模式的寄存器图表。 *5 2 进制或者 16 进制的记数法按各手册而定。
分享到:
收藏