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

WHILE

WHILE是计算机的一种基本循环模式。当满足条件时进入循环,进入循环后,当条件不满足时,跳出循环。WHILE语句的一般表达式为:WHILE(表达式){循环体}。
  • PCA9517 Level translating I2C-

    The PCA9517 is a CMOS integrated circuit that provides level shifting between lowvoltage (down to 0.9 V) and higher voltage (2.7 V to 5.5 V) I2C-bus or SMBus applications.WHILE retaining all the operating modes and features of the I2C-bus system during thelevel shifts, it also permits extension of the I2C-bus by providing bidirectional buffering forboth the data (SDA) and the clock (SCL) lines, thus enabling two buses of 400 pF. Usingthe PCA9517 enables the system designer to isolate two halves of a bus for both voltageand capacitance. The SDA and SCL pins are over voltage tolerant and arehigh-impedance when the PCA9517 is unpowered.

    标签: translating Level 9517 PCA

    上传时间: 2013-12-25

    上传用户:wsf950131

  • PCA9518 Expandable 5channel I2

    The PCA9518 is a BiCMOS integrated circuit intended forapplication in I2C and SMBus systems.WHILE retaining all the operating modes and features of the I2Csystem, it permits extension of the I2C-bus by buffering both thedata (SDA) and the clock (SCL) lines, thus enabling virtuallyunlimited buses of 400 pF.

    标签: Expandable 5channel 9518 PCA

    上传时间: 2013-10-23

    上传用户:dumplin9

  • PCA9519 4channel level transla

    The PCA9519 is a 4-channel level translating I2C-bus/SMBus repeater that enables theprocessor low voltage 2-wire serial bus to interface with standard I2C-bus or SMBus I/O.WHILE retaining all the operating modes and features of the I2C-bus system during thelevel shifts, it also permits extension of the I2C-bus by providing bidirectional buffering forboth the data (SDA) and the clock (SCL) lines, thus enabling the I2C-bus or SMBusmaximum capacitance of 400 pF on the higher voltage side. The SDA and SCL pins areover-voltage tolerant and are high-impedance when the PCA9519 is unpowered.

    标签: 4channel transla level 9519

    上传时间: 2013-11-19

    上传用户:jisiwole

  • 3-V TO 5.5-V MULTICHANNEL RS-2

    The MAX3243E device consists of three line drivers, five line receivers, and a dual charge-pump circuit with±15-kV ESD (HBM and IEC61000-4-2, Air-Gap Discharge) and ±8-kV ESD (IEC61000-4-2, Contact Discharge)protection on serial-port connection pins. The device meets the requirements of TIA/EIA-232-F and provides theelectrical interface between an asynchronous communication controller and the serial-port connector. Thiscombination of drivers and receivers matches that needed for the typical serial port used in an IBM PC/AT, orcompatible. The charge pump and four small external capacitors allow operation from a single 3-V to 5.5-Vsupply. In addition, the device includes an always-active noninverting output (ROUT2B), which allowsapplications using the ring indicator to transmit data WHILE the device is powered down. The device operates atdata signaling rates up to 250 kbit/s and a maximum of 30-V/ms driver output slew rate.

    标签: MULTICHANNEL 5.5 TO RS

    上传时间: 2013-10-19

    上传用户:ddddddd

  • PCA954X家庭的I C SMBus多路复用器与开关

    The Philips family of Multiplexers and Switches consists of bi-directional translating switches controlled via the I2C or SMBus to fan out an upstream SCL/SDA pair to 2, 4 or 8 downstream channels of SCx/SDx pairs. The Multiplexers allow only one downstream channel to be selected at a time, WHILE the Switches allow any individual downstream channel or combination of downstream channels to be selected, depending on the content of the programmable control register. Once one or several channels have been selected, the device acts as a wire, allowing the master on the upstream channel to send commands to devices on all the active downstream channels, and devices on the active downstream channels to communicate with each other and the master. External pull-up resistors are used to pull each individual channel up to the desired voltage level. Combined interrupt output and hardware reset input are device options that are featured.

    标签: SMBus 954X PCA 954

    上传时间: 2013-10-11

    上传用户:dianxin61

  • C51基本结构程序设计

    C51基本结构程序设计1. 掌握if语句来实现选择结构,能利用if语句编写相应的分枝结构的程序。在嵌套if语句中,一定要搞清楚else与哪个if结合的问题。2.掌握switch语句来实现多向分枝选择结构,能利用switch语句编写相应的分枝结构的程序。 3. 掌握循环语句的即初始化、循环体、循环控制及结束四个部分,并能进行循环语句的程序设计。分别掌握for 语句、WHILE语句以及do-WHILE语句的使用语法及方法,能利用这三种循环结构进行循环程序设计,理解这三种语句的异同。4.理解并掌握continue、break语句在循环结构和选择结构中的作用。对于goto语句,理解该语句优缺点。C51语言是结构化编程语言。结构化语言的基本元素是模块,它是程序的一部分.只有一个出口和一个入口.不允许有偶然的中途插入或以模块的其它路径退出。结构化编程语言在没有妥善保护或恢复堆栈和其它相关的寄存器之前,不应随便跳入或跳出一个模块。因此使用这种结构化语言进行编程,当要退出中断时,堆栈不会因为程序使用了任何可以接受的命令而崩溃。    结构化程序由若干模块组成,每个模块中包含着若干个基本结构,而每个基本结构中可以有若干条语句。归纳起来,C51程序有顺序结构、选择结构、循环结构共三种结构。

    标签: C51 基本结构 程序设计

    上传时间: 2013-11-01

    上传用户:四只眼

  • 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

  • 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

  • 串行编程器源程序(Keil C语言)

    串行编程器源程序(Keil C语言)//FID=01:AT89C2051系列编程器//实现编程的读,写,擦等细节//AT89C2051的特殊处:给XTAL一个脉冲,地址计数加1;P1的引脚排列与AT89C51相反,需要用函数转换#include <e51pro.h> #define C2051_P3_7 P1_0#define C2051_P1 P0//注意引脚排列相反#define C2051_P3_0  P1_1#define C2051_P3_1 P1_2#define C2051_XTAL P1_4#define C2051_P3_2 P1_5#define C2051_P3_3 P1_6#define C2051_P3_4 P1_7#define C2051_P3_5 P3_5 void InitPro01()//编程前的准备工作{ SetVpp0V(); P0=0xff; P1=0xff; C2051_P3_5=1; C2051_XTAL=0; Delay_ms(20); nAddress=0x0000; SetVpp5V();} void ProOver01()//编程结束后的工作,设置合适的引脚电平{ SetVpp5V(); P0=0xff; P1=0xff; C2051_P3_5=1; C2051_XTAL=1;} BYTE GetData()//从P0口获得数据{ B_0=P0_7; B_1=P0_6; B_2=P0_5; B_3=P0_4; B_4=P0_3; B_5=P0_2; B_6=P0_1; B_7=P0_0; return B;} void SetData(BYTE DataByte)//转换并设置P0口的数据{ B=DataByte; P0_0=B_7; P0_1=B_6; P0_2=B_5; P0_3=B_4; P0_4=B_3; P0_5=B_2; P0_6=B_1; P0_7=B_0;} void ReadSign01()//读特征字{ InitPro01(); Delay_ms(1);//----------------------------------------------------------------------------- //根据器件的DataSheet,设置相应的编程控制信号 C2051_P3_3=0; C2051_P3_4=0; C2051_P3_5=0; C2051_P3_7=0; Delay_ms(20); ComBuf[2]=GetData(); C2051_XTAL=1; C2051_XTAL=0; Delay_us(20); ComBuf[3]=GetData(); ComBuf[4]=0xff;//----------------------------------------------------------------------------- ProOver01();} void Erase01()//擦除器件{ InitPro01();//----------------------------------------------------------------------------- //根据器件的DataSheet,设置相应的编程控制信号 C2051_P3_3=1; C2051_P3_4=0; C2051_P3_5=0; C2051_P3_7=0; Delay_ms(1); SetVpp12V(); Delay_ms(1); C2051_P3_2=0; Delay_ms(10); C2051_P3_2=1; Delay_ms(1);//----------------------------------------------------------------------------- ProOver01();} BOOL Write01(BYTE Data)//写器件{//----------------------------------------------------------------------------- //根据器件的DataSheet,设置相应的编程控制信号 //写一个单元 C2051_P3_3=0; C2051_P3_4=1; C2051_P3_5=1; C2051_P3_7=1; SetData(Data); SetVpp12V(); Delay_us(20); C2051_P3_2=0; Delay_us(20); C2051_P3_2=1; Delay_us(20); SetVpp5V(); Delay_us(20); C2051_P3_4=0; Delay_ms(2); nTimeOut=0; P0=0xff; nTimeOut=0; WHILE(!GetData()==Data)//效验:循环读,直到读出与写入的数相同 {  nTimeOut++;  if(nTimeOut>1000)//超时了  {   return 0;  } } C2051_XTAL=1; C2051_XTAL=0;//一个脉冲指向下一个单元//----------------------------------------------------------------------------- return 1;} BYTE Read01()//读器件{ BYTE Data;//----------------------------------------------------------------------------- //根据器件的DataSheet,设置相应的编程控制信号 //读一个单元 C2051_P3_3=0; C2051_P3_4=0; C2051_P3_5=1; C2051_P3_7=1; Data=GetData(); C2051_XTAL=1; C2051_XTAL=0;//一个脉冲指向下一个单元//----------------------------------------------------------------------------- return Data;} void Lock01()//写锁定位{ InitPro01();//先设置成编程状态//----------------------------------------------------------------------------- //根据器件的DataSheet,设置相应的编程控制信号 if(ComBuf[2]>=1)//ComBuf[2]为锁定位 {  C2051_P3_3=1;  C2051_P3_4=1;  C2051_P3_5=1;  C2051_P3_7=1;  Delay_us(20);  SetVpp12V();  Delay_us(20);  C2051_P3_2=0;  Delay_us(20);  C2051_P3_2=1;  Delay_us(20);  SetVpp5V(); } if(ComBuf[2]>=2) {  C2051_P3_3=1;  C2051_P3_4=1;  C2051_P3_5=0;  C2051_P3_7=0;  Delay_us(20);  SetVpp12V();  Delay_us(20);  C2051_P3_2=0;  Delay_us(20);  C2051_P3_2=1;  Delay_us(20);  SetVpp5V(); }//----------------------------------------------------------------------------- ProOver01();} void PreparePro01()//设置pw中的函数指针,让主程序可以调用上面的函数{ pw.fpInitPro=InitPro01; pw.fpReadSign=ReadSign01; pw.fpErase=Erase01; pw.fpWrite=Write01; pw.fpRead=Read01; pw.fpLock=Lock01; pw.fpProOver=ProOver01;}

    标签: Keil 串行 C语言 编程器

    上传时间: 2013-11-12

    上传用户:gut1234567