设计一个单片机控制的简易定时报警器。要求根据设定的初始值(1-59秒)进行倒计时,当计时到0时数码管闪烁“00”(以1Hz闪烁),按键功能如下:(1)设定键:在倒计时模式时,按下此键后停止倒计时,进入设置状态;如果已经处于设置状态则此键无效。(2)增一键:在设置状态时,每按一次递增键,初始值的数字增1。(3)递一键:在设置状态时,每按一次递减键,初始值的数字减1。(4)确认键:在设置状态时,按下此键后,单片机按照新的初始值进行倒计时及显示倒计时的数字。如果已经处于计时状态则此键无效。3.1.2 模块1:系统设计(1)任务分析与整体设计思路根据题目的要求,需要实现如下几个方面的功能。计时功能:要实现计时功能则需要使用定时器来计时,通过设置定时器的初始值来控制溢出中断的时间间隔,再利用一个变量记录定时器溢出的次数,达到定时1秒中的功能。然后,当计时每到1秒钟后,倒计时的计数器减1。当倒计时计数器到0时,触发另一个标志变量,进入闪烁状态。显示功能:显示倒计时的数字要采用动态扫描的方式将数字拆成“十位”和“个位”动态扫描显示。如果处于闪烁状态,则可以不需要动态扫描显示,只需要控制共阴极数码管的位控线,实现数码管的灭和亮。键盘扫描和运行模式的切换:主程序在初始化一些变量和寄存器之后,需要不断循环地读取键盘的状态和动态扫描数码管显示相应的数字。根据键盘的按键值实现设置状态、计时状态的切换。 (2)单片机型号及所需外围器件型号,单片机硬件电路原理图选用MCS-51系列AT89S51单片机作为微控制器,选择两个四联的共阴极数码管组成8位显示模块,由于AT89S51单片机驱动能力有限,采用两片74HC244实现总线的驱动,一个74HC244完成位控线的控制和驱动,另一个74HC244完成数码管的7段码输出,在输出口上各串联一个100欧姆的电阻对7段数码管限流。由于键盘数量不多,选择独立式按键与P1口连接作为四个按键输入。没有键按下时P1.0-P1.3为高电平,当有键按下时,P1.0-P1.3相应管脚为低电平。电路原理图如图3-1所示。
上传时间: 2013-11-13
上传用户:曹云鹏
本章将介绍μ’nSP™系列单片机的应用领域,具体讲述SPCE061A单片机在通讯、语音领域里的应用,并详细给出了有关系统的电路原理图、程序流程图以及程序代码,供读者参考。 μ’nSP™家族产品具有电源电压范围和工作速率范围较宽、集成度高、性能价格比高以及功耗低等特点,故其有非常广泛的应用领域。μ’nSP™家族系列产品,涵盖了非常广泛的应用。包括:发音与语音识别的微控制器(SPCE系列)、通信来电辩识应用的微控制器(SPT660x系列)、以及通用型微控制器等等,主要体现在以下几个方面: 用于数字信号处理 用于开发研制便携式移动终端 用于开发嵌入式计算机应用系统 用于数字信号处理1. 数字滤波器 (Digital Filter)数字滤波器是一种计算处理或算法。借助于此,可以将输入的一种数字信号或序列变换为另一种序列输出。数字滤波器已被广泛地应用于数字语音、数字图像处理以及模式识别和频谱分析。数字信号处理器(DSP,Digital Signal Processor)的作用是通过一系列数字来表示信号及其信息,并借助数字计算方法变换和处理这些信号。为了构成DSP,必须有一种部件能够快速地完成两个数值的乘法运算并将乘积累加于寄存器。“快速”意味着乘和累加(MAC,Multiply & ACcumulate)较高的运算速度。若以16位数值进行乘和累加,其结果应为32位。显然,μ’nSP™的硬件结构与其指令系统的结合足以构成DSP应用的硬件MAC单元,因而很适用于一些DSP方面的应用。
上传时间: 2014-01-26
上传用户:qb1993225
随着当前电子技术及发动机电控技术的发展,以32位嵌入式微控制器及多任务实时操作系统为基本技术特征的新一代电子控制单元ECU(Electronic Control Unit)的开发已成为汽车电子发展应用的主流。本文在Tonadofor OSEKWorks多任务实时操作系统及32佗Power PC微控制器MPC555的基础上,介绍高压共轨柴油发动机电子控制单元的最小系统设计方案。
上传时间: 2013-10-30
上传用户:miaochun888
本文档将深入介绍内部时钟源模块(Internal ClockSource, ICS),该模块可以在部分HCS08 系列微控制器中找到。对HCS08 MCU 来说, ICS 模块不但是一个非常灵活的时钟源,而且对于该系列中更小、更低成本的MCU来说非常经济。ICS 包括锁频环、内部时钟参考、外部振荡器和时钟选择子模块。这些子模块组合可以提供多种时钟模式和频率,以满足任何应用的需要。本应用笔记详细描述ICS 的7 种工作模式、ICS 模块与其他HCS08 MCU 的内部时钟发生器(Internal ClockGenerator, ICG)模块作比较、ICS 模块从不同低功耗模式下恢复的特性及内部时钟参考的校准方法。
上传时间: 2013-11-08
上传用户:zhuoying119
The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using SW routines implemented in C. The code is focused onthe SAB C513, but will fit to all C500 derivatives.Beyond the low level software drivers a test shell is delivered. This shell allows a quicktest of the software drivers by an emulator or a starter kit demo board.
上传时间: 2013-11-24
上传用户:363186
The Infineon TriCore provides an Interrupt System with a high safety standard. Thisdocument contains some instructions on how to initiate an Interrupt from an externaldevice. First it will show you how to trigger an Interrupt Service Request by an impulseon Port 0 or Port 1. Then in the second part of the document you can find hints how todebounce impulses to enable the use of a simple switch as input device.Authors: Thomas Bliem, CQ Nguyen / Infineon SMI MD Apps
上传时间: 2013-11-05
上传用户:uuuuuuu
All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.
上传时间: 2014-04-02
上传用户:han_zh
基于P87 C591的CAN总线系统智能节点设计Design of CAN System Intelligent Node Based on P87C591 给出了基于带CAN控制器的单片8位微控制器P87C591的智能节点的硬件电路及软件结构,详细介绍了设计中的难点及实现过程中应注意的问题。关键词:CAN总线;智能节点 Abstract:A h ardc ircuita nds oftw arec onfigurationo fth ei ntelligentnode based on a microcontroller with CAN controller P87C591 arepresented.E speciallyt hec ruxi nd esigninga ndt hep roblemst hatshould be paid attention in realizing are discussed in details.Keyw ords:C AN;in telligentn ode CA N 总线 是德国Bosch从20世纪80年代初为解决现代汽车中众多的控制与测试仪器之间的数据交换而开发的一种串行数据通信协议,它是一种多主总线,通信介质可以是双绞线、同轴电缆或光导纤维。由于CAN总线具有较强的纠错能力,支持差分收发,因而适合高噪声环境。并具有较远的传输距离,适用于许多领域的分布式测控系统。目前已在工业自动化、建筑物环境控制、医疗设备等许多领域得到广泛的应用。CAN已成为国际标准化组织IS011898标准。
上传时间: 2013-10-30
上传用户:xymbian
The 87C576 includes two separate methods of programming theEPROM array, the traditional modified Quick-Pulse method, and anew On-Board Programming technique (OBP).Quick Pulse programming is a method using a number of devicepins in parallel (see Figure 1) and is the traditional way in which87C51 family members have been programmed. The Quick-Pulsemethod supports the following programming functions:– program USER EPROM– verify USER EPROM– program KEY EPROM– program security bits– verify security bits– read signature bytesThe Quick-Pulse method is quite easily suited to standardprogramming equipment as evidenced by the numerous vendors of87C51 compatible programmers on the market today. Onedisadvantage is that this method is not well suited to programming inthe embedded application because of the large number of signallines that must be isolated from the application. In addition, parallelsignals from a programmer would need to be cabled to theapplication’s circuit board, or the application circuit board wouldneed to have logic built-in to perform the programming functions.These requirements have generally made in-circuit programmingusing the modified Quick Pulse method impractical in almost all87C51 family applications.
上传时间: 2013-10-21
上传用户:xiaozhiqban
当拿到一张CASE单时,首先得确定的是能用什么母体才能实现此功能,然后才能展开对外围硬件电路的设计,因此首先得了解每个母体的基本功能及特点,下面大至的介绍一下本公司常用的IC:单芯片解决方案• SN8P1900 系列– 高精度 16-Bit 模数转换器– 可编程运算放大器 (PGIA)• 信号放大低漂移: 2V• 放大倍数可编程: 1/16/64/128 倍– 升压- 稳压调节器 (Charge-Pump Regulator)• 电源输入: 2.4V ~ 5V• 稳压输出: e.g. 3.8V at SN8P1909– 内置液晶驱动电路 (LCD Driver)– 单芯片解决方案 • 耳温枪 SN8P1909 LQFP 80 Pins• 5000 解析度量测器 SN8P1908 LQFP 64 Pins• 体重计 SN8P1907 SSOP 48 Pins单芯片解决方案• SN8P1820 系列– 精确的12-Bit 模数转换器– 可编程运算放大器 (PGIA)• Gain Stage One: Low Offset 5V, Gain: 16/32/64/128• Gain Stage One: Low Offset 2mV, Gain: 1.3 ~ 2.5– 升压- 稳压调节器• 电源输入: 2.4V ~ 5V• 稳压输出: e.g. 3.8V at SN8P1829– 内置可编程运算放大电路– 内置液晶驱动电路 – 单芯片解决方案 • 电子医疗器 SN8P1829 LQFP 80 Pins 高速/低功耗/高可靠性微控制器• 最新SN8P2000 系列– SN8P2500/2600/2700 系列– 高度抗交流杂讯能力• 标准瞬间电压脉冲群测试 (EFT): IEC 1000-4-4• 杂讯直接灌入芯片电源输入端• 只需添加1颗 2.2F/50V 旁路电容• 测试指标稳超 4000V (欧规)– 高可靠性复位电路保证系统正常运行• 支持外部复位和内部上电复位• 内置1.8V 低电压侦测可靠复位电路• 内置看门狗计时器保证程序跳飞可靠复位– 高抗静电/栓锁效应能力– 芯片工作温度有所提高: -200C ~ 700C 工规芯片温度: -400C ~ 850C 高速/低功耗/高可靠性微控制器• 最新 SN8P2000 系列– SN8P2500/2600/2700 系列– 1T 精简指令级结构• 1T: 一个外部振荡周期执行一条指令• 工作速度可达16 MIPS / 16 MHz Crystal– 工作消耗电流 < 2mA at 1-MIPS/5V– 睡眠模式下消耗电流 < 1A / 5V额外功能• 高速脉宽调制输出 (PWM)– 8-Bit PWM up to 23 KHz at 12 MHz System Clock– 6-Bit PWM up to 93 KHz at 12 MHz System Clock– 4-Bit PWM up to 375 KHz at 12 MHz System Clock• 内置高速16 MHz RC振荡器 (SN8P2501A)• 电压变化唤醒功能• 可编程控制沿触发/中断功能– 上升沿 / 下降沿 / 双沿触发• 串行编程接口
上传时间: 2013-10-21
上传用户:jiahao131