首页| 行业标准| 论文文档| 电子资料| 图纸模型
购买积分 购买会员 激活码充值

您现在的位置是:团子下载站 > 电源技术 > 使用定时器和计数器创建高效的基于MCU的设计

使用定时器和计数器创建高效的基于MCU的设计

  • 资源大小:0.32 MB
  • 上传时间:2021-09-03
  • 下载次数:0次
  • 浏览次数:29次
  • 资源积分:1积分
  • 标      签: 定时器 计数器 mcu

资 源 简 介

使用定时器和计数器创建高效的基于MCU的设计     定时器和计数器可能是MCU设计中最普遍的外围设备。任何应用程序都可以使用定时器或计数器来提高性能,降低功耗,或者简化设计,用简单的定时器或计数器中断替换重复或循环的CPU操作。您可能没有使用一些最近的计时器/计数器单位,但是,一些先进的功能现在可以提高您的设计更。本文将快速回顾一些新的定时器/计数器功能,您可以使用,以改善您的设计与说明性的例子,从流行的MCU家庭,特别强调功能的自主操作和电机控制。          TImer and counter modes: from simple to advanced     TImers and counters started out with some very simple modes of operaTIon to replace common-program loops for counTIng external events, for timing internal and external operations and for collecting various statistics on key MCU operations. Some of the most familiar counting modes are illustrated by the features in the Maxim MAXQ612 MCU and some examples are shown in Figure 1 below. The table at the bottom of the figure shows three common autonomous operation modes for Timer B, the MAXQ612 timer/counter block: Auto-reload, capture, and pp/down counting. The figure in the upper right shows the block diagram for the auto-reload mode. The clock input for Timer B can come from a clock prescaler that can divide the system clock with eight different settings, or from an external pin. A control bit, TRB, enables or disables Timer B operation. The timer-value register (TVB) counts up when clocked and when it reaches the value stored in the Timer B reload register (TBR) and interrupt is generated and TVB is reset to zero. This provides a simple method for creating delays without using up valuable CPU cycles to create a delay. An external pin can be used to optionally reset TVB to zero as well, making this mode useful for creating a timeout if an expected input does not show up in the expected amount of time.
VIP VIP