虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

function

function,表示子例程的一般性名词。在某些编程语言中,它指带返回值的子例程或语句。在一些编程语言中起着关键字的作用。
  • MSP430系列单片机C语言程序设计与开发

    MSP430系列单片机C语言程序设计与开发MSP430系列是一个具有明显技术特色的单片机品种。关于它的硬件特性及汇编语言程序设计已在《MSP430系列超低功耗16位单片机的原理与应用》及《MSP430系列 FLASH型超低功耗16位单片机》等书中作了全面介绍。《MSP430系列单片机C语言程序设计与开发》介绍IAR公司为MSP430系列单片机配备的C程序设计语言C430。书中叙述了C语言的基本概念、C430的扩展特性及C库函数;对C430的集成开发环境的使用及出错信息作了详尽的说明;并以MSP430F149为例,对各种应用问题及外围模块操作提供了典型的C程序例程,供读者在今后的C430程序设计中参考。   《MSP430系列单片机C语言程序设计与开发》可以作为高等院校计算机、自动化及电子技术类专业的教学参考书,也可作为工程技术人员设计开发时的技术资料。MSP430系列超低功耗16位单片机的原理与应用目录MSP430系列单片机C语言程序设计与开发 目录  第1章 C语言基本知识1.1 标识符与关键字11.1.1 标识符11.1.2 关键字11.2 数据基本类型21.2.1 整型数据21.2.2 实型数据31.2.3 字符型数据41.2.4 各种数据转换关系61.3 C语言的运算符71.3.1 算术运算符71.3.2 关系运算符和逻辑运算符71.3.3 赋值运算符81.3.4 逗号运算符81.3.5 ? 与 :运算符81.3.6 强制转换运算符91.3.7 各种运算符优先级列表91.4 程序设计的三种基本结构101.4.1 语句的概念101.4.2 顺序结构111.4.3 选择结构121.4.4 循环结构141.5 函数181.5.1 函数定义181.5.2 局部变量与全局变量191.5.3 形式参数与实际参数201.5.4 函数调用方式201.5.5 函数嵌套调用211.5.6 变量的存储类别221.5.7 内部函数和外部函数231.6 数组231.6.1 一维数组241.6.2 多维数组241.6.3 字符数组261.7 指针271.7.1 指针与地址的概念271.7.2 指针变量的定义281.7.3 指针变量的引用281.7.4 数组的指针281.7.5 函数的指针301.7.6 指针数组311.8 结构和联合321.8.1 结构定义321.8.2 结构类型变量的定义331.8.3 结构类型变量的初始化341.8.4 结构类型变量的引用341.8.5 联合341.9 枚举361.9.1 枚举的定义361.9.2 枚举元素的值371.9. 3 枚举变量的使用371.10 类型定义381.10.1 类型定义的形式381.10.2 类型定义的使用381.11 位运算391.11.1 位运算符391.11.2 位域401.12 预处理功能411.12.1 简单宏定义和带参数宏定义411.12.2 文件包含431.12.3 条件编译命令44第2章 C430--MSP430系列的C语言2.1 MSP430系列的C语言452.1.1 C430概述452.1.2 C430程序设计工作流程462.1.3 开始462.1.4 C430程序生成472.2 C430的数据表达482.2.1 数据类型482.2.2 编码效率502.3 C430的配置512.3.1 引言512.3. 2 存储器分配522.3.3 堆栈体积522.3.4 输入输出522.3.5 寄存器的访问542.3.6 堆体积542.3.7 初始化54第3章 C430的开发调试环境3.1 引言563.1.1 Workbench特性563.1.2 Workbench的内嵌编辑器特性563.1.3 C编译器特性573.1. 4 汇编器特性573.1.5 连接器特性583.1.6 库管理器特性583.1.7 C?SPY调试器特性593.2 Workbench概述593.2.1 项目管理模式593.2.2 选项设置603.2.3 建立项目603.2.4 测试代码613.2.5 样本应用程序613.3 Workbench的操作623.3.1 开始633.3.2 编译项目683.3.3 连接项目693.3.4 调试项目713.3.5 使用Make命令733.4 Workbench的功能汇总753.4.1 Workbench的窗口753.4.2 Workbench的菜单功能813.5 Workbench的内嵌编辑器993.5.1 内嵌编辑器操作993.5.2 编辑键说明993.6 C?SPY概述1013.6.1 C?SPY的C语言级和汇编语言级调试1013.6.2 程序的执行1023.7 C?SPY的操作1033.7.1 程序生成1033.7.2 编译与连接1033.7.3 C?SPY运行1033.7.4 C语言级调试1043.7.5 汇编级调试1113.8 C?SPY的功能汇总1133.8.1 C?SPY的窗口1133.8.2 C?SPY的菜单命令功能1203.9 C?SPY的表达式与宏1323.9.1 汇编语言表达式1323.9.2 C语言表达式1333.9.3 C?SPY宏1353.9.4 C?SPY的设置宏1373.9.5 C?SPY的系统宏137 第4章 C430程序设计实例4.1 程序设计与调试环境1434.1.1 程序设计调试集成环境1434.1.2 设备连接1444.1.3 ProF149实验系统1444.2 数值计算1454.2.1 C语言表达式1454.2.2 利用MPY实现运算1464.3 循环结构1474.4 选择结构1484.5 SFR访问1494.6 RAM访问1504.7 FLASH访问1514.8 WDT操作1534.8. 1 WDT使程序自动复位1534.8.2 程序对WATCHDOG计数溢出的控制1544.8.3 WDT的定时器功能1554.9 Timer操作1554.9.1 用Timer产生时钟信号1554.9.2 用Timer检测脉冲宽度1564.10 UART操作1574.10.1 点对点通信1574.10.2 点对多点通信1604.11 SPI操作1634.12 比较器操作1654.13 ADC12操作1674.13.1 单通道单次转换1674.13.2 序列通道多次转换1684.14 时钟模块操作1704.15 中断服务程序1714.16 省电工作模式1754.17 调用汇编语言子程序1764.17.1 程序举例1764.17.2 生成C程序调用的汇编子程序177第5章 C430的扩展特性5.1 C430的语言扩展概述1785.1.1 扩展关键字1785.1.2 #pragma编译命令1785.1.3 预定义符号1795.1.4 本征函数1795.1.5 其他扩展特性1795.2 C430的关键字扩展1795.2.1 interrupt1805.2.2 monitor1805.2.3 no_init1815.2.4 sfrb1815.2.5 sfrw1825.3 C430的 #pragma编译命令1825.3.1 bitfields=default1825.3.2 bitfields=reversed1825.3.3 codeseg1835.3.4 function=default1835.3.5 function=interrupt1845.3.6 function=monitor1845.3.7 language=default1845.3.8 language=extended1845.3.9 memory=constseg1855.3.10 memory=dataseg1855.3.11 memory=default1855.3.12 memory=no_init1865.3.13 warnings=default1865.3.14 warnings=off1865.3.15 warnings=on1865.4 C430的预定义符号1865.4.1 DATE1875.4.2 FILE1875.4.3 IAR_SYSTEMS_ICC1875.4.4 LINE1875.4.5 STDC1875.4.6 TID1875.4.7 TIME1885.4.8 VER1885.5 C430的本征函数1885.5.1 _args$1885.5.2 _argt$1895.5.3 _BIC_SR1895.5.4 _BIS_SR1905.5.5 _DINT1905.5.6 _EINT1905.5.7 _NOP1905.5.8 _OPC1905.6 C430的汇编语言接口1915.6.1 创建汇编子程序框架1915.6.2 调用规则1915.6.3 C程序调用汇编子程序1935.7 C430的段定义1935.7.1 存储器分布与段定义1945.7.2 CCSTR段1945.7.3 CDATA0段1945.7.4 CODE段1955.7.5 CONST1955.7.6 CSTACK1955.7.7 CSTR1955.7.8 ECSTR1955.7.9 IDATA01965.7.10 INTVEC1965.7.11 NO_INIT1965.7.12 UDATA0196第6章 C430的库函数6.1 引言1976.1.1 库模块文件1976.1.2 头文件1976.1.3 库定义汇总1976.2C 库函数参考2046.2.1 C库函数的说明格式2046.2.2 C库函数说明204第7章 C430编译器的诊断消息7.1 编译诊断消息的类型2307.2 编译出错消息2317.3 编译警告消息243附录 AMSP430系列FLASH型芯片资料248附录 BProF149实验系统251附录 CMSP430x14x.H文件253附录 DIAR MSP430 C语言产品介绍275

    标签: MSP 430 C语言 单片机

    上传时间: 2014-05-05

    上传用户:253189838

  • Input Signal Rise and Fall Tim

    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.

    标签: Signal Input Fall Rise

    上传时间: 2013-10-23

    上传用户:copu

  • 介绍C16x系列微控制器的输入信号升降时序图及特性

    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.

    标签: C16x 微控制器 输入信号 时序图

    上传时间: 2014-04-02

    上传用户:han_zh

  • Using the 87LPC76X microcontro

    I2C interface, is a very powerful tool for system designers. Theintegrated protocols allow systems to be completely software defined.Software development time of different products can be reduced byassembling a library of reusable software modules. In addition, themultimaster capability allows rapid testing and alignment ofend-products via external connections to an assembly-line computer.The mask programmable 87LPC76X and its EPROM version, the87LPC76X, can operate as a master or a slave device on the I2Csmall area network. In addition to the efficient interface to thededicated function ICs in the I2C family, the on-board interfacefacilities I/O and RAM expansion, access to EEPROM andprocessor-to-processor communications.

    标签: microcontro Using 76X LPC

    上传时间: 2013-12-30

    上传用户:Artemis

  • 68HC05K0 Infra-red Remote Cont

    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.

    标签: Infra-red Remote Cont 05K

    上传时间: 2014-01-24

    上传用户:zl5712176

  • 驱动程序与应用程序的接口

    有两种方式可以让设备和应用程序之间联系:1. 通过为设备创建的一个符号链;2. 通过输出到一个接口WDM驱动程序建议使用输出到一个接口而不推荐使用创建符号链的方法。这个接口保证PDO的安全,也保证安全地创建一个惟一的、独立于语言的访问设备的方法。一个应用程序使用Win32APIs来调用设备。在某个Win32 APIs和设备对象的分发函数之间存在一个映射关系。获得对设备对象访问的第一步就是打开一个设备对象的句柄。 用符号链打开一个设备的句柄为了打开一个设备,应用程序需要使用CreateFile。如果该设备有一个符号链出口,应用程序可以用下面这个例子的形式打开句柄:hDevice = CreateFile("\\\\.\\OMNIPORT3",  GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ,  NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL ,NULL);文件路径名的前缀“\\.\”告诉系统本调用希望打开一个设备。这个设备必须有一个符号链,以便应用程序能够打开它。有关细节查看有关Kdevice和CreateLink的内容。在上述调用中第一个参数中前缀后的部分就是这个符号链的名字。注意:CreatFile中的第一个参数不是Windows 98/2000中驱动程序(.sys文件)的路径。是到设备对象的符号链。如果使用DriverWizard产生驱动程序,它通常使用类KunitizedName来构成设备的符号链。这意味着符号链名有一个附加的数字,通常是0。例如:如果链接名称的主干是L“TestDevice”那么在CreateFile中的串就该是“\\\\.\\TestDevice0”。如果应用程序需要被覆盖的I/O,第六个参数(Flags)必须或上FILE_FLAG_OVERLAPPED。 使用一个输出接口打开句柄用这种方式打开一个句柄会稍微麻烦一些。DriverWorks库提供两个助手类来使获得对该接口的访问容易一些,这两个类是CDeviceInterface, 和 CdeviceInterfaceClass。CdeviceInterfaceClass类封装了一个设备信息集,该信息集包含了特殊类中的所有设备接口信息。应用程序能有用CdeviceInterfaceClass类的一个实例来获得一个或更多的CdeviceInterface类的实例。CdeviceInterface类是一个单一设备接口的抽象。它的成员函数DevicePath()返回一个路径名的指针,该指针可以在CreateFile中使用来打开设备。下面用一个小例子来显示这些类最基本的使用方法:extern GUID TestGuid;HANDLE OpenByInterface(  GUID* pClassGuid,  DWORD instance,  PDWORD pError){  CDeviceInterfaceClass DevClass(pClassGuid, pError);  if (*pError != ERROR_SUCCESS)    return INVALID_HANDLE_VALUE;  CDeviceInterface DevInterface(&DevClass, instance, pError);  if (*pError != ERROR_SUCCESS)    return INVALID_HANDLE_VALUE;  cout << "The device path is "    << DevInterface.DevicePath()    << endl;   HANDLE hDev;  hDev = CreateFile(   DevInterface.DevicePath(),    GENERIC_READ | GENERIC_WRITE,    FILE_SHARE_READ | FILE_SHARE_WRITE,    NULL,    OPEN_EXISTING,    FILE_ATTRIBUTE_NORMAL,    NULL  );  if (hDev == INVALID_HANDLE_VALUE)    *pError = GetLastError();  return hDev;} 在设备中执行I/O操作一旦应用程序获得一个有效的设备句柄,它就能使用Win32 APIs来产生到设备对象的IRPs。下面的表显示了这种对应关系。Win32 API  DRIVER_function_xxxIRP_MJ_xxx  KDevice subclass member function CreateFile  CREATE  Create ReadFile  READ  Read WriteFile  WRITE  Write DeviceIoControl  DEVICE_CONTROL  DeviceControl CloseHandle  CLOSECLEANUP  CloseCleanUp 需要解释一下设备类成员的Close和CleanUp:CreateFile使内核为设备创建一个新的文件对象。这使得多个句柄可以映射同一个文件对象。当这个文件对象的最后一个用户级句柄被撤销后,I/O管理器调用CleanUp。当没有任何用户级和核心级的对文件对象的访问的时候,I/O管理器调用Close。如果被打开的设备不支持指定的功能,则调用相应的Win32将引起错误(无效功能)。以前为Windows95编写的VxD的应用程序代码中可能会在打开设备的时候使用FILE_FLAG_DELETE_ON_CLOSE属性。在Windows NT/2000中,建议不要使用这个属性,因为它将导致没有特权的用户企图打开这个设备,这是不可能成功的。I/O管理器将ReadFile和WriteFile的buff参数转换成IRP域的方法依赖于设备对象的属性。当设备设置DO_DIRECT_IO标志,I/O管理器将buff锁住在存储器中,并且创建了一个存储在IRP中的MDL域。一个设备可以通过调用Kirp::Mdl来存取MDL。当设备设置DO_BUFFERED_IO标志,设备对象分别通过KIrp::BufferedReadDest或 KIrp::BufferedWriteSource为读或写操作获得buff地址。当设备不设置DO_BUFFERED_IO标志也不设置DO_DIRECT_IO,内核设置IRP 的UserBuffer域来对应ReadFile或WriteFile中的buff参数。然而,存储区并没有被锁住而且地址只对调用进程有效。驱动程序可以使用KIrp::UserBuffer来存取IRP域。对于DeviceIoControl调用,buffer参数的转换依赖于特殊的I/O控制代码,它不在设备对象的特性中。宏CTL_CODE(在winioctl.h中定义)用来构造控制代码。这个宏的其中一个参数指明缓冲方法是METHOD_BUFFERED, METHOD_IN_DIRECT, METHOD_OUT_DIRECT, 或METHOD_NEITHER。下面的表显示了这些方法和与之对应的能获得输入缓冲与输出缓冲的KIrp中的成员函数:Method  Input Buffer Parameter  Output Buffer Parameter METHOD_BUFFERED  KIrp::IoctlBuffer KIrp::IoctlBuffer METHOD_IN_DIRECT  KIrp::IoctlBuffer KIrp::Mdl METHOD_OUT_DIRECT  KIrp::IoctlBuffer KIrp::Mdl METHOD_NEITHER  KIrp::IoctlType3InputBuffer KIrp::UserBuffer 如果控制代码指明METHOD_BUFFERED,系统分配一个单一的缓冲来作为输入与输出。驱动程序必须在向输出缓冲放数据之前拷贝输入数据。驱动程序通过调用KIrp::IoctlBuffer获得缓冲地址。在完成时,I/O管理器从系统缓冲拷贝数据到提供给Ring 3级调用者使用的缓冲中。驱动程序必须在结束前存储拷贝到IRP的Information成员中的数据个数。如果控制代码不指明METHOD_IN_DIRECT或METHOD_OUT_DIRECT,则DeviceIoControl的参数呈现不同的含义。参数InputBuffer被拷贝到一个系统缓冲,这个缓冲驱动程序可以通过调用KIrp::IoctlBuffer。参数OutputBuffer被映射到KMemory对象,驱动程序对这个对象的访问通过调用KIrp::Mdl来实现。对于METHOD_OUT_DIRECT,调用者必须有对缓冲的写访问权限。注意,对METHOD_NEITHER,内核只提供虚拟地址;它不会做映射来配置缓冲。虚拟地址只对调用进程有效。这里是一个用METHOD_BUFFERED的例子:首先,使用宏CTL_CODE来定义一个IOCTL代码:#define IOCTL_MYDEV_GET_FIRMWARE_REV \CTL_CODE (FILE_DEVICE_UNKNOWN,0,METHOD_BUFFERED,FILE_ANY_ACCESS)现在使用一个DeviceIoControl调用:BOOLEAN b;CHAR FirmwareRev[60];ULONG FirmwareRevSize;b = DeviceIoControl(hDevice, IOCTL_MYDEV_GET_VERSION_STRING,  NULL, // no input  注意,这里放的是包含有执行操作命令的字符串指针  0, FirmwareRev,      //这里是output串指针,存放从驱动程序中返回的字符串。sizeof(FirmwareRev),& FirmwareRevSize,  NULL // not overlapped I/O );如果输出缓冲足够大,设备拷贝串到里面并将拷贝的资结束设置到FirmwareRevSize中。在驱动程序中,代码看起来如下所示:const char* FIRMWARE_REV = "FW 16.33 v5";NTSTATUS MyDevice::DeviceControl( KIrp I ){  ULONG fwLength=0;  switch ( I.IoctlCode() )  {    case IOCTL_MYDEV_GET_FIRMWARE_REV:      fwLength = strlen(FIRMWARE_REV)+1;      if (I.IoctlOutputBufferSize() >= fwLength)      {        strcpy((PCHAR)I.IoctlBuffer(),FIRMWARE_REV);        I.Information() = fwLength;         return I.Complete(STATUS_SUCCESS);      }      else      {              }    case . . .   } }

    标签: 驱动程序 应用程序 接口

    上传时间: 2013-10-17

    上传用户:gai928943

  • 基于单片机的汽车多功能报警系统设计

    基于单片机的汽车多功能报警系统设计The Design of Automobile Multi-function AlarmingBased on Single Chip Computer刘法治赵明富宁睡达(河 南 科 技 学 院 ,新 乡 453 00 3)摘要介绍了一种基于单片机控制的汽车多功能报警系统,它能对汽车的润滑系统油压、制动系统气压、冷却系统温度、轮胎欠压及防盗进行自动检测,并在发现异常情况时,发出声光报警。阐述了该报警系统的硬件组成及软件设计方法。关键词单片机传感器数模转换报警Abstract Am ulti-fimctiona utomobilea larnungs ystemb asedo ns inglec hipc omputerco ntorlis in torducedin th isp aper.Th eo ilpr essuero flu bricatesystem, air pressure of braking system, temperature of cooling system, under pressure of tyre and guard against theft, detected automaticaly场thesystem. Audio and visual alarms wil be provided under abnormal conditions厂The hardware composition and software design of the system, described.Keywords Singlec hipc omputer Sensor Digital-t-oanaloguec onversion Alarmin 汽车多功能报苦器硬件系统设计根据 系 统 实际需要和产品性价比,选用ATMEL公司新生产的采用CMOs工艺的低功耗、高性能8位单片机AT89S52作为系统的控制器。AT89S52的片内有8k Bytes LSP Flash闪烁存储器,可进行100(〕次写、擦除操作;256Bytes内部数据存储器(RAM);3 2 根可编程输N输出线;2个可编程全双工串行通道;看门狗(WTD)电路等。系统由传感器、单片机、模数转换器、无线信号发射电路、指示灯驱动电路、声光报警驱动电KD一9563,发出三声二闪光。并触发一个高电平,驱动无线信号发射电路。

    标签: 单片机 汽车 多功能 报警

    上传时间: 2013-11-09

    上传用户:gxmm

  • 基于DSP Builder数字信号处理器的FPGA设计

    针对使用硬件描述语言进行设计存在的问题,提出一种基于FPGA并采用DSP Builder作为设计工具的数字信号处理器设计方法。并按照Matlab/Simulink/DSP Builder/QuartusⅡ设计流程,设计了一个12阶FIR 低通数字滤波器,通过Quartus 时序仿真及嵌入式逻辑分析仪SignalTapⅡ硬件测试对设计进行了验证。结果表明,所设计的FIR 滤波器功能正确,性能良好。 Abstract:  Aiming at the problems in designing DSP using HDL,a method of designing DSP based on FPGA which using DSP Builder as designed tool is pointed out.A 12-order low-pass FIR digital filter was designed according to the process of Matlab/Simulink/DSP Builder/QuartusⅡ, and the design was verified by the timing simulation based on QuartusⅡand practical test based on SignalTapⅡ. The result shows the designed filter is correct in function and good in performance.

    标签: Builder FPGA DSP 数字信号处理器

    上传时间: 2013-11-17

    上传用户:lo25643

  • Verilog_HDL的基本语法详解(夏宇闻版)

            Verilog_HDL的基本语法详解(夏宇闻版):Verilog HDL是一种用于数字逻辑电路设计的语言。用Verilog HDL描述的电路设计就是该电路的Verilog HDL模型。Verilog HDL既是一种行为描述的语言也是一种结构描述的语言。这也就是说,既可以用电路的功能描述也可以用元器件和它们之间的连接来建立所设计电路的Verilog HDL模型。Verilog模型可以是实际电路的不同级别的抽象。这些抽象的级别和它们对应的模型类型共有以下五种:   系统级(system):用高级语言结构实现设计模块的外部性能的模型。   算法级(algorithm):用高级语言结构实现设计算法的模型。   RTL级(Register Transfer Level):描述数据在寄存器之间流动和如何处理这些数据的模型。   门级(gate-level):描述逻辑门以及逻辑门之间的连接的模型。   开关级(switch-level):描述器件中三极管和储存节点以及它们之间连接的模型。   一个复杂电路系统的完整Verilog HDL模型是由若干个Verilog HDL模块构成的,每一个模块又可以由若干个子模块构成。其中有些模块需要综合成具体电路,而有些模块只是与用户所设计的模块交互的现存电路或激励信号源。利用Verilog HDL语言结构所提供的这种功能就可以构造一个模块间的清晰层次结构来描述极其复杂的大型设计,并对所作设计的逻辑电路进行严格的验证。   Verilog HDL行为描述语言作为一种结构化和过程性的语言,其语法结构非常适合于算法级和RTL级的模型设计。这种行为描述语言具有以下功能:   · 可描述顺序执行或并行执行的程序结构。   · 用延迟表达式或事件表达式来明确地控制过程的启动时间。   · 通过命名的事件来触发其它过程里的激活行为或停止行为。   · 提供了条件、if-else、case、循环程序结构。   · 提供了可带参数且非零延续时间的任务(task)程序结构。   · 提供了可定义新的操作符的函数结构(function)。   · 提供了用于建立表达式的算术运算符、逻辑运算符、位运算符。   · Verilog HDL语言作为一种结构化的语言也非常适合于门级和开关级的模型设计。因其结构化的特点又使它具有以下功能:   - 提供了完整的一套组合型原语(primitive);   - 提供了双向通路和电阻器件的原语;   - 可建立MOS器件的电荷分享和电荷衰减动态模型。   Verilog HDL的构造性语句可以精确地建立信号的模型。这是因为在Verilog HDL中,提供了延迟和输出强度的原语来建立精确程度很高的信号模型。信号值可以有不同的的强度,可以通过设定宽范围的模糊值来降低不确定条件的影响。   Verilog HDL作为一种高级的硬件描述编程语言,有着类似C语言的风格。其中有许多语句如:if语句、case语句等和C语言中的对应语句十分相似。如果读者已经掌握C语言编程的基础,那么学习Verilog HDL并不困难,我们只要对Verilog HDL某些语句的特殊方面着重理解,并加强上机练习就能很好地掌握它,利用它的强大功能来设计复杂的数字逻辑电路。下面我们将对Verilog HDL中的基本语法逐一加以介绍。

    标签: Verilog_HDL

    上传时间: 2013-11-23

    上传用户:青春给了作业95

  • Analog Solutions for Altera FPGAs

    Designing withProgrammable Logicin an Analog WorldProgrammable logic devices revolutionizeddigital design over 25 years ago,promising designers a blank chip todesign literally any function and programit in the field. PLDs can be low-logicdensity devices that use nonvolatilesea-of-gates cells called complexprogrammable logic devices (CPLDs)or they can be high-density devicesbased on SRAM look-up tables (LUTs)

    标签: Solutions Analog Altera FPGAs

    上传时间: 2013-11-08

    上传用户:虫虫虫虫虫虫