介绍了基于89S51 单片机的微型热敏打印机的组成,分析了打印原理,详细给出了整体流程以及各个功能模块的软件设计。热敏打印头采用I/O 口模拟串行数据传输实现数据加载。设计的微型热敏打印机运用于实际,取得了良好的效果。关键词:热敏打印机 过热保护 步进电机 数据加载由于常用的微型针式打印机的速度慢,噪声大,无法满足某些场合的需要。微型热敏打印机具有打印速度快、噪音低、可靠性高、字迹清晰、机头小而轻等优点,可满足各种场合的打印要求,因此得到广泛应用。笔者在汽车行驶记录仪的开发过程中,根据厂家要求,选用较为先进的热敏打印机作为打印设备。但微型热敏打印头对打印时序和温度要求较高,一旦控制不当极易造成打印头烧毁。因此,在有合理的硬件设计的基础上,软件设计也十分重要。本文使用某些软件设计替代了部分硬件电路,使打印机的控制电路得到了简化。
上传时间: 2013-11-14
上传用户:digacha
抽样z变换频率抽样理论:我们将先阐明:(1)z变换与DFT的关系(抽样z变换),在此基础上引出抽样z变换的概念,并进一步深入讨论频域抽样不失真条件。(2)频域抽样理论(频域抽样不失真条件)(3)频域内插公式一、z变换与DFT关系(1)引入连续傅里叶变换引出离散傅里叶变换定义式。离散傅里叶变换看作是序列的傅里叶变换在 频 域 再 抽 样 后 的 变 换 对.在Z变换与L变换中,又可了解到序列的傅里叶 变换就是单位圆上的Z 变 换.所以对序列的傅里叶变换进行频域抽样时, 自 然可以看作是对单位圆上的 Z变换进行抽样. (2)推导Z 变 换 的 定 义 式 (正 变 换) 重 写 如 下: 取z=ejw 代 入 定 义 式, 得 到 单 位 圆 上 Z 变 换 为w是 单 位 圆 上 各 点 的 数 字 角 频 率.再 进 行 抽 样-- N 等 分.这 样w=2kπ/N, 即w值为0,2π/N,4π/N,6π/N…, 考虑到x(n)是N点有限长序列, 因而n只需0~N-1即可。将w=2kπ/N代入并改变上下限, 得 则这正是离散傅里叶变换 (DFT)正变换定义式.
上传时间: 2014-12-28
上传用户:zhaistone
The C500 microcontroller family usually provides only one on-chip synchronous serialchannel (SSC). If a second SSC is required, an emulation of the missing interface mayhelp to avoid an external hardware solution with additional electronic components.The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using optimized SW routines with a performance up to 25KBaud in Slave Mode with half duplex transmission and an overhead less than 60% atSAB C513 with 12 MHz. Due to the implementation in C this performance is not the limitof the chip. A pure implementation in assembler will result in a strong reduction of theCPU load and therefore increase the maximum speed of the interface. In addition,microcontrollers like the SAB C505 will speed up the interface by a factor of two becauseof an optimized architecture compared with the SAB C513.Moreover, this solution lays stress on using as few on-chip hardware resources aspossible. A more excessive consumption of those resources will result in a highermaximum speed of the emulated interface.Due to the restricted performance of an 8 bit microcontroller a pin compatible solution isprovided only; the internal register based programming interface is replaced by a set ofsubroutine calls.The attached source files also contain a test shell, which demonstrates how to exchangeinformation between an on-chip HW-SSC and the emulated SW-SSC via 5 external wiresin different operation modes. It is based on the SAB C513 (Siemens 8 bit microcontroller).A table with load measurements is presented to give an indication for the fraction of CPUperformance required by software for emulating the SSC.
标签: synchronous Emulating serial
上传时间: 2014-01-31
上传用户:z1191176801
The Motorola MPC106 PCI bridge/memory controller provides a PowerPCªmicroprocessor common hardware reference platform (CHRPª) compliant bridgebetween the PowerPC microprocessor family and the Peripheral Component Interconnect(PCI) bus. In this document, the term Ô106Õ is used as an abbreviation for the phraseÔMPC106 PCI bridge/memory controllerÕ. This document contains pertinent physicalcharacteristics of the 106. For functional characteristics refer to theMPC106 PCI Bridge/Memory Controller UserÕs Manual.This document contains the following topics:Topic PageSection 1.1, ÒOverviewÓ 2Section 1.2, ÒFeaturesÓ 3Section 1.3, ÒGeneral ParametersÓ 5Section 1.4, ÒElectrical and Thermal CharacteristicsÓ 5Section 1.5, ÒPin AssignmentsÓ 17Section 1.6, ÒPinout Listings 18Section 1.7, ÒPackage DescriptionÓ 22Section 1.8, ÒSystem Design InformationÓ 24Section 1.9, ÒDocument Revision HistoryÓ 29Section 1.10, ÒOrdering InformationÓ 29
上传时间: 2013-11-04
上传用户:as275944189
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.For input signals, which do not provide the required rise/fall times, external circuitry mustbe used to shape the signal transitions.In the attached diagram, the effect of the sample rate is shown. The numbers 1 to 5 in thediagram represent possible sample points. Waveform a) shows the result if the inputsignal transition time through the undefined TTL-level area is less than the time distancebetween the sample points (sampling at 1, 2, 3, and 4). Waveform b) can be the result ifthe sampling is performed more than once within the undefined area (sampling at 1, 2, 5,3, and 4).Sample points:1. Evaluation of the signal clearly results in a low level2. Either a low or a high level can be sampled here. If low is sampled, no transition willbe detected. If the sample results in a high level, a transition is detected, and anappropriate action (e.g. capture) might take place.3. Evaluation here clearly results in a high level. If the previous sample 2) had alreadydetected a high, there is no change. If the previous sample 2) showed a low, atransition from low to high is detected now.
上传时间: 2013-10-23
上传用户:copu
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
The MC68HC05K0 is a low cost, low pin countsingle chip microcomputer with 504 bytes of userROM and 32 bytes of RAM. The MC68HC05K0 isa member of the 68HC05K series of devices whichare available in 16-pin DIL or SOIC packages.It uses the same CPU as the other devices in the68HC05 family and has the same instructions andregisters. Additionally, the device has a 15-stagemulti-function timer and 10 general purposebi-directional I/0 lines. A mask option is availablefor software programmable pull-downs on all ofthe I/O pins and four of the pins are capable ofgenerating interrupts.The device is ideally suited for remote-controlkeyboard applications because the pull-downs andthe interrupt drivers on the port pins allowkeyboards to be built without any externalcomponents except the keys themselves. There isno need for external pull-up or pull-down resistors,or diodes for wired-OR interrupts, as these featuresare already designed into the device.
上传时间: 2014-01-24
上传用户:zl5712176
P C B 可测性设计布线规则之建议― ― 从源头改善可测率PCB 设计除需考虑功能性与安全性等要求外,亦需考虑可生产与可测试。这里提供可测性设计建议供设计布线工程师参考。1. 每一个铜箔电路支点,至少需要一个可测试点。如无对应的测试点,将可导致与之相关的开短路不可检出,并且与之相连的零件会因无测试点而不可测。2. 双面治具会增加制作成本,且上针板的测试针定位准确度差。所以Layout 时应通过Via Hole 尽可能将测试点放置于同一面。这样就只要做单面治具即可。3. 测试选点优先级:A.测垫(Test Pad) B.通孔(Through Hole) C.零件脚(Component Lead) D.贯穿孔(Via Hole)(未Mask)。而对于零件脚,应以AI 零件脚及其它较细较短脚为优先,较粗或较长的引脚接触性误判多。4. PCB 厚度至少要62mil(1.35mm),厚度少于此值之PCB 容易板弯变形,影响测点精准度,制作治具需特殊处理。5. 避免将测点置于SMT 之PAD 上,因SMT 零件会偏移,故不可靠,且易伤及零件。6. 避免使用过长零件脚(>170mil(4.3mm))或过大的孔(直径>1.5mm)为测点。7. 对于电池(Battery)最好预留Jumper,在ICT 测试时能有效隔离电池的影响。8. 定位孔要求:(a) 定位孔(Tooling Hole)直径最好为125mil(3.175mm)及其以上。(b) 每一片PCB 须有2 个定位孔和一个防呆孔(也可说成定位孔,用以预防将PCB反放而导致机器压破板),且孔内不能沾锡。(c) 选择以对角线,距离最远之2 孔为定位孔。(d) 各定位孔(含防呆孔)不应设计成中心对称,即PCB 旋转180 度角后仍能放入PCB,这样,作业员易于反放而致机器压破板)9. 测试点要求:(e) 两测点或测点与预钻孔之中心距不得小于50mil(1.27mm),否则有一测点无法植针。以大于100mil(2.54mm)为佳,其次是75mil(1.905mm)。(f) 测点应离其附近零件(位于同一面者)至少100mil,如为高于3mm 零件,则应至少间距120mil,方便治具制作。(g) 测点应平均分布于PCB 表面,避免局部密度过高,影响治具测试时测试针压力平衡。(h) 测点直径最好能不小于35mil(0.9mm),如在上针板,则最好不小于40mil(1.00mm),圆形、正方形均可。小于0.030”(30mil)之测点需额外加工,以导正目标。(i) 测点的Pad 及Via 不应有防焊漆(Solder Mask)。(j) 测点应离板边或折边至少100mil。(k) 锡点被实践证实是最好的测试探针接触点。因为锡的氧化物较轻且容易刺穿。以锡点作测试点,因接触不良导致误判的机会极少且可延长探针使用寿命。锡点尤其以PCB 光板制作时的喷锡点最佳。PCB 裸铜测点,高温后已氧化,且其硬度高,所以探针接触电阻变化而致测试误判率很高。如果裸铜测点在SMT 时加上锡膏再经回流焊固化为锡点,虽可大幅改善,但因助焊剂或吃锡不完全的缘故,仍会出现较多的接触误判。
上传时间: 2014-01-14
上传用户:cylnpy
The STWD100 watchdog timer circuits are self-contained devices which prevent systemfailures that are caused by certain types of hardware errors (non-responding peripherals,bus contention, etc.) or software errors (bad code jump, code stuck in loop, etc.).The STWD100 watchdog timer has an input, WDI, and an output, WDO (see Figure 2). Theinput is used to clear the internal watchdog timer periodically within the specified timeoutperiod, twd (see Section 3: Watchdog timing). While the system is operating correctly, itperiodically toggles the watchdog input, WDI. If the system fails, the watchdog timer is notreset, a system alert is generated and the watchdog output, WDO, is asserted (seeSection 3: Watchdog timing).The STWD100 circuit also has an enable pin, EN (see Figure 2), which can enable ordisable the watchdog functionality. The EN pin is connected to the internal pull-downresistor. The device is enabled if the EN pin is left floating.
上传时间: 2013-10-22
上传用户:taiyang250072
微型打印机的C语言源程序:微型打印机的C51源程序#define uchar unsigned char#define uint unsigned int#include <reg52.h>#include <stdio.h>#include <absacc.h>#include <math.h>#include <string.h>#include <ctype.h>#include <stdlib.h>#define PIN XBYTE[0x8000]#define POUT XBYTE[0x9000]sbit PRINTSTB =P1^6;sbit DOG=P1^7;bdata char pin&#118alue;sbit PRINTBUSY=pin&#118alue^7;sbit PRINTSEL =pin&#118alue^6;sbit PRINTERR =pin&#118alue^5;sbit PRINTACK =pin&#118alue^4; void PrintString(uchar *String1,uchar *String2);void initprint(void);void print(uchar a); void initprint(void) //打印机初始化子程序 { pin&#118alue=PIN; if((PRINTSEL==1)&&(PRINTERR==1)) { print(0x1b); print(0x40); print(0x1b); print(0x38); print(0x4); }}void print(uchar a) //打印字符a{ pin&#118alue=PIN; if((PRINTSEL==0)||(PRINTERR==0)) return; for(;;) { DOG=~DOG; pin&#118alue=PIN; if(PRINTBUSY==0) break; } DOG=~DOG; POUT=a; PRINTSTB=1; PRINTSTB=1; PRINTSTB=1; PRINTSTB=1; PRINTSTB=0; PRINTSTB=0; PRINTSTB=0; PRINTSTB=0; PRINTSTB=1;}void PrintString(uchar *String) //打印字符串后回车{ uchar CH; for (;;) { DOG=~DOG; CH=*String; if (CH==0) { print(0x0d); break; } print(CH); String++; } initprint();}
上传时间: 2013-10-18
上传用户:hasan2015