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

📄 1602shizhong.lss

📁 时钟电路和程序
💻 LSS
📖 第 1 页 / 共 3 页
字号:

1602shizhong.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000005f4  00000000  00000000  00000074  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000020  00800060  000005f4  00000668  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000001  00800080  00000614  00000688  2**0
                  ALLOC
  3 .debug_aranges 00000020  00000000  00000000  00000688  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_pubnames 000000f6  00000000  00000000  000006a8  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   00000819  00000000  00000000  0000079e  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 00000227  00000000  00000000  00000fb7  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_line   00000665  00000000  00000000  000011de  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  000000e0  00000000  00000000  00001844  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_str    000001c1  00000000  00000000  00001924  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_loc    0000040d  00000000  00000000  00001ae5  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_ranges 00000090  00000000  00000000  00001ef2  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:
   0:	0c 94 2a 00 	jmp	0x54	; 0x54 <__ctors_end>
   4:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
   8:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
   c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  10:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  14:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  18:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  1c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  20:	0c 94 aa 02 	jmp	0x554	; 0x554 <__vector_8>
  24:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  28:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  2c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  30:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  34:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  38:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  3c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  40:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  44:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  48:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  4c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  50:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>

00000054 <__ctors_end>:
  54:	11 24       	eor	r1, r1
  56:	1f be       	out	0x3f, r1	; 63
  58:	cf e5       	ldi	r28, 0x5F	; 95
  5a:	d4 e0       	ldi	r29, 0x04	; 4
  5c:	de bf       	out	0x3e, r29	; 62
  5e:	cd bf       	out	0x3d, r28	; 61

00000060 <__do_copy_data>:
  60:	10 e0       	ldi	r17, 0x00	; 0
  62:	a0 e6       	ldi	r26, 0x60	; 96
  64:	b0 e0       	ldi	r27, 0x00	; 0
  66:	e4 ef       	ldi	r30, 0xF4	; 244
  68:	f5 e0       	ldi	r31, 0x05	; 5
  6a:	02 c0       	rjmp	.+4      	; 0x70 <.do_copy_data_start>

0000006c <.do_copy_data_loop>:
  6c:	05 90       	lpm	r0, Z+
  6e:	0d 92       	st	X+, r0

00000070 <.do_copy_data_start>:
  70:	a0 38       	cpi	r26, 0x80	; 128
  72:	b1 07       	cpc	r27, r17
  74:	d9 f7       	brne	.-10     	; 0x6c <.do_copy_data_loop>

00000076 <__do_clear_bss>:
  76:	10 e0       	ldi	r17, 0x00	; 0
  78:	a0 e8       	ldi	r26, 0x80	; 128
  7a:	b0 e0       	ldi	r27, 0x00	; 0
  7c:	01 c0       	rjmp	.+2      	; 0x80 <.do_clear_bss_start>

0000007e <.do_clear_bss_loop>:
  7e:	1d 92       	st	X+, r1

00000080 <.do_clear_bss_start>:
  80:	a1 38       	cpi	r26, 0x81	; 129
  82:	b1 07       	cpc	r27, r17
  84:	e1 f7       	brne	.-8      	; 0x7e <.do_clear_bss_loop>
  86:	0e 94 c9 02 	call	0x592	; 0x592 <main>
  8a:	0c 94 f8 02 	jmp	0x5f0	; 0x5f0 <_exit>

0000008e <__bad_interrupt>:
  8e:	0c 94 00 00 	jmp	0	; 0x0 <__vectors>

00000092 <LCD_en_write>:
 // LCD_write_command(0x1c);
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  92:	db 9a       	sbi	0x1b, 3	; 27
    can be achieved.
*/
void
_delay_loop_1(uint8_t __count)
{
	__asm__ volatile (
  94:	81 e0       	ldi	r24, 0x01	; 1
  96:	8a 95       	dec	r24
  98:	f1 f7       	brne	.-4      	; 0x96 <LCD_en_write+0x4>
  LCD_EN_PORT|=LCD_EN;
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
  9a:	db 98       	cbi	0x1b, 3	; 27
}
  9c:	08 95       	ret

0000009e <LCD_write_command>:

void LCD_write_command(unsigned char command) //写指令
{
  9e:	31 e0       	ldi	r19, 0x01	; 1
  a0:	93 2f       	mov	r25, r19
  a2:	9a 95       	dec	r25
  a4:	f1 f7       	brne	.-4      	; 0xa2 <LCD_write_command+0x4>
  _delay_us(16);
  LCD_RS_PORT&=~LCD_RS;        //RS=0
  a6:	da 98       	cbi	0x1b, 2	; 27
  LCD_DATA_PORT&=0X0f;         //清高四位
  a8:	9b b3       	in	r25, 0x1b	; 27
  aa:	9f 70       	andi	r25, 0x0F	; 15
  ac:	9b bb       	out	0x1b, r25	; 27
  LCD_DATA_PORT|=command&0xf0; //写高四位
  ae:	2b b3       	in	r18, 0x1b	; 27
  b0:	98 2f       	mov	r25, r24
  b2:	90 7f       	andi	r25, 0xF0	; 240
  b4:	92 2b       	or	r25, r18
  b6:	9b bb       	out	0x1b, r25	; 27
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  LCD_EN_PORT|=LCD_EN;
  b8:	db 9a       	sbi	0x1b, 3	; 27
  ba:	93 2f       	mov	r25, r19
  bc:	9a 95       	dec	r25
  be:	f1 f7       	brne	.-4      	; 0xbc <LCD_write_command+0x1e>
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
  c0:	db 98       	cbi	0x1b, 3	; 27
  LCD_RS_PORT&=~LCD_RS;        //RS=0
  LCD_DATA_PORT&=0X0f;         //清高四位
  LCD_DATA_PORT|=command&0xf0; //写高四位
  LCD_en_write();
  command=command<<4;          //低四位移到高四位
  LCD_DATA_PORT&=0x0f;         //清高四位
  c2:	9b b3       	in	r25, 0x1b	; 27
  c4:	9f 70       	andi	r25, 0x0F	; 15
  c6:	9b bb       	out	0x1b, r25	; 27
  LCD_DATA_PORT|=command&0xf0; //写低四位
  c8:	9b b3       	in	r25, 0x1b	; 27
  ca:	82 95       	swap	r24
  cc:	80 7f       	andi	r24, 0xF0	; 240
  ce:	98 2b       	or	r25, r24
  d0:	9b bb       	out	0x1b, r25	; 27
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  LCD_EN_PORT|=LCD_EN;
  d2:	db 9a       	sbi	0x1b, 3	; 27
  d4:	3a 95       	dec	r19
  d6:	f1 f7       	brne	.-4      	; 0xd4 <LCD_write_command+0x36>
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
  d8:	db 98       	cbi	0x1b, 3	; 27
  command=command<<4;          //低四位移到高四位
  LCD_DATA_PORT&=0x0f;         //清高四位
  LCD_DATA_PORT|=command&0xf0; //写低四位
  LCD_en_write();
  
}
  da:	08 95       	ret

000000dc <LCD_init>:
#include"util/delay.h"



void LCD_init(void)         //液晶初始化
{
  dc:	8a b3       	in	r24, 0x1a	; 26
  de:	80 6f       	ori	r24, 0xF0	; 240
  e0:	8a bb       	out	0x1a, r24	; 26
  LCD_DATA_DDR|=LCD_DATA;   //数据口方向为输出
  LCD_EN_DDR|=LCD_EN;       //设置EN方向为输出
  e2:	d3 9a       	sbi	0x1a, 3	; 26
  LCD_RS_DDR|=LCD_RS;       //设置RS方向为输出
  e4:	d2 9a       	sbi	0x1a, 2	; 26
  LCD_write_command(0x28); 
  e6:	88 e2       	ldi	r24, 0x28	; 40
  e8:	0e 94 4f 00 	call	0x9e	; 0x9e <LCD_write_command>
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  LCD_EN_PORT|=LCD_EN;
  ec:	db 9a       	sbi	0x1b, 3	; 27
  ee:	81 e0       	ldi	r24, 0x01	; 1
  f0:	98 2f       	mov	r25, r24
  f2:	9a 95       	dec	r25
  f4:	f1 f7       	brne	.-4      	; 0xf2 <LCD_init+0x16>
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
  f6:	db 98       	cbi	0x1b, 3	; 27
  f8:	8a 95       	dec	r24
  fa:	f1 f7       	brne	.-4      	; 0xf8 <LCD_init+0x1c>
  LCD_EN_DDR|=LCD_EN;       //设置EN方向为输出
  LCD_RS_DDR|=LCD_RS;       //设置RS方向为输出
  LCD_write_command(0x28); 
  LCD_en_write();
  _delay_us(40);
  LCD_write_command(0x28);  //4位显示
  fc:	88 e2       	ldi	r24, 0x28	; 40
  fe:	0e 94 4f 00 	call	0x9e	; 0x9e <LCD_write_command>
  LCD_write_command(0x0c);  //显示开
 102:	8c e0       	ldi	r24, 0x0C	; 12
 104:	0e 94 4f 00 	call	0x9e	; 0x9e <LCD_write_command>
  LCD_write_command(0x01);  //清屏
 108:	81 e0       	ldi	r24, 0x01	; 1
 10a:	0e 94 4f 00 	call	0x9e	; 0x9e <LCD_write_command>
    milliseconds can be achieved.
 */
void
_delay_loop_2(uint16_t __count)
{
	__asm__ volatile (
 10e:	85 e0       	ldi	r24, 0x05	; 5
 110:	90 e0       	ldi	r25, 0x00	; 0
 112:	01 97       	sbiw	r24, 0x01	; 1
 114:	f1 f7       	brne	.-4      	; 0x112 <LCD_init+0x36>
 // LCD_write_command(0x1c);
  _delay_ms(2);
}
 116:	08 95       	ret

00000118 <LCD_write_data>:
  LCD_en_write();
  
}

void LCD_write_data(unsigned char data) //写数据
{
 118:	93 e0       	ldi	r25, 0x03	; 3
 11a:	9a 95       	dec	r25
 11c:	f1 f7       	brne	.-4      	; 0x11a <LCD_write_data+0x2>
  _delay_us(1000);
  LCD_RS_PORT|=LCD_RS;       //RS=1
 11e:	da 9a       	sbi	0x1b, 2	; 27
  LCD_DATA_PORT&=0X0f;       //清高四位
 120:	9b b3       	in	r25, 0x1b	; 27
 122:	9f 70       	andi	r25, 0x0F	; 15
 124:	9b bb       	out	0x1b, r25	; 27
  LCD_DATA_PORT|=data&0xf0;  //写高四位
 126:	2b b3       	in	r18, 0x1b	; 27
 128:	98 2f       	mov	r25, r24
 12a:	90 7f       	andi	r25, 0xF0	; 240
 12c:	92 2b       	or	r25, r18
 12e:	9b bb       	out	0x1b, r25	; 27
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  LCD_EN_PORT|=LCD_EN;
 130:	db 9a       	sbi	0x1b, 3	; 27
    can be achieved.
*/
void
_delay_loop_1(uint8_t __count)
{
	__asm__ volatile (
 132:	21 e0       	ldi	r18, 0x01	; 1
 134:	92 2f       	mov	r25, r18
 136:	9a 95       	dec	r25
 138:	f1 f7       	brne	.-4      	; 0x136 <LCD_write_data+0x1e>
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
 13a:	db 98       	cbi	0x1b, 3	; 27
  LCD_RS_PORT|=LCD_RS;       //RS=1
  LCD_DATA_PORT&=0X0f;       //清高四位
  LCD_DATA_PORT|=data&0xf0;  //写高四位
  LCD_en_write();
  data=data<<4;               //低四位移到高四位
  LCD_DATA_PORT&=0X0f;        //清高四位
 13c:	9b b3       	in	r25, 0x1b	; 27
 13e:	9f 70       	andi	r25, 0x0F	; 15
 140:	9b bb       	out	0x1b, r25	; 27
  LCD_DATA_PORT|=data&0xf0;   //写低四位
 142:	9b b3       	in	r25, 0x1b	; 27
 144:	82 95       	swap	r24
 146:	80 7f       	andi	r24, 0xF0	; 240
 148:	98 2b       	or	r25, r24
 14a:	9b bb       	out	0x1b, r25	; 27
  _delay_ms(2);
}

void LCD_en_write(void)  //液晶使能
{
  LCD_EN_PORT|=LCD_EN;
 14c:	db 9a       	sbi	0x1b, 3	; 27
 14e:	2a 95       	dec	r18
 150:	f1 f7       	brne	.-4      	; 0x14e <LCD_write_data+0x36>
  _delay_us(1);
  LCD_EN_PORT&=~LCD_EN;
 152:	db 98       	cbi	0x1b, 3	; 27
  LCD_en_write();
  data=data<<4;               //低四位移到高四位
  LCD_DATA_PORT&=0X0f;        //清高四位
  LCD_DATA_PORT|=data&0xf0;   //写低四位
  LCD_en_write();
}
 154:	08 95       	ret

00000156 <LCD_set_xy>:


void LCD_set_xy( unsigned char x, unsigned char y )  //写地址函数
{
 156:	66 23       	and	r22, r22
 158:	11 f4       	brne	.+4      	; 0x15e <LCD_set_xy+0x8>
 15a:	80 58       	subi	r24, 0x80	; 128
 15c:	01 c0       	rjmp	.+2      	; 0x160 <LCD_set_xy+0xa>
    unsigned char address;
    if (y==0) address=0x80+x;
    else   address=0xc0+x;
 15e:	80 54       	subi	r24, 0x40	; 64
    LCD_write_command(address);
 160:	0e 94 4f 00 	call	0x9e	; 0x9e <LCD_write_command>
}
 164:	08 95       	ret

00000166 <LCD_write_string>:
  
void LCD_write_string(unsigned char X,unsigned char Y,unsigned char *s) //列x=0~15,行y=0,1
   {
 166:	cf 93       	push	r28
 168:	df 93       	push	r29
 16a:	ea 01       	movw	r28, r20
    LCD_set_xy( X, Y ); //写地址    
 16c:	0e 94 ab 00 	call	0x156	; 0x156 <LCD_set_xy>
 170:	03 c0       	rjmp	.+6      	; 0x178 <LCD_write_string+0x12>
    while (*s)  // 写显示字符
    {
      LCD_write_data(*s);
 172:	0e 94 8c 00 	call	0x118	; 0x118 <LCD_write_data>
      s++;
 176:	21 96       	adiw	r28, 0x01	; 1
}

⌨️ 快捷键说明

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