The XA-S3 is a member of Philips Semiconductors’ XA (eXtended Architecture) family of high performance 16-bit single-chip Microcontrollers. The XA-S3 combines many powerful peripherals on one chip. Therefore, it is suited for general multipurpose high performance embedded control functions.One of the on-chip peripherals is the I2C bus interface. This report describes worked-out driver software (written in C) to program / use the I2C interface of the XA-S3. The driver software, together with a demo program and interface software routines offer the user a quick start in writing a complete I2C - XAS3 system application.
上传时间: 2013-11-10
上传用户:liaofamous
Abstract: This application note explains the hardware of different types of 1-Wire® interfaces and software examples adapted to this hardware with a focus on serial ports. Depending on the types of iButtons required for a project and the type of computer to be used, the most economical interface is easily found. The hardware examples shown are basically two different types: 5V general interface and 12V RS-232 interface. Within the 5V group a common printed circuit board could be used for all circuits described. The variations can be achieved by different populations of components. The same principal is used for the 12V RS-232 interface. The population determines if it is a Read all or a Read/Write all type of interface. There are other possible circuit implementations to create a 1-Wire interface. The circuits described in this application note cover many different configurations. For a custom application, one of the described options can be adapted to meet individual needs.
标签: iButtons Reading Writing and
上传时间: 2013-10-29
上传用户:long14578
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.
上传时间: 2013-11-19
上传用户:shirleyYim
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
CAN与RS232转换节点的设计与实现 介绍将CAN总线接口与RS232总线接口相互转换的设计方法和2种总线电平转换关系,实现CAN总线与各模块的接口设计,制定了相应的软硬件设计方案,并给出软件设计流程图以及部分硬件设计原理图。为CAN总线与RS232总线互联提供了一种方法,对CAN总线与RS232总线接口设备的互联和广泛应用的实现具有重要意义。关键词:CAN总线;RS-232总线;串行通信Design and Realization of CAN and RS232 Transformation NodeZHOU Wei, CHENG Xiao-hong(Information Institute, Wuhan University of Technology, Wuhan 430070)【Abstract】This paper introduces one design method of the CAN bus interface and the RS232 bus interface interconversion, emphasizes two kindof bus level transformation relations, realizes the CAN bus and various modules connection design, formulates the design proposal of correspondingsoftware and hardware, and gives the flow chart of software design as well as the partial schematic diagram of hardware design. It providesonemethod for the CAN bus and the RS232 bus interconnection, has the vital significance to widespread application realization of the CAN busand theRS232 bus interface equipment interconnection.【Key words】CAN bus; RS-232 bus; serial communication
上传时间: 2013-11-04
上传用户:leesuper
当拿到一张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
C51单片机视频教程:uv2.1视频使用教程 所属专题:单片机视频教程
上传时间: 2013-10-27
上传用户:bqc1245824354
//芯片资料请到www.elecfans.com查找 //DS1820 C51 子程序//这里以11.0592M晶体为例,不同的晶体速度可能需要调整延时的时间//sbit DQ =P2^1;//根据实际情况定义端口 typedef unsigned char byte;typedef unsigned int word; //延时void delay(word useconds){ for(;useconds>0;useconds--);} //复位byte ow_reset(void){ byte presence; DQ = 0; //pull DQ line low delay(29); // leave it low for 480us DQ = 1; // allow line to return high delay(3); // wait for presence presence = DQ; // get presence signal delay(25); // wait for end of timeslot return(presence); // presence signal returned} // 0=presence, 1 = no part //从 1-wire 总线上读取一个字节byte read_byte(void){ byte i; byte value = 0; for (i=8;i>0;i--) { value>>=1; DQ = 0; // pull DQ low to start timeslot DQ = 1; // then return high delay(1); //for (i=0; i<3; i++); if(DQ)value|=0x80; delay(6); // wait for rest of timeslot } return(value);} //向 1-WIRE 总线上写一个字节void write_byte(char val){ byte i; for (i=8; i>0; i--) // writes byte, one bit at a time { DQ = 0; // pull DQ low to start timeslot DQ = val&0x01; delay(5); // hold value for remainder of timeslot DQ = 1; val=val/2; } delay(5);} //读取温度char Read_Temperature(void){ union{ byte c[2]; int x; }temp; ow_reset(); write_byte(0xCC); // Skip ROM write_byte(0xBE); // Read Scratch Pad temp.c[1]=read_byte(); temp.c[0]=read_byte(); ow_reset(); write_byte(0xCC); //Skip ROM write_byte(0x44); // Start Conversion return temp.x/2;}
上传时间: 2013-11-03
上传用户:hongmo
单片机模糊模糊控制是目前在控制领域所采用的三种智能控制方法中最具实际意义的方法。模糊控制的采用解决了大量过去人们无法解决的问题,并且在工业控制、家用电器和各个领域已取得了令人触目的成效。本书是一本系统地介绍模糊控制的理论、技术、方法和应用的著作;内容包括模糊控制基础、模糊控制器、模糊控制系统、模糊控制系统的稳定性、模糊控制系统的开发软件,用单片微型机实现模糊控制的技术和方法,模糊控制在家用电器和工业上应用的实际例子;反映了模糊控制目前的水平。 单片机模糊模糊控制目录 : 第一章 模糊逻辑、神经网络集成电路的发展 1.1 模糊逻辑及其集成电路的发展1.1.1 模糊逻辑的诞生和发展1.1.2 模糊集成电路的发展进程1.2 神经网络及其集成电路的发展1.2.1 神经网络的形成历史1.2.2 神经网络集成电路的发展1.3 模糊逻辑和神经网络的结合1.3.1 模糊逻辑和神经网络结合的意义1.3.2 模糊逻辑和神经网络结合的前景第二章 模糊逻辑及其理论基础 2.1 模糊集合与隶属函数2.1.1 模糊集合概念2.1.2 隶属函数2.1.3 分解定理与扩张定理2.1.4 模糊数2.2 模糊关系、模糊矩阵与模糊变换2.2.1 模糊关系2.2.2 模糊矩阵2.2.3 模糊变换2.3模糊逻辑和函数2.3.1模糊命题2.3.2模糊逻辑2.3.3模糊逻辑函数2.4模糊语言2.4.1 语言及语言的模糊性2.4.2 模糊语言2.4.3 语法规则和算子2.4.4 模糊条件语句2.5 模糊推理2.5.1 模糊推理的CRI法2.5.2 模糊推理的TVR法2.5.3 模糊推理的直接法2.5.4 模糊推理的精确值法2.5.5 模糊推理的强度转移法第三章 模糊控制基础 3.1 模糊控制的系统结构3.2 精确量的模糊化3.2.1 语言变量的分档3.2.2 语言变量值的表示方法3.2.3 精确量转换成模糊量3.3 模糊量的精确化3.3.1 最大隶属度法3.3.2 中位数法3.3.3 重心法3.4 模糊控制规则及控制算法3.4.1 模糊控制规则的格式3.4.2 模糊控制规则的生成3.4.3 模糊控制规则的优化3.4.4 模糊控制算法3.5 模糊控制的神经网络方法3.5.1 神经元和神经网络3.5.2 神经网络的分布存储和容错性3.5.3 神经网络的学习算法3.5.4 神经网络实现的模糊控制3.5.5 神经网络构造隶属函数3.5.6 神经网络存储控制规则3.5.7 神经网络实现模糊化、反模糊化第四章 模糊控制器 4.1 模糊控制器结构4.2 模糊控制器设计4.2.1 常规模糊控制器设计4.2.2 变结构模糊控制器设计4.2.3 自组织模糊控制器设计4.2.4 自适应模糊控制器设计4.3 模糊控制器的数学模型4.3.1 常规模糊控制器的数学模型4.3.2 模糊控制器数学模型的建立第五章 模糊控制系统 5.1 模糊系统的辨识和建模5.1.1 模糊系统辨识的数学基础5.1.2 基于模糊关系方程的模糊模型辨识5.1.3 基于语言控制规则的模糊模型辨识5.2 模糊控制系统的设计5.2.1 模糊控制系统的一般设计过程5.2.2 模糊控制系统的典型设计5.3 模糊控制系统的稳定性5.3.1 稳定性分析的Lyapunov直接法5.3.2 语言规则描述的模糊控制系统的稳定性5.3.3 关系方程描述的模糊控制系统的稳定性第六章 数字单片机与模糊控制6.1 数字单片机MC68HC705P96.1.1 MC68HC705P9单片机性能概论6.1.2 MC68HC705P9单片机基本结构6.1.3 MC68HC705P9指令系统6.2 数字单片机模糊控制方式6.2.1 数字单片机与模糊控制关系6.2.2 数字单片机模糊控制方式第七章 模糊单片机与模糊控制7.1 模糊单片机NLX2307.1.1 模糊单片机NLX230性能概况7.1.2 NLX230的结构及引脚7.1.3 NLX230的模糊推理方式7.1.4 NLX230的内部寄存器7.1.5 NLX230的操作及接口技术7.2 NLX230开发系统7.3 NLX230应用例子第八章 模糊控制的开发软件8.1 模糊推理机原理8.2 模糊推理机的算法8.3 模糊推理机结构和清单8.4 模糊逻辑知识基发生器8.5 模糊推理开发环境8.5.1 FIDE的工作条件8.5.2 FIDE的结构8.5.3 FIDE的工作过程第九章 模糊控制在家用电器中的应用9.1 模糊控制的电冰箱9.1.1 电冰箱模糊控制系统结构9.1.2 模糊控制规则和模糊量9.1.3 控制系统的电路结构9.1.4 控制规则的自调整9.2 模糊控制的电饭锅9.2.1 煮饭的工艺过程曲线9.2.2 模糊控制的逻辑结构9.2.3 模糊量和模糊推理9.2.4 控制软件框图9.3 模糊控制的微波炉9.3.1 控制电路的结构框图9.3.2 微波炉的模糊量与推理9.3.3 微波炉控制电路结构原理9.3.4 控制软件原理及框图9.4 模糊控制的洗衣机9.4.1 模糊洗衣机控制系统逻辑结构9.4.2 模糊洗衣机的模糊推理9.4.3 洗衣机物理量检测方法9.4.4 布质和布量的模糊推理第十章 模糊控制在工程上的应用10.1 模糊参数自适应PID控制器10.1.1 自校正PID控制器10.1.2 模糊参数自适应PID控制系统结构10.1.3 模糊控制规则的产生10.1.4 模糊推理机理及运行结果10.2 恒温炉模糊控制10.2.1 恒温炉模糊控制的系统结构10.2.2 模糊控制器及控制规则的形成10.2.3 模糊控制器的校正10.3 感应电机模糊矢量控制10.3.1 模糊矢量控制系统结构10.3.2 矢量控制的基本原理10.3.3 模糊电阻观测器10.3.4 模糊控制器及运行
上传时间: 2014-12-28
上传用户:semi1981
提出了一种改进的LSM-ALSM子空间模式识别方法,将LSM的旋转策略引入ALSM,使子空间之间互不关联的情况得到改善,提高了ALSM对相似样本的区分能力。讨论中以性能函数代替经验函数来确定拒识规则的参数,实现了识别率、误识率与拒识率之间的最佳平衡;通过对有限字符集的实验结果表明,LSM-ALSM算法有效地改善了分类器的识别率和可靠性。关 键 词 学习子空间; 性能函数; 散布矩阵; 最小描述长度在子空间模式识别方法中,一个线性子空间代表一个模式类别,该子空间由反映类别本质的一组特征矢量张成,分类器根据输入样本在各子空间上的投影长度将其归为相应的类别。典型的子空间算法有以下三种[1, 2]:CLAFIC(Class-feature Information Compression)算法以相关矩阵的部分特征向量来构造子空间,实现了特征信息的压缩,但对样本的利用为一次性,不能根据分类结果进行调整和学习,对样本信息的利用不充分;学习子空间方法(Leaning Subspace Method, LSM)通过旋转子空间来拉大样本所属类别与最近邻类别的距离,以此提高分类能力,但对样本的训练顺序敏感,同一样本训练的顺序不同对子空间构造的影响就不同;平均学习子空间算法(Averaged Learning Subspace Method, ALSM)是在迭代训练过程中,用错误分类的样本去调整散布矩阵,训练结果与样本输入顺序无关,所有样本平均参与训练,其不足之处是各模式的子空间之间相互独立。针对以上问题,本文提出一种改进的子空间模式识别方法。子空间模式识别的基本原理1.1 子空间的分类规则子空间模式识别方法的每一类别由一个子空间表示,子空间分类器的基本分类规则是按矢量在各子空间上的投影长度大小,将样本归类到最大长度所对应的类别,在类x()iω的子空间上投影长度的平方为()211,2,,()argmax()jMTkkjpg===Σx (1)式中 函数称为分类函数;为子空间基矢量。两类的分类情况如图1所示。
上传时间: 2013-12-25
上传用户:熊少锋