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

END-user

  • DS1820 C51 子程序 (一线数据传输)

    //芯片资料请到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;}

    标签: 1820 C51 DS 程序

    上传时间: 2013-11-03

    上传用户:hongmo

  • PIC单片机程序设计基础

    1、程序的基本格式先介绍二条伪指令:EQU ——标号赋值伪指令ORG ——地址定义伪指令PIC16C5X在RESET后指令计算器PC被置为全“1”,所以PIC16C5X几种型号芯片的复位地址为:PIC16C54/55:1FFHPIC16C56:3FFHPIC16C57/58:7FFH一般来说,PIC的源程序并没有要求统一的格式,大家可以根据自己的风格来编写。但这里我们推荐一种清晰明了的格式TITLE This is ⋯⋯ ;程序标题;--------------------------------------;名称定义和变量定义;--------------------------------------F0 EQU 0RTCC EQU 1PC EQU 2STATUS EQU 3FSR EQU 4RA EQU 5RB EQU 6RC EQU 7┋PIC16C54 EQU 1FFH ;芯片复位地址PIC16C56 EQU 3FFHPIC16C57 EQU 7FFH;-----------------------------------------ORG PIC16C54 GOTO MAIN ;在复位地址处转入主程序ORG 0 ;在0000H开始存放程序;-----------------------------------------;子程序区;-----------------------------------------DELAY MOVLW 255┋RETLW 0;------------------------------------------;主程序区;------------------------------------------MAINMOVLW B‘00000000’TRIS RB ;RB已由伪指令定义为6,即B口┋LOOPBSF RB,7 CALL DELAYBCF RB,7 CALL DELAY┋GOTO LOOP;-------------------------------------------END ;程序结束注:MAIN标号一定要处在0页面内。2、程序设计基础

    标签: PIC 单片机程序设计

    上传时间: 2013-11-14

    上传用户:cjf0304

  • 汇编语言程序设计PPT

    §4-1  程序设计语言计算机程序设计语言是指计算机能够理解和执行的语言。  程序设计语言的种类很多,归纳起来有三种:                       机器语言、汇编语言和高级语言。  编程时采用哪种语言由程序设计语言的特点和适用场合决定。                     机器语言、汇编语言和高级语言比较一览表§4-2  汇编语言源程序格式汇编语言源程序格式如下:1、汇编语言源程序由一条一条汇编语句组成。2、每条汇编语句独占一行,以CR—LF结束。3、典型的汇编语句由四部分组成:                  标号:操作码  操作数;注释§4-3  伪指令一、伪指令与指令的区别:    伪指令由汇编程序识别,用来对汇编过程进行某种控制,或者对符号、标号赋值。在汇编过程中, 伪指令不产生可执行的目标代码;而指令由CPU执行,在汇编过程中,产生可执行的目标代码,完成对数据的运算与处理。二、常用的伪指令:ORG        END         EQU        DATA        DB       DW     DS §4-4  汇编语言程序设计基础一、汇编语言程序设计的一般步骤        分析课题        确定算法        画流程图        编写程序       上机调试二、程序结构          按程序的走向可以将程序分成4种结构:       简单程序      分支程序       循环程序      子程序

    标签: 汇编语言 程序设计

    上传时间: 2013-10-15

    上传用户:daoxiang126

  • 4位八段数码管的十进制加计数仿真实验(含电路图和仿真文件)

    4位八段数码管的十进制加计数仿真实验,程序采用汇编语言编写。此程序在仿真软件上与EDN-51实验板上均通过。仿真图中的数码管位驱动采用74HC04,如按EDN-51板上用想同的PNP三极管驱动在仿真软件上则无法正常显示。程序共分5块,STAR0为数据初始化,STAR2为计数子程序,STAR3为4位数码管动态显示子程序,STAR4为按键扫描子程序,STS00是延时子程序。由于EDN-51实验板上没装BCD译码器,所以编写程序比较烦琐。 程序如下: ORG 0000H                LJMP STAR0                        ;转程序 SRAR0ORG 0200H                                          ;程序地址 0200HSTAR0:   CLR 00                                  ;位 00 清 0               MOV P1,#0FFH                    ;#0FFH-->P1               MOV P2,#0FH                      ;#0FH-->P2               MOV P0,#0FFH                    ;#0FFH-->P0               MOV 30H,#00H                    ;#00H-->30H               MOV 31H,#00H                    ;#00H-->30H               MOV 32H,#00H                    ;#00H-->30H               MOV 33H,#00H                    ;#00H-->30H               LJMP STAR3                        ;转程序 SRAR3STAR2:   MOV A,#0AH                       ;#0AH-->A               INC 30H                                ;30H+1               CJNE A,30H,STJE                 ;30H 与 A 比较,不等转移 STJE               MOV 30H,#00H                    ;#00H-->30H               INC 31H                                ;31H+1               CJNE A,31H,STJE                 ;31H 与 A 比较,不等转移 STJE               MOV 31H,#00H                    ;#00H-->31H               INC 32H                                ;32H+1               CJNE A,32H,STJE                 ;32H 与 A 比较,不等转移 STJE               MOV 32H,#00H                    ;#00H-->32H               INC 33H                                ;33H+1               CJNE A,33H,STJE                 ;33H 与 A 比较,不等转移 STJE               MOV 33H,#00H                    ;#00H-->33H               MOV 32H,#00H                    ;#00H-->32H               MOV 31H,#00H                    ;#00H-->31H               MOV 30H,#00H                    ;#00H-->30HSTJE:      RET                                        ;子程序调用返回STAR3:   MOV R0,#30H                      ;#30H-->R0                MOV R6,#0F7H                   ;#0F7H-->R6SMG0:    MOV P1,#0FFH                    ;#0FFH-->P1                MOV A,R6                            ;R6-->A                MOV P1,A                            ;A-->P1                RR A                                     ;A向右移一位                MOV R6,A                           ;A-->R6                MOV A,@R0                       ;@R0-->A                ADD A,#04H                        ;#04H-->A                MOVC A,@A+PC               ;A+PC-->                MOV P0,A                            ;A-->P0                AJMP SMG1                        ;转程序 SMG1SDATA:   DB 0C0H,0F9H,0A4H,0B0H,99H                DB 92H,82H,0F8H,80H,90H SMG1:     LCALL STAR4                    ;转子程序 SRAR4                LCALL STS00                     ;转子程序 STS00                INC R0                                 ;R0+1                CJNE R6,#07FH,SMG0       ;#07FH 与 R6 比较,不等转移 SMG0                AJMP STAR3                       ;转程序 SRAR3STAR4:    JNB P2.0,ST1                      ;P2.0=0 转 ST1                CLR 00                                 ;位 00 清 0                SJMP ST3                            ;转ST3ST1:         JNB 00,ST2                          ;位 00=0 转 ST2                SJMP ST3                            ;转 ST3ST2:         LCALL STAR2                    ;调子程序 STAR2                SETB 00                               ;位 00 置 1ST3:         RET                                      ;子程序调用返回ORG 0100H                                         ;地址 0100HSTS00:     MOV 60H,#003H                ;#003H-->60H  (211)DE001:     MOV 61H,#0FFH               ;#0FFH-->61H (255)DE002:     DJNZ 61H,DE002               ;61H 减 1 不等于 0 转 DE002                 DJNZ 60H,DE001               ;60H 减 1 不等于 0 转 DE001                 RET                                     ;子程序调用返回                 END                                    ;结束 上次的程序共有293句,经小组成员建议,本人经几天的研究写了下面的这个程序,现在的程序用了63句,精简了230句。功能没有减。如谁有更简练的程序,请发上来,大家一起学习。 4位八段数码管的十进制加计数仿真实验(含电路图和仿真文件)

    标签: 数码管 十进制 仿真实验 仿真

    上传时间: 2013-10-11

    上传用户:sssl

  • PL2303 USB to Serial Adapter

    The PL2303 USB to Serial adapter is your smart and convenient accessory forconnecting RS-232 serial devices to your USB-equipped Windows host computer. Itprovides a bridge connection with a standard DB 9-pin male serial port connector inone end and a standard Type-A USB plug connector on the other end. You simplyattach the serial device onto the serial port of the cable and plug the USB connectorinto your PC USB port. It allows a simple and easy way of adding serial connectionsto your PC without having to go thru inserting a serial card and traditional portconfiguration.This USB to Serial adapter is ideal for connecting modems, cellular phones, PDAs,digital cameras, card readers and other serial devices to your computer. It providesserial connections up to 1Mbps of data transfer rate. And since USB does not requireany IRQ resource, more devices can be attached to the system without the previoushassles of device and resource conflicts.Finally, the PL-2303 USB to Serial adapter is a fully USB Specification compliantdevice and therefore supports advanced power management such as suspend andresume operations as well as remote wakeup. The PL-2303 USB Serial cable adapteris designed to work on all Windows operating systems.

    标签: Adapter Serial 2303 USB

    上传时间: 2013-11-01

    上传用户:ghostparker

  • 51汇编程序实例

    51汇编程序实例:举一例说明:流水灯加数码管 LOOP:     ; 标号CLR P2.6   ;选中p2.6 数码管左边的8字使能SETB P2.7   ;p2.7不使能。 右边的数码管消隐MOV P0,#28H  ;把28h送p0口;数码管显示 0LCALL DELAY ;延时MOV P0,#0FFH   ;0ffh 送p0口,数码管清除CLR P1.0    ;点亮p1.0发光管MOV P0,#7EH ;把7eh送p0口;数码管显示 1LCALL DELAYMOV P0,#0FFHCLR P1.1      ;点亮p1.0发光管CLR P1.0      ;点亮p1.0发光管MOV P0,#0A2H   ;数码管显示 2LCALL DELAYMOV P0,#0FFHCLR P1.2CLR P1.1CLR P1.0MOV P0,#62H    ;数码管显示 3LCALL DELAYMOV P0,#0FFHCLR P1.3CLR P1.2CLR P1.1CLR P1.0MOV P0,#74H    ;数码管显示 4LCALL DELAYMOV P0,#0FFHCLR P1.4CLR P1.3CLR P1.2CLR P1.1CLR P1.0MOV P0,#61H   ;数码管显示 5;LCALL DELAYMOV P0,#0FFHCLR P1.5CLR P1.4CLR P1.3CLR P1.2CLR P1.1CLR P1.0MOV P0,#21H     ; 数码管显示 6LCALL DELAYMOV P0,#0FFHCLR P1.6CLR P1.5CLR P1.4CLR P1.3CLR P1.2CLR P1.1CLR P1.0MOV P0,#7AH   ; 数码管显示 7LCALL DELAYMOV P0,#0FFHCLR P1.7CLR P1.6CLR P1.5CLR P1.4CLR P1.3CLR P1.2CLR P1.1CLR P1.0MOV P0,#20H   ; 数码管显示 8LCALL DELAYMOV P0,#0FFHLCALL DELAYMOV P0,#0FFHMOV P1,#0FFH;程序到此结果为左边的数码管显示0,1,2,3,4,5,6,7,8;p1.0------------p1.7指示灯依次点亮SETB P2.6   ; 左边的8消隐CLR P2.7   ;选中p2.7 数码管右边的8字使能 ,;MOV P0,#28HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.0MOV P0,#7EHLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.1MOV P0,#0A2HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.2MOV P0,#62HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.3MOV P0,#74HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.4MOV P0,#61HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.5MOV P0,#21HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.6MOV P0,#7AHLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHCLR P1.7MOV P0,#20HLCALL DELAYMOV P0,#0FFHMOV P1,#0FFHMOV P0,#0FFHMOV P1,#0FFH;这一段和上一段基本相同, 不同的是右边的数码管依次显示012345678,左边的不亮;;同时p1口的灯流动显示:AJMP LOOP; 注意: 程序运行到此跳转到开始标号,重复执行:DELAY:  ;延时子程序;参考前面的教程:CLR P3.3  ;注意小喇叭在3.3口, 这里可以使小喇叭发出嗒,嗒声MOV  R7,#255NOPNOPD1:MOV R6,#255setb p3.3D2: DJNZ R6,D2clr p3.3DJNZ R7,D1SETB P3.3RETENDLOOP:                ; 标号CLR P2.6             ;选中p2.6 数码管左边的8字使能SETB P2.7            ;p2.7不使能。 右边的数码管消隐MOV P0,#28H          ;把28h送p0口;数码管显示 0    ;28为1010000LCALL DELAY          ;  延时程序MOV P0,#0FFH         ;0ffh 送p0口,数码管清除;P0口为11111111CLR P1.0             ;点亮p1.0发光管; P1。0为电平,P0口为11111110MOV P0,#7EH          ;把7eh送p0口;数码管显示 1; P1。0为低电平,P0口为11111110LCALL DELAY          ;  延时程序MOV P0,#0FFHMOV P0,#0FFH         ;0ffh 送p0口,数码管清除;P0口为11111111 清一次显示这条是清显示的

    标签: 汇编 程序实例

    上传时间: 2013-10-31

    上传用户:gundamwzc

  • HID SDK Demo program User manual V1.04

    cm119电路图

    标签: program manual Demo 1.04

    上传时间: 2013-11-01

    上传用户:skhlm

  • XAPP694-从配置PROM读取用户数据

    This application note describes how to retrieve user-defined data from Xilinx configurationPROMs (XC18V00 and Platform Flash devices) after the same PROM has configured theFPGA. The method to add user-defined data to the configuration PROM file is also discussed.The reference design described in this application note can be used in any of the followingXilinx FPGA architectures: Spartan™-II, Spartan-IIE, Spartan-3, Virtex™, Virtex-E, Virtex-II,and Virtex-II Pro.

    标签: XAPP PROM 694 读取

    上传时间: 2013-11-11

    上传用户:zhouli

  • XAPP452-Spartan-3高级配置架构

    This application note provides a detailed description of the Spartan™-3 configurationarchitecture. It explains the composition of the bitstream file and how this bitstream isinterpreted by the configuration logic to program the part. Additionally, a methodology ispresented that will guide the user through the readback process. This information can be usedfor partial reconfiguration or partial readback.

    标签: Spartan XAPP 452 架构

    上传时间: 2013-11-05

    上传用户:透明的心情

  • Virtex-6 FPGA PCB设计手册

    Xilinx is disclosing this user guide, manual, release note, and/or specification (the "Documentation") to you solely for use in the developmentof designs to operate with Xilinx hardware devices. You may not reproduce, distribute, republish, download, display, post, or transmit theDocumentation in any form or by any means including, but not limited to, electronic, mechanical, photocopying, recording, or otherwise,without the prior written consent of Xilinx. Xilinx expressly disclaims any liability arising out of your use of the Documentation. Xilinx reservesthe right, at its sole discretion, to change the Documentation without notice at any time. Xilinx assumes no obligation to correct any errorscontained in the Documentation, or to advise you of any corrections or updates. Xilinx expressly disclaims any liability in connection withtechnical support or assistance that may be provided to you in connection with the Information.

    标签: Virtex FPGA PCB 设计手册

    上传时间: 2014-01-13

    上传用户:竺羽翎2222