This application note shows how to write an Inter Integrated Circuit bus driver (I²C) for the Philips P90CL301micro-controller.It is not only an example of writing a driver, but it also includes a set of application interface software routines toquickly implement a complete I²C multi-master system application.For specific applications the user will have to make minimal changes in the driver program. Using the drivermeans linking modules to your application software and including a header-file into the application sourceprograms. A small example program of how to use the driver is listed.The driver supports i.a. polled or interrupt driven message handling, slave message transfers and multi-mastersystem applications. Furthermore, it is made suitable for use in conjunction with real time operating systems, likepSOS+.
上传时间: 2013-11-23
上传用户:weixiao99
The P90CL301 is a highly integrated 16/32 bit micro-controller especially suitable for applications requiring lowvoltage and low power consumption. It is fully software compatible with the 68000. Furthermore, it provides bothstandard as well as advanced peripheral functions on-chip.One of these peripheral functions is the I2C bus. This report describes worked-out driver software (written in C) toprogram the P90CL301 I2C interface. It also contains interface software routines offering the user a quick start inwriting a complete I2C system application.
上传时间: 2014-01-06
上传用户:气温达上千万的
This application note demonstrates how to write an Inter Integrated Circuit bus driver (I2C) for the XA-S3 16-bitMicrocontroller from Philips Semiconductors.Not only the driver software is given. This note also contains a set of (example) interface routines and a smalldemo application program. All together it offers the user a quick start in writing a complete I2C system applicationwith the PXAS3x.The driver routines support interrupt driven single master transfers. Furthermore, the routines are suitable foruse in conjunction with real time operating systems.
上传时间: 2013-11-02
上传用户:zw380105939
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
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
Presents short and simple I2C software routines that support onlyslave (rather than master or master & slave) operation and an ASMdemonstration program. The slave-only software in this app notecomplements the master mode software presented in AN464, Usingthe 87LPC76X microcontroller as an I2C bus master.
上传时间: 2013-11-22
上传用户:1039312764
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
//芯片资料请到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
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
计算机部件要具有通用性,适应不同系统与不同用户的需求,设计必须模块化。计算机部件产品(模块)供应出现多元化。模块之间的联接关系要标准化,使模块具有通用性。模块设计必须基于一种大多数厂商认可的模块联接关系,即一种总线标准。总线的标准总线是一类信号线的集合是模块间传输信息的公共通道,通过它,计算机各部件间可进行各种数据和命令的传送。为使不同供应商的产品间能够互换,给用户更多的选择,总线的技术规范要标准化。总线的标准制定要经周密考虑,要有严格的规定。总线标准(技术规范)包括以下几部分:机械结构规范:模块尺寸、总线插头、总线接插件以及按装尺寸均有统一规定。功能规范:总线每条信号线(引脚的名称)、功能以及工作过程要有统一规定。电气规范:总线每条信号线的有效电平、动态转换时间、负载能力等。总线的发展情况S-100总线:产生于1975年,第一个标准化总线,为微计算机技术发展起到了推动作用。IBM-PC个人计算机采用总线结构(Industry Standard Architecture, ISA)并成为工业化的标准。先后出现8位ISA总线、16位ISA总线以及后来兼容厂商推出的EISA(Extended ISA)32位ISA总线。为了适应微处理器性能的提高及I/O模块更高吞吐率的要求,出现了VL-Bus(VESA Local Bus)和PCI(Peripheral Component Interconnect,PCI)总线。适合小型化要求的PCMCIA(Personal Computer Memory Card International Association)总线,用于笔记本计算机的功能扩展。总线的指标计算机主机性能迅速提高,各功能模块性能也要相应提高,这对总线性能提出更高的要求。总线主要技术指标有几方面:总线宽度:一次操作可以传输的数据位数,如S100为8位,ISA为16位,EISA为32位,PCI-2可达64位。总线宽度不会超过微处理器外部数据总线的宽度。总数工作频率:总线信号中有一个CLK时钟,CLK越高每秒钟传输的数据量越大。ISA、EISA为8MHz,PCI为33.3MHz, PCI-2可达达66.6MHz。单个数据传输周期:不同的传输方式,每个数据传输所用CLK周期数不同。ISA要2个,PCI用1个CLK周期。这决定总线最高数据传输率。5. 总线的分类与层次系统总线:是微处理器芯片对外引线信号的延伸或映射,是微处理器与片外存储器及I/0接口传输信息的通路。系统总线信号按功能可分为三类:地址总线(Where):指出数据的来源与去向。地址总线的位数决定了存储空间的大小。系统总线:数据总线(What)提供模块间传输数据的路径,数据总线的位数决定微处理器结构的复杂度及总体性能。控制总线(When):提供系统操作所必需的控制信号,对操作过程进行控制与定时。扩充总线:亦称设备总线,用于系统I/O扩充。与系统总线工作频率不同,经接口电路对系统总统信号缓冲、变换、隔离,进行不同层次的操作(ISA、EISA、MCA)局部总线:扩充总线不能满足高性能设备(图形、视频、网络)接口的要求,在系统总线与扩充总线之间插入一层总线。由于它经桥接器与系统总线直接相连,因此称之为局部总线(PCI)。
上传时间: 2013-11-09
上传用户:nshark