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

📄 160104_s6b0719.s

📁 160104S6B0719(iccavr) form ouravr.com
💻 S
📖 第 1 页 / 共 4 页
字号:
	.byte 1,2
	.byte 28,8
	.byte 0,64
	.byte 128,0
	.byte 0,0
	.byte 4,3
	.byte 0,0
	.byte 63,64
	.byte 64,64
	.byte 64,64
	.byte 64,'x
	.byte 0,7
	.byte 2,0
	.byte 0,12
	.byte 20,164
	.byte 4,'d
	.byte 53,174
	.byte 'd,36
	.byte 20,164
	.byte 20,4
	.byte 4,0
	.byte 8,10
	.byte 9,8
	.byte 8,10
	.byte 11,254
	.byte 10,11
	.byte 12,8
	.byte 9,10
	.byte 8,0
	.byte 4,4
	.byte 4,4
	.byte 't,'T
	.byte 'U,'V
	.byte 'T,'T
	.byte 't,4
	.byte 4,4
	.byte 4,0
	.byte 0,255
	.byte 1,1
	.byte 61,37
	.byte 37,37
	.byte 37,37
	.byte 61,'A
	.byte 129,127
	.byte 0,0
	.byte 32,48
	.byte 172,'c
	.byte 32,24
	.byte 2,130
	.byte 126,130
	.byte 'B,'r
	.byte 'N,192
	.byte 64,0
	.byte 16,19
	.byte 17,'I
	.byte 41,145
	.byte 140,'C
	.byte 64,35
	.byte 20,24
	.byte 'f,193
	.byte 64,0
	.byte 64,'A
	.byte 206,4
	.byte 0,128
	.byte 64,190
	.byte 130,130
	.byte 130,190
	.byte 192,64
	.byte 64,0
	.byte 0,0
	.byte 127,32
	.byte 144,128
	.byte 64,'C
	.byte 44,16
	.byte 16,44
	.byte 'C,192
	.byte 64,0
	.byte 0,32
	.byte 47,169
	.byte 169,175
	.byte 233,185
	.byte 169,175
	.byte 169,169
	.byte 47,32
	.byte 0,0
	.byte 128,128
	.byte 128,255
	.byte 170,170
	.byte 170,170
	.byte 170,170
	.byte 170,255
	.byte 128,128
	.byte 128,0
	.byte 0,254
	.byte 2,2
	.byte 254,0
	.byte 0,254
	.byte 34,34
	.byte 34,226
	.byte 33,33
	.byte 32,0
	.byte 0,7
	.byte 1,129
	.byte 'C,48
	.byte 12,3
	.byte 0,0
	.byte 0,127
	.byte 0,0
	.byte 0,0
	.byte 64,'A
	.byte 206,4
	.byte 64,32
	.byte 16,140
	.byte 131,'D
	.byte 'h,'P
	.byte 16,96
	.byte 32,0
	.byte 0,0
	.byte 127,32
	.byte 16,129
	.byte 137,'H
	.byte 'D,38
	.byte 35,18
	.byte 28,8
	.byte 0,0
	.byte 0,248
	.byte 1,6
	.byte 0,240
	.byte 146,146
	.byte 146,146
	.byte 242,2
	.byte 2,254
	.byte 0,0
	.byte 0,255
	.byte 0,0
	.byte 0,7
	.byte 4,4
	.byte 4,4
	.byte 7,64
	.byte 128,127
	.byte 0,0
	.byte 0,254
	.byte 34,'Z
	.byte 134,128
	.byte 130,186
	.byte 170,170
	.byte 170,170
	.byte 186,130
	.byte 128,0
	.byte 0,255
	.byte 2,4
	.byte 3,255
	.byte 0,5
	.byte 6,124
	.byte 6,5
	.byte 'D,128
	.byte 127,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,254
	.byte 64,64
	.byte 64,64
	.byte 64,0
	.byte 0,0
	.byte 0,64
	.byte 64,64
	.byte 64,64
	.byte 64,127
	.byte 64,64
	.byte 64,64
	.byte 64,96
	.byte 64,0
	.byte 0,2
	.byte 2,2
	.byte 2,2
	.byte 2,254
	.byte 34,'b
	.byte 194,130
	.byte 2,3
	.byte 2,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,127
	.byte 0,0
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 254,2
	.byte 50,'N
	.byte 130,0
	.byte 254,'J
	.byte 202,'J
	.byte 'J,'J
	.byte 126,0
	.byte 0,0
	.byte 255,0
	.byte 2,4
	.byte 3,0
	.byte 255,64
	.byte 32,3
	.byte 12,18
	.byte 33,96
	.byte 32,0
	.byte 0,64
	.byte 'B,'B
	.byte 'B,'B
	.byte 'B,254
	.byte 194,'B
	.byte 'B,'B
	.byte 'B,'B
	.byte 64,0
	.byte 64,64
	.byte 32,16
	.byte 8,4
	.byte 3,0
	.byte 63,64
	.byte 64,64
	.byte 64,64
	.byte 'p,0
	.byte 64,'B
	.byte 220,8
	.byte 0,0
	.byte 254,'R
	.byte 146,18
	.byte 18,146
	.byte 's,2
	.byte 0,0
	.byte 64,32
	.byte 31,32
	.byte 'H,'F
	.byte 'Q,'P
	.byte 'H,'E
	.byte 'B,'E
	.byte 'H,'P
	.byte 0,0
	.byte 0,254
	.byte 2,2
	.byte 242,18
	.byte 18,18
	.byte 18,18
	.byte 242,2
	.byte 2,254
	.byte 0,0
	.byte 0,127
	.byte 64,64
	.byte 'G,'D
	.byte 'D,'D
	.byte 'D,'D
	.byte 'G,64
	.byte 64,127
	.byte 0,0
	.byte 8,136
	.byte 'h,255
	.byte 40,'H
	.byte 0,136
	.byte 'h,9
	.byte 14,8
	.byte 168,'H
	.byte 136,0
	.byte 2,1
	.byte 0,255
	.byte 0,64
	.byte 'B,33
	.byte 38,24
	.byte 24,38
	.byte 'a,192
	.byte 64,0
	.byte 0,2
	.byte 2,194
	.byte 2,2
	.byte 2,2
	.byte 254,130
	.byte 130,130
	.byte 130,130
	.byte 2,0
	.byte 32,32
	.byte 32,63
	.byte 32,32
	.byte 32,32
	.byte 63,32
	.byte 32,32
	.byte 32,32
	.byte 32,0
	.dbsym e chinese_16x16_dot _chinese_16x16_dot A[736:736]kc
_ascii_4x8_dot::
	.byte 60,'B
	.byte 60,0
	.byte 'D,126
	.byte 64,0
	.byte 'v,'R
	.byte 94,0
	.byte 'B,'J
	.byte 126,0
	.byte 30,16
	.byte 126,0
	.byte 'N,'J
	.byte 'z,0
	.byte 126,'J
	.byte 'z,0
	.byte 2,'z
	.byte 6,0
	.byte 'v,'J
	.byte 'v,0
	.byte 'n,'J
	.byte 126,0
	.dbsym e ascii_4x8_dot _ascii_4x8_dot A[40:40]kc
_round::
	.byte 0,240
	.byte 248,252
	.byte 254,254
	.byte 254,254
	.byte 254,252
	.byte 248,240
	.byte 0,0
	.byte 0,1
	.byte 3,7
	.byte 15,15
	.byte 15,15
	.byte 15,7
	.byte 3,1
	.byte 0,0
	.dbsym e round _round A[28:28]kc
_LED7Code::
	.byte 'o,40
	.byte 'v,124
	.byte 57,93
	.byte 95,'h
	.byte 127,125
	.byte 123,31
	.byte 'G,62
	.byte 'W,'S
	.dbsym e LED7Code _LED7Code A[16:16]kc
	.area text(rom, con, rel)
	.dbfile C:\Documents and Settings\wsr\桌面\上传例子/zm.h
	.dbfile 160104_S6B0719.c
	.dbfunc e delay_1ms _delay_1ms fV
;              i -> R16,R17
	.even
_delay_1ms::
	.dbline -1
	.dbline 43
; /*液晶160104_S6B0719驱动*/
; /*驱动时序 6800*/
; 
; #include <iom16v.h>
; #include <macros.h>
; #include  "zm.h"
; 
; 
; #define uchar unsigned char
; #define uint  unsigned int
; 
; 
; 
; /*端口定义
;   d7-d0=P 7-P 0
;   E=PD7;
;   R/W=PD6;
;   D/I=PD2;
;   /RESET=PD4;
;   /CS=GND;
; */
; #define LCD_PORT        PORTC
; #define LCD_PORT_DDR    DDRC
; #define LCD_PORT_PIN    PINC
; #define set_E     asm("sbi 0x12,7")// E=pd7
; #define clr_E     asm("cbi 0x12,7")
; //#define set_RW    asm("sbi 0x12,6")// RW=pd6 测试板上已被拉底,与地短接
; //#define clr_RW    asm("cbi 0x12,6")
; #define set_DI    asm("sbi 0x12,2")// DI=pd2
; #define clr_DI    asm("cbi 0x12,2")
; #define set_RESET asm("sbi 0x12,4")// RESET=pd4
; #define clr_RESET asm("cbi 0x12,4")
; #define set_CS    asm("sbi 0x12,3")// cs=pd3
; #define clr_CS    asm("cbi 0x12,3")
; 
; uchar lcd_status;
; uchar lcd_data;
; uchar lcd_currentX;
; uchar lcd_currentY;
; 
; #define xtal 4  
; void delay_1ms(void)
; { unsigned int i;
	.dbline 44
;  for(i=1;i<(unsigned int)(xtal*143-2);i++)
	ldi R16,1
	ldi R17,0
	xjmp L5
L2:
	.dbline 45
L3:
	.dbline 44
	subi R16,255  ; offset = 1
	sbci R17,255
L5:
	.dbline 44
	cpi R16,58
	ldi R30,2
	cpc R17,R30
	brlo L2
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbsym r i 16 i
	.dbend
	.dbfunc e delay_nms _delay_nms fV
;              i -> R20,R21
;              n -> R22,R23
	.even
_delay_nms::
	xcall push_gset2
	movw R22,R16
	.dbline -1
	.dbline 48
;     ;
; }
; void delay_nms(unsigned int n)
; {
	.dbline 49
;  unsigned int i=0;
	clr R20
	clr R21
	xjmp L8
L7:
	.dbline 51
	.dbline 51
	xcall _delay_1ms
	.dbline 52
	subi R20,255  ; offset = 1
	sbci R21,255
	.dbline 53
L8:
	.dbline 50
;    while(i<n)
	cp R20,R22
	cpc R21,R23
	brlo L7
	.dbline -2
L6:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbsym r n 22 i
	.dbend
	.dbfunc e write_comm _write_comm fV
;           comm -> R16
	.even
_write_comm::
	.dbline -1
	.dbline 96
;    {delay_1ms();
;     i++;
;    }
; }
; 
; 
; //uchar asc[4];
; 
; /*void read_status(void)
; {
;    LCD_PORT_DDR = 0x00;
;    LCD_PORT = 0xff;
;    DDRD = 0xff;
;    //clr_E;                                                                                                       
;    
;    clr_DI;
;    set_RW;
;    set_E;
;    //NOP();
;    LCD_status = LCD_PORT_PIN;
;    //NOP();
;    //NOP();
;    clr_E;
;    clr_RW;
;    set_DI;
;    NOP();
; } */ 
; 
; /*void read_data(void)
; {
;    LCD_PORT_DDR = 0x00;
;    DDRD = 0xff;
;    set_DI;
;    set_RW;
;    set_E;
;    NOP();
;    LCD_data = LCD_PORT_PIN;
;    NOP();
;    clr_E;
;    clr_RW;
;    clr_DI;
;    NOP();
; }  */ 
; 
; void write_comm(uchar comm)//6800
; {
	.dbline 97
;    LCD_PORT_DDR = 0xff;
	ldi R24,255
	out 0x14,R24
	.dbline 98
;    DDRD = 0xff;
	out 0x11,R24
	.dbline 99
;    LCD_PORT = comm;
	out 0x15,R16
	.dbline 100
;    clr_DI;
	cbi 0x12,2
	.dbline 101
;    set_E;
	sbi 0x12,7
	.dbline 102
;    NOP();
	nop
	.dbline 103
;    clr_E;
	cbi 0x12,7
	.dbline 104
;    NOP();  
	nop
	.dbline -2
L10:
	.dbline 0 ; func end
	ret
	.dbsym r comm 16 c
	.dbend
	.dbfunc e write_data _write_data fV
;           data -> R16
	.even
_write_data::
	.dbline -1
	.dbline 108
; }
;     
; void write_data(uchar data)
; {
	.dbline 109
;    LCD_PORT_DDR = 0xff;
	ldi R24,255
	out 0x14,R24
	.dbline 110
;    DDRD = 0xff;
	out 0x11,R24
	.dbline 111
;    LCD_PORT = data;
	out 0x15,R16
	.dbline 112
;    set_DI;
	sbi 0x12,2
	.dbline 113
;    set_E;
	sbi 0x12,7
	.dbline 114
;    NOP();
	nop
	.dbline 115
;    clr_E;
	cbi 0x12,7
	.dbline 116
;    NOP();
	nop
	.dbline -2
L11:
	.dbline 0 ; func end
	ret
	.dbsym r data 16 c
	.dbend
	.dbfunc e set_page_add _set_page_add fV
;           page -> R20
	.even
_set_page_add::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 120
; }
; 
; void set_page_add(uchar page)//page =0-13
; {
	.dbline 121
; 	 write_comm( 0xB0|page );
	mov R16,R20
	ori R16,176
	xcall _write_comm
	.dbline -2
L12:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r page 20 c
	.dbend
	.dbfunc e set_column_add _set_column_add fV
;     lsb_column -> R20
;     msb_column -> R22
;         column -> R20
	.even
_set_column_add::
	xcall push_gset2
	mov R20,R16
	.dbline -1
	.dbline 125
; }
; 
; void set_column_add(uchar column)//column =0-159
; {
	.dbline 128
;    uchar msb_column;
;    uchar lsb_column;
;    msb_column = column>>4;
	mov R22,R20
	swap R22
	andi R22,#0x0F
	.dbline 129
;    lsb_column = column&0x0f;
	andi R20,15
	.dbline 130
;    write_comm( 0x10|msb_column );
	mov R16,R22
	ori R16,16
	xcall _write_comm
	.dbline 131
;    write_comm( lsb_column );
	mov R16,R20
	xcall _write_comm
	.dbline -2
L13:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r lsb_column 20 c
	.dbsym r msb_column 22 c
	.dbsym r column 20 c
	.dbend
	.dbfunc e display_on _display_on fV
;             on -> R20
	.even
_display_on::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 135
; }
; 
; void display_on(uchar on)//on=1开显示 on=0关显示
; {
	.dbline 136
;    write_comm( 0xAE|on );
	mov R16,R20
	ori R16,174
	xcall _write_comm
	.dbline -2
L14:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r on 20 c
	.dbend
	.dbfunc e set_init_line _set_init_line fV
;           line -> R20
	.even
_set_init_line::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 140
; }
; 
; void set_init_line(uchar line)
; {
	.dbline 141
;    write_comm( 0x40 );
	ldi R16,64
	xcall _write_comm
	.dbline 142
;    write_comm( line );
	mov R16,R20
	xcall _write_comm
	.dbline -2
L15:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r line 20 c
	.dbend
	.dbfunc e set_com0 _set_com0 fV
;            com -> R20
	.even
_set_com0::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 146
; }
; 
; void set_com0( uchar com )
; {
	.dbline 147
;    write_comm( 0x44 );
	ldi R16,68
	xcall _write_comm
	.dbline 148
;    write_comm( com );
	mov R16,R20
	xcall _write_comm
	.dbline -2
L16:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r com 20 c
	.dbend
	.dbfunc e set_display_duty _set_display_duty fV
;           duty -> R20
	.even
_set_display_duty::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 152
; }
; 
; void set_display_duty(uchar duty)//duty=1/105
; {
	.dbline 153
;    write_comm( 0x48 );
	ldi R16,72
	xcall _write_comm
	.dbline 154
;    write_comm( duty );
	mov R16,R20
	xcall _write_comm
	.dbline -2
L17:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r duty 20 c
	.dbend
	.dbfunc e set_nline_inver _set_nline_inver fV
;              n -> R20
	.even
_set_nline_inver::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 158
; }
; 
; void set_nline_inver( uchar n)
; {
	.dbline 159
;    write_comm( 0x4C );
	ldi R16,76
	xcall _write_comm
	.dbline 160
;    write_comm( n );
	mov R16,R20
	xcall _write_comm
	.dbline -2
L18:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r n 20 c
	.dbend
	.dbfunc e rel_nline_inver _rel_nline_inver fV
	.even
_rel_nline_inver::
	.dbline -1
	.dbline 164
; }	
; 
; void rel_nline_inver( void )
; {
	.dbline 165
;    write_comm( 0xE4 );
	ldi R16,228
	xcall _write_comm
	.dbline -2
L19:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e reve_display_on _reve_display_on fV
;            rev -> R20
	.even
_reve_display_on::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 169
; }
; 
; void reve_display_on(uchar rev)//反显 rev=1开反显 rev=0关反显
; {
	.dbline 170
;    write_comm( 0xA6|rev );
	mov R16,R20
	ori R16,166
	xcall _write_comm
	.dbline -2
L20:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r rev 20 c
	.dbend
	.dbfunc e entir_display_on _entir_display_on fV
;            eon -> R20
	.even
_entir_display_on::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 174
; }
; 
; void entir_display_on(uchar eon)//强制显示 eon=1开强显 eon=0关强显
; {
	.dbline 175
;    write_comm( 0xA4|eon );
	mov R16,R20
	ori R16,164
	xcall _write_comm
	.dbline -2
L21:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r eon 20 c
	.dbend
	.dbfunc e power_control _power_control fV
;        control -> R20
;             vf -> y+6
;             vr -> R10
;             vc -> R22
	.even
_power_control::
	xcall push_gset3
	mov R10,R18
	mov R22,R16
	.dbline -1
	.dbline 179
; }
; 
; void power_control(uchar vc,uchar vr,uchar vf)
; {
	.dbline 180
;    uchar control = 0;
	clr R20
	.dbline 181
;    control |= (vc<<2)|(vr<<1)|vf;
	mov R2,R10
	lsl R2
	mov R3,R22
	lsl R3
	lsl R3
	or R3,R2
	ldd R0,y+6
	or R3,R0
	or R20,R3
	.dbline 182
;    write_comm( 0x28|control);
	mov R16,R20
	ori R16,40
	xcall _write_comm
	.dbline -2
L22:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r control 20 c
	.dbsym l vf 6 c
	.dbsym r vr 10 c
	.dbsym r vc 22 c
	.dbend
	.dbfunc e dc_setup _dc_setup fV
	.even
_dc_setup::
	.dbline -1
	.dbline 187
; }
;    
; 
; void dc_setup()//dc=3
; {
	.dbline 188
; 	 write_comm( 0x67 );
	ldi R16,103
	xcall _write_comm
	.dbline -2
L23:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e resistor_sel _resistor_sel fV
;              r -> R20
	.even
_resistor_sel::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 192
; }
; 
; void resistor_sel(uchar r)//r=0-7,内部电阻设置
; {
	.dbline 193
;    write_comm( 0x20|r );

⌨️ 快捷键说明

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