⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 111.lst

📁 温度测量ds18b20.rar
💻 LST
字号:
__text_start:
__start:
      13 E5CF      LDI	R28,0x5F
      14 E0D4      LDI	R29,4
      15 BFCD      OUT	0x3D,R28
      16 BFDE      OUT	0x3E,R29
      17 51CE      SUBI	R28,0x1E
      18 40D0      SBCI	R29,0
      19 EA0A      LDI	R16,0xAA
      1A 8308      STD	Y+0,R16
      1B 2400      CLR	R0
      1C E6E0      LDI	R30,0x60
      1D E0F0      LDI	R31,0
      1E E010      LDI	R17,0
      1F 36E0      CPI	R30,0x60
      20 07F1      CPC	R31,R17
      21 F011      BEQ	0x0024
      22 9201      ST	R0,Z+
      23 CFFB      RJMP	0x001F
      24 8300      STD	Z+0,R16
      25 E2E6      LDI	R30,0x26
      26 E0F0      LDI	R31,0
      27 E6A0      LDI	R26,0x60
      28 E0B0      LDI	R27,0
      29 E010      LDI	R17,0
      2A E000      LDI	R16,0
      2B BF0B      OUT	0x3B,R16
      2C 32E6      CPI	R30,0x26
      2D 07F1      CPC	R31,R17
      2E F021      BEQ	0x0033
      2F 95C8      LPM
      30 9631      ADIW	R30,1
      31 920D      ST	R0,X+
      32 CFF9      RJMP	0x002C
      33 D013      RCALL	_main
_exit:
      34 CFFF      RJMP	_exit
FILE: D:\教程及心得\Proteus\PROTEU~2\5.avr\19.温度测量ds18b20\1.精确延时\111.c
(0001) //ICC-AVR application builder : 2008/11/17 1:48:21
(0002) // Target : M8
(0003) // Crystal: 1.0000Mhz
(0004) 
(0005) #include <iom8v.h>
(0006) #include <macros.h>
(0007) #define uchar unsigned char
(0008) void delay()
(0009) {
_delay:
      35 9508      RET
(0010) 
(0011) }
(0012) void port_init(void)
(0013) {
(0014)  PORTB = 0x00;
_port_init:
      36 2422      CLR	R2
      37 BA28      OUT	0x18,R2
(0015)  DDRB  = 0x00;
      38 BA27      OUT	0x17,R2
(0016)  PORTC = 0x00; //m103 output only
      39 BA25      OUT	0x15,R2
(0017)  DDRC  = 0xff;
      3A EF8F      LDI	R24,0xFF
      3B BB84      OUT	0x14,R24
(0018)  PORTD = 0x00;
      3C BA22      OUT	0x12,R2
(0019)  DDRD  = 0x00;
      3D BA21      OUT	0x11,R2
      3E 9508      RET
(0020) }
(0021) 
(0022) //call this routine to initialize all peripherals
(0023) void init_devices(void)
(0024) {
(0025)  //stop errant interrupts until set up
(0026)  CLI(); //disable all interrupts
_init_devices:
      3F 94F8      BCLR	7
(0027)  port_init();
      40 DFF5      RCALL	_port_init
(0028) 
(0029)  MCUCR = 0x00;
      41 2422      CLR	R2
      42 BE25      OUT	0x35,R2
(0030)  GICR  = 0x00;
      43 BE2B      OUT	0x3B,R2
(0031)  TIMSK = 0x00; //timer interrupt sources
      44 BE29      OUT	0x39,R2
(0032)  SEI(); //re-enable interrupts
      45 9478      BSET	7
      46 9508      RET
(0033)  //all peripherals are now initialized
(0034) }
(0035) 
(0036) void main(void)
(0037) {
(0038)   init_devices();
_main:
      47 DFF7      RCALL	_init_devices
(0039)    /*精确延时111us,晶振4MHz */
(0040) /*us级精确延时 766us/晶振以内 延时=1+n*3 */
(0041) // CLI;//屏蔽中断
(0042) asm("LDI R18,147");//1t ,寄存器R15~R30
      48 E923      LDI	R18,0x93
(0043) asm("CLZ");//1t
      49 9498      BCLR	1
(0044) asm("LOOP1:DEC R18");//1t
      4A 952A      DEC	R18
(0045) asm("BRNE LOOP1");//1t或2t//标志位Z是0就转移
      4B F7F1      BNE	0x004A
(0046) asm("NOP");//1t
      4C 0000      NOP
(0047) asm("NOP");//1t
      4D 0000      NOP
(0048) // SEI;
(0049) /*us级精确延时 766us/晶振以内,可用nop补足余数*/
(0050) /*精确延时0ms 111us */
(0051) 
(0052) 	PORTC=0xff;
FILE: <library>
      4E EF8F      LDI	R24,0xFF
      4F BB85      OUT	0x15,R24
      50 9508      RET

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -