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

Programming-A

  • 用PIC16C73 单片机实现十二位A/D转换器

    介绍用PIC16C73 自带的八位A/D 转换器扩展为十二位A/D 转换器,给出了具体的设计方案和程序流程。它是用以 PIC16C73 为MCU 构成的海水有机磷测控仪A/D 转换部分的一种解决方案。为监测海洋生态环境,研制了用于海水有机磷农药现场监测的生物传感器。为测定生物传感器的信号,使传感器可用于船载及台站的海洋生态环境现场自动监测,需要对整个的采样和排液装置进行控制以及对传感器来的信号进行实时采集处理,形成有机磷的浓度传给上位机。为此,开发了以PIC16C73 单片机为核心的小型测控仪器,很好的完成了上述功能。PIC1673 单片机自带8 位的A/D 转换器,但不能满足系统对精度的要求,本设计在单片机自带8 位A/D 基础上加少量的硬件和软件开销,使其扩展为十二位A/D 转换器,满足了系统的要求。

    标签: PIC 16C C73 16

    上传时间: 2013-10-30

    上传用户:a296386173

  • 新颖实用的单片机双积分A/D转换电路和软件

    新颖实用的单片机双积分A/D转换电路和软件:摘 要: 通过对双积分A/ D 转换过程及其原理的分析,结合8031 单片机定时计数器的特点,设计出一种新的A/ D 转换电路. 详细介绍了这种转换电路的硬件原理及工作过程,给出了实用的硬件电路与软件设计框图. 通过比较分析,可以看出这种A/ D 转换电路性能价格比较高,软件编程简单,并且转换速度和精度优于一般的A/ D 转换电路. 这种设计思路为数模转换器(A/ D) 的升级提高指出一个明确的方向.关键词:单片机; 定时/ 计数器; A/ D 转换; 双积分  双积分A/ D 及定时计数器原理:我们先分析双积分A/ D 转换的工作原理. 如图1 所示,积分器先以固定时间T 对待测的输入模拟电压Vi 进行正向积分,积分电容C 积累的电荷为

    标签: 单片机 双积分 转换电路 软件

    上传时间: 2014-01-18

    上传用户:hewenzhi

  • USB Demonstration for DK3200 w

    The μPSD32xx family, from ST, consists of Flash programmable system devices with a 8032 MicrocontrollerCore. Of these, the μPSD3234A and μPSD3254A are notable for having a complete implementationof the USB hardware directly on the chip, complying with the Universal Serial Bus Specification, Revision1.1.This application note describes a demonstration program that has been written for the DK3200 hardwaredemonstration kit (incorporating a μPSD3234A device). It gives the user an idea of how simple it is to workwith the device, using the HID class as a ready-made device driver for the USB connection.IN-APPLICATION-PROGRAMMING (IAP) AND IN-SYSTEM-PROGRAMMING (ISP)Since the μPSD contains two independent Flash memory arrays, the Micro Controller Unit (MCU) can executecode from one memory while erasing and programming the other. Product firmware updates in thefield can be reliably performed over any communication channel (such as CAN, Ethernet, UART, J1850)using this unique architecture. For In-Application-Programming (IAP), all code is updated through theMCU. The main advantage for the user is that the firmware can be updated remotely. The target applicationruns and takes care on its own program code and data memory.IAP is not the only method to program the firmware in μPSD devices. They can also be programmed usingIn-System-Programming (ISP). A IEEE1149.1-compliant JTAG interface is included on the μPSD. Withthis, the entire device can be rapidly programmed while soldered to the circuit board (Main Flash memory,Secondary Boot Flash memory, the PLD, and all configuration areas). This requires no MCU participation.The MCU is completely bypassed. So, the μPSD can be programmed or reprogrammed any time, anywhere, even when completely uncommitted.Both methods take place with the device in its normal hardware environment, soldered to a printed circuitboard. The IAP method cannot be used without previous use of ISP, because IAP utilizes a small amountof resident code to receive the service commands, and to perform the desired operations.

    标签: Demonstration 3200 USB for

    上传时间: 2014-02-27

    上传用户:zhangzhenyu

  • I2C slave routines for the 87L

    The 87LPC76X Microcontroller combines in a small package thebenefits of a high-performance microcontroller with on-boardhardware supporting the Inter-Integrated Circuit (I2C) bus interface.The 87LPC76X can be programmed both as an I2C bus master, aslave, or both. An overview of the I2C bus and description of the bussupport hardware in the 87LPC76X microcontrollers appears inapplication note AN464, Using the 87LPC76X Microcontroller as anI2C Bus Master. That application note includes a programmingexample, demonstrating a bus-master code. Here we show anexample of programming the microcontroller as an I2C slave.The code listing demonstrates communications routines for the87LPC76X as a slave on the I2C bus. It compliments the program inAN464 which demonstrates the 87LPC76X as an I2C bus master.One may demonstrate two 87LPC76X devices communicating witheach other on the I2C bus, using the AN464 code in one, and theprogram presented here in the other. The examples presented hereand in AN464 allow the 87LPC76X to be either a master or a slave,but not both. Switching between master and slave roles in amultimaster environment is described in application note AN435.The software for a slave on the bus is relatively simple, as theprocessor plays a relatively passive role. It does not initiate bustransfers on its own, but responds to a master initiating thecommunications. This is true whether the slave receives or transmitsdata—transmission takes place only as a response to a busmaster’s request. The slave does not have to worry about arbitrationor about devices which do not acknowledge their address. As theslave is not supposed to take control of the bus, we do not demandit to resolve bus exceptions or “hangups”. If the bus becomesinactive the processor simply withdraws, not interfering with themaster (or masters) on the bus which should (hopefully) try toresolve the situation.

    标签: routines slave I2C 87L

    上传时间: 2013-11-19

    上传用户:shirleyYim

  • 87C576微控制器的在线编程

    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.

    标签: 87C576 微控制器 编程

    上传时间: 2013-10-21

    上传用户:xiaozhiqban

  • 单片机A/D和D/A应用接口技术

    18-2.  D/A转换器基本知识18-3. 光导智能小车硬件实现18-4. ADC0832基本应用方法18-5. 光导智能小车软件实现A/D转换器的主要技术指标分辨率  使输出数字量变化一个相邻数码所需输入模拟电压的变化量。常        用二进制的位数表示。        例如:12位ADC的分辨率就是12位,一个10V满刻度的12位ADC能分辨        输入电压变化最小是:                       10V×1/212=2.4mV量化误差 ADC把模拟量变为数字量,用数字量近似表示模拟量,这个过程称为量化。量化误差是ADC的有限位数对模拟量进行量化而引起的误差。A/D转换器的主要技术指标偏移误差      指输入信号为零时,输出信号不为零的值,所以有时又称为零值误差。满刻度误差 满刻度误差又称为增益误差。指满刻度输出数码所对应的实际输入电压与理想输入电压之差。线性度 线性度有时又称为非线性度,指转换器实际的转换特性与理想直线的最大偏差。A/D转换器的主要技术指标绝对精度 在一个转换器中,任何数码所对应的实际模拟量输入与理论模拟输入之差的最大值,称为绝对精度。对于ADC而言,可以在每一个阶梯的水平中点进行测量,它包括了所有的误差。转换速率 指ADC能够重复进行数据转换的速度,即每秒转换的次数。而完成一次A/D转换所需的时间(包括稳定时间),则是转换速率的倒数。

    标签: 单片机 应用接口

    上传时间: 2013-11-25

    上传用户:banlangen

  • 用单片机内置比较器设计高精度A/D变换器

    Σ-ΔA/D技术具有高分辨率、高线性度和低成本的特点。本文基于TI公司的MSP430F1121单片机,介绍了采用内置比较器和外围电路构成类似于Σ-△的高精度A/D实现方案,适合用于对温度、压力和电压等缓慢变化信号的采集应用。 在各种A/D转换器中,最常用是逐次逼近法(SAR)A/D,该类器件具有转换时间固定且快速的特点,但难以显著提高分辨率;积分型A/D 有较强的抗干扰能力,但转换时间较长;过采样Σ-ΔA/D由于其高分辨率,高线性度及低成本的特点,正得到越来越多的应用。根据这些特点,本文以TI公司的MSP430F1121单片机实现了一种类似于Σ-ΔA/D技术的高精度转换器方案。 MSP430F1121是16位RISC结构的FLASH型单片机,该芯片有14个双向I/O口并兼有中断功能,一个16位定时器兼有计数和定时功能。I/O口输出高电平时电压接近Vcc,低电平时接近Vss,因此,一个I/O口可以看作一位DAC,具有PWM功能。 该芯片具有一个内置模拟电压比较器,只须外接一只电阻和电容即可构成一个类似于Σ-Δ技术的高精度单斜率A/D。一般而言,比较器在使用过程中会受到两种因素的影响,一种是比较器输入端的偏置电压的积累;另一种是两个输入端电压接近到一程度时,输出端会产生振荡。 MSP430F1121单片机在比较器两输入端对应的单片机端口与片外输入信号的连接线路保持不变的情况下,可通过软件将比较器两输入端与对应的单片机端口的连接线路交换,并同时将比较器的输出极性变换,这样抵消了比较器的输入端累积的偏置电压。通过在内部将输出连接到低通滤波器后,即使在比较器输入端两比较电压非常接近,经过滤波后也不会出现输出端的振荡现象,从而消除了输出端震荡的问题。利用内置比较器实现高精度A/D图1是一个可直接使用的A/D转换方案,该方案是一个高精度的积分型A/D转换器。其基本原理是用单一的I/O端口,执行1位的数模转换,以比较器的输出作反馈,来维持Vout与Vin相等。图1:利用MSP430F1121实现的实用A/D转换器电路方案。

    标签: 用单片机 内置 比较器 变换器

    上传时间: 2013-11-10

    上传用户:lliuhhui

  • MATLAB与PSpice数据接口技术

    摘 要 瞬态仿真领域的许多工作需要获得可视化数据, 仿真电路不能将输出参数绘制成图形时研究工作将受到很大影响. 而权威电路仿真软件PSpice 在这个方面不尽如人意. 本文提出了一种有效的解决办法: 通过MATLAB 编程搭建一个PSpice 与MATLAB 的数据接口,使PSpice输出数据文件可以导入到MATLAB中绘制图形. 这令我们能够很方便地获得数据的规律以有效地分析仿真结果, 这项技术对于教学和工程实践都有比较实际的帮助.关键词: 瞬态仿真 仿真程序 PSpice MATLAB 可视化数据The Data Transfer from Pspice to MATLABWu hao Ning yuanzhong Liang yingAbstract Many works in the area of transient simulation has shown how a emulator such asPSpice can be interfaced to an control analysis package such as MATLAB to get viewdata. Thepaper describes how such interfaces can be made using the MATLAB programming. The platformas a typical platform will solve the problem that PSpice software sometimes can not draw the datato a picture. It can make us find the rule from numerous data very expediently, so we can analyzethe outcome of the simulation. And it also can be used in the field of education.Keywords Transient Simulation Emulator PSpice MATLAB Viewdata1 引言科学研究和工程应用常需要进行电路仿真 PSpice可进行直流 交流 瞬态等基本电路特性分析 也可进行蒙托卡诺 MC 统计分析 最坏情况 Wcase 分析 优化设计等复杂电路特性分析 它是国际上仿真电路的权威软件 而MATLAB的主要特点有 高效方便的矩阵和数组运算 编程效率高 结构化面向对象 方便的绘图功能 用户使用方便 工具箱功能强大 两者各有着重点 两种软件结合应用 对研究工作有很重要的意义香港理工大学Y. S. LEE 等人首先将PSpice和MATLAB结合 开发了电力电子电路优化用的CAD 程序MATSPICE[6] 将两者相结合的关键在于 如何用MATLAB 获取PSpice的仿真数据 对此参考文献 6 里没有详细叙述 本文着重说明用MATLAB 读取PSpice仿真数据的具体方法本论文利用MATLAB对PSpice仿真出的数据处理绘制出后者无法得到或是效果不好的仿真图形 下面就两者结合使用的例子 进行具体说明

    标签: MATLAB PSpice 数据 接口技术

    上传时间: 2013-10-20

    上传用户:wuchunzhong

  • Create a 1-Wire Master with Xilinx PicoBlaze

    Abstract: Designers who must interface 1-Wire temperature sensors with Xilinx field-programmable gate arrays(FPGAs) can use this reference design to drive a DS28EA00 1-Wire slave device. The downloadable softwarementioned in this document can also be used as a starting point to connect other 1-Wire slave devices. The systemimplements a 1-Wire master connected to a UART and outputs temperature to a PC from the DS28EA00 temperaturesensor. In addition, high/low alarm outputs are displayed from the DS28EA00 PIO pins using LEDs.

    标签: PicoBlaze Create Master Xilinx

    上传时间: 2013-11-05

    上传用户:a6697238

  • AstroII-EVB-F1K(A)-L144开发板用户指南

        AstroII-EVB-F1K(A)-L144开发板用户指南

    标签: AstroII-EVB-F 144 开发板 用户

    上传时间: 2013-11-22

    上传用户:zhichenglu