常见问答
- M051 系列(95)
- M0518 系列(97)
- M0519 系列(43)
- M0564 系列(1)
- Mini51 系列(90)
- Nano100 / 102 系列(101)
- Nano103 Base 系列(10)
- Nano110 / 112 LCD 系列(100)
- Nano120 USB 系列(111)
- Nano130 USB+LCD 系列(110)
- NUC029 系列(94)
- NUC100 / 200 系列(102)
- NUC120 / 122 / 123 / 220 USB 系列(116)
- NUC121/125 系列(1)
- NUC126 USB 系列(2)
- NUC130 / 230 CAN 系列(103)
- NUC131/NUC1311 CAN 系列(98)
- NUC140 / 240 USB+CAN 系列(114)
- M451 Base 系列(118)
- M451M 系列(117)
- M452 USB 系列(130)
- M4521 USB 系列(1)
- M453 CAN 系列(128)
- M463 CAN FD/USB HS 系列(1)
- M467 Ethernet/Crypto 系列(1)
- M471 系列(1)
- M479 Motor Control Series(1)
- M481 Base 系列(4)
- M482 USB FS OTG 系列(4)
- M483 CAN 系列(4)
- M484 USB HS OTG 系列(4)
- M485 Crypto 系列(4)
- M487 Ethernet 系列(4)
- M4TK 触摸 IC 系列(25)
- NUC442 / 472 系列(130)
- NUC472 Series(1)
- NUC505 系列(138)
常见问答
如何使用Software Reset或CPU reset,得到比硬件重置更短的复位时间? 日期:2021-09-01
Nuvoton 的 8051 系列 MCU 备有 Software Reset 功能,其复位所需时间可比其他硬件重置方式更短。
用户可设置 SWRST 比特位 (CHPCON.7) 来执行 Software Reset 功能,范例程序如下:
TA = 0xAA; TA = 0x55; //enable Time Access Protection (TA)
CHPCON = 0x80; //write 1 to SWRST to trigger a Software Reset
/* Trap the CPU */
while(1);
用户可以透过 SWRF 比特位 (AUXR0.7) 确认 Software Reset 是否为上一次的复位来源。
而在 Nuvoton 的 M0/M23/M4 系列 MCU 则称为 CPU Reset 功能。
用户可设置 CPURST 比特位 (SYS_IPRST0[1]) 来执行 CPU Reset 功能,其范例程序如下:
SYS_REGLCTL = 0x59; SYS_REGLCTL = 0x16; SYS_REGLCTL = 0x88; //enable Register Lock Control
SYS_IPRST0 = 0x02; //write 1 to CPURST to trigger a CPU Reset
/* Trap the CPU */
while(1);
用户可透过 System Reset Status 缓存器 (SYS_RSTSTS) 确认上一次的复位来源。
举例来说,若上一次的复位来源为 CPU Reset,则 CPU Reset Flag,也就是 CPURF (SYS_RSTSTS[7]) 将会被设为 1。
以 MS51 当主控为例,硬件复位需要做 RC 充电约耗费 50 毫秒,而从 SWRST 的设置到下一次的 Main 入口约需 800 微秒,此即为 Software Reset 复位时间。
产品: | 微控制器 ,8 位 8051 微控制器 ,Arm Cortex-M0 微控制器 ,Arm Cortex-M23 微控制器 ,Arm Cortex-M4 微控制器 |
---|---|
应用: | |
功能: | Peripherals,System Operation,Reset,Software and Tools,Development-Environment,IAR,Keil |