📄 595_1602_example.lis
字号:
.module _595_1602_Example.c
.area text(rom, con, rel)
0000 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/RD_ATMega8L.h
0000 .dbfunc e PORTDefine _PORTDefine fV
.even
0000 _PORTDefine::
0000 .dbline -1
0000 .dbline 98
0000 ; /********************************************************
0000 ; * 程序说明:串行1602调试程序 *
0000 ; * 版本: v1.0 *
0000 ; * 平台: ATMega8L 8M *
0000 ; * 作者: 傻孩子 *
0000 ; * 日期: 2006年1月11日 *
0000 ; * 修改: 傻孩子 *
0000 ; * 修改日期:2006年2月19日 *
0000 ; * *
0000 ; * [说明] *
0000 ; ********************************************************/
0000 ; # include "RD_ATMega8L.h"
0000 ;
0000 ; /***********************
0000 ; * 系 统 宏 定 义 *
0000 ; ***********************/
0000 ; # pragma interrupt_handler Timer0OvfIsr:10
0000 ; /*---------------------*
0000 ; * SerialToCollateral.h *
0000 ; * 配置宏定义 *
0000 ; *---------------------*/
0000 ; # define VSCK _PC4
0000 ; # define VRCK _PC3
0000 ; # define VSI _PC5
0000 ; /*--- 定义_Use_8Bit_VitualPORT 选择单个595模式 ---*/
0000 ; # define _Use_8Bit_VitualPORT
0000 ; # include "SerialToCollateral.h"
0000 ;
0000 ; /*---------------------*
0000 ; * RD_LCD1602B.h *
0000 ; * 配置宏定义 *
0000 ; *---------------------*/
0000 ; # define LCD_RS PV4
0000 ; # define LCD_E PV5
0000 ; # define LCD_SendHalfCharLow(a) VPORT &= 0xf0;VPORT |= (a & 0x0f);refreshVirtualPORT();
0000 ; # define LCD_SendHalfCharHigh(a) VPORT &= 0xf0;VPORT |= (a >> 4);refreshVirtualPORT();
0000 ; # define SetEnable LCD_E = High;refreshVirtualPORT();
0000 ; # define SetDisable LCD_E = Low;refreshVirtualPORT();
0000 ;
0000 ; /*--- 修改FlashTimeOut来修改显示字符闪烁的频率 ---*/
0000 ; # define FlashTimeOut 800
0000 ; # define RunStringSpeed 11
0000 ; /*--- 定义_Use_LCD1602B_Serial 选择595串行连接模式(否则为直接连接模式) ---*/
0000 ; # define _Use_LCD1602B_Serial
0000 ; # include "RD_LCD1602B.h"
0000 ;
0000 ; /***********************
0000 ; * 全局变量声明区 *
0000 ; ***********************/
0000 ; unsigned int FlashGIFStringCounter = 0;
0000 ; unsigned int FlashTimeCounter = 0;
0000 ;
0000 ; /***********************
0000 ; * 系统函数声明区 *
0000 ; ***********************/
0000 ; void SystemInit(void);
0000 ; void PortInit(void);
0000 ; void Timer0Init(void);
0000 ;
0000 ; /********************************************************
0000 ; * 函数说明:端口初始化 *
0000 ; ********************************************************/
0000 ; void PortInit(void)
0000 ; {
0000 ; DDRC = 0xff;
0000 ; PORTC = 0xff;
0000 ;
0000 ; PORTDefine();
0000 ; }
0000 ;
0000 ; /********************************************************
0000 ; * 函数说明:定时器0初始化函数 *
0000 ; ********************************************************/
0000 ; void Timer0Init(void)
0000 ; {
0000 ; TCCR0 = 0x00; //stop
0000 ; TCNT0 = 0x83; //set count
0000 ; TCCR0 = 0x03; //start timer
0000 ; }
0000 ;
0000 ; /********************************************************
0000 ; * 函数说明:定时器0中断处理函数 *
0000 ; ********************************************************/
0000 ; void Timer0OvfIsr(void)
0000 ; {
0000 ; TCNT0 = 0x83;
0000 ;
0000 ; FlashGIFStringCounter ++;
0000 ; FlashTimeCounter ++;
0000 ;
0000 ; }
0000 ;
0000 ; /********************************************************
0000 ; * 函数说明:系统初始化函数 *
0000 ; ********************************************************/
0000 ; void SystemInit(void)
0000 ; {
0000 ; CLI();
0000 .dbline 100
0000 ;
0000 ; PortInit();
0000 88E3 ldi R24,56
0002 90E0 ldi R25,0
0004 90930B00 sts _PORTB_BIT+1,R25
0008 80930A00 sts _PORTB_BIT,R24
000C .dbline 101
000C ; Timer0Init();
000C 85E3 ldi R24,53
000E 90930900 sts _PORTC_BIT+1,R25
0012 80930800 sts _PORTC_BIT,R24
0016 .dbline 102
0016 ; LCDInit();
0016 82E3 ldi R24,50
0018 90930700 sts _PORTD_BIT+1,R25
001C 80930600 sts _PORTD_BIT,R24
0020 .dbline 104
0020 ;
0020 ; TIMSK = 0x01
0020 87E3 ldi R24,55
0022 90930500 sts _DDRB_BIT+1,R25
0026 80930400 sts _DDRB_BIT,R24
002A .dbline 105
002A ;
002A 84E3 ldi R24,52
002C 90930300 sts _DDRC_BIT+1,R25
0030 80930200 sts _DDRC_BIT,R24
0034 .dbline 106
0034 ; SEI();
0034 81E3 ldi R24,49
0036 90930100 sts _DDRD_BIT+1,R25
003A 80930000 sts _DDRD_BIT,R24
003E .dbline -2
003E L1:
003E .dbline 0 ; func end
003E 0895 ret
0040 .dbend
.area vector(rom, abs)
.org 18
0012 A1C2 rjmp _Timer0OvfIsr
.area text(rom, con, rel)
0040 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/RD_ATMega8L.h
.area data(ram, con, rel)
0000 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/RD_ATMega8L.h
0000 _VPORT::
0000 .blkb 1
.area idata
0000 00 .byte 0
.area data(ram, con, rel)
0001 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/RD_ATMega8L.h
0001 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/SerialToCollateral.h
0001 .dbsym e VPORT _VPORT c
0001 _VPORTBit::
0001 .blkw 1
.area idata
0001 0000 .word _VPORT
.area data(ram, con, rel)
0003 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/SerialToCollateral.h
0003 .dbstruct 0 1 VirtualPORT
0003 .dbfield 0 BIT0 F[0:1]
0003 .dbfield 0 BIT1 F[1:1]
0003 .dbfield 0 BIT2 F[2:1]
0003 .dbfield 0 BIT3 F[3:1]
0003 .dbfield 0 BIT4 F[4:1]
0003 .dbfield 0 BIT5 F[5:1]
0003 .dbfield 0 BIT6 F[6:1]
0003 .dbfield 0 BIT7 F[7:1]
0003 .dbend
0003 .dbsym e VPORTBit _VPORTBit pS[VirtualPORT]
0003 _IfPortChange::
0003 .blkb 1
.area idata
0003 00 .byte 0
.area data(ram, con, rel)
0004 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/SerialToCollateral.h
0004 .dbsym e IfPortChange _IfPortChange c
.area text(rom, con, rel)
0040 .dbfile G:\单片机\源程序\串行1602\595_1602_Example/SerialToCollateral.h
0040 .dbfunc e setBIT _setBIT fc
0040 ; BIT -> R20
.even
0040 _setBIT::
0040 00D0 rcall push_gset1
0042 402F mov R20,R16
0044 .dbline -1
0044 .dbline 153
0044 ; }
0044 ;
0044 ;
0044 ; void main(void)
0044 ; {
0044 ; SystemInit();
0044 ;
0044 ; while(1)
0044 ; {
0044 ; RunString("I really like this game! SWUST Roboteam ",1,1,1,16);
0044 ; Flash("Hello AVR World!",' ',1,2);
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 ; }
0044 .dbline 154
0044 ; }
0044 4830 cpi R20,8
0046 10F0 brlo L3
0048 .dbline 155
0048 ; }
0048 .dbline 156
0048 ; }
0048 0027 clr R16
004A 0DC0 rjmp L2
004C L3:
004C .dbline 159
004C ; }
004C ; }
004C ; }
004C 01E0 ldi R16,1
004E 142F mov R17,R20
0050 00D0 rcall lsl8
0052 20900000 lds R2,_VPORT
0056 202A or R2,R16
0058 20920000 sts _VPORT,R2
005C .dbline 160
005C ; }
005C 81E0 ldi R24,1
005E 80930300 sts _IfPortChange,R24
0062 .dbline 161
0062 ; }
0062 1AD0 rcall _VirtualPORTProccess
0064 .dbline 162
0064 ; }
0064 01E0 ldi R16,1
0066 .dbline -2
0066 L2:
0066 00D0 rcall pop_gset1
0068 .dbline 0 ; func end
0068 0895 ret
006A .dbsym r BIT 20 c
006A .dbend
006A .dbfunc e clearBIT _clearBIT fc
006A ; BIT -> R20
.even
006A _clearBIT::
006A 00D0 rcall push_gset1
006C 402F mov R20,R16
006E .dbline -1
006E .dbline 171
006E ; }
006E ; }
006E ; }
006E ; }
006E ; }
006E ; }
006E ; }
006E ; }
006E ; }
006E .dbline 172
006E ; }
006E 4830 cpi R20,8
0070 10F0 brlo L6
0072 .dbline 173
0072 ; }
0072 .dbline 174
0072 ; }
0072 0027 clr R16
0074 0FC0 rjmp L5
0076 L6:
0076 .dbline 177
0076 ; }
0076 ; }
0076 ; }
0076 01E0 ldi R16,1
0078 142F mov R17,R20
007A 00D0 rcall lsl8
007C 202E mov R2,R16
007E 2094 com R2
0080 30900000 lds R3,_VPORT
0084 3220 and R3,R2
0086 30920000 sts _VPORT,R3
008A .dbline 178
008A ; }
008A 81E0 ldi R24,1
008C 80930300 sts _IfPortChange,R24
0090 .dbline 179
0090 ; }
0090 03D0 rcall _VirtualPORTProccess
0092 .dbline 180
0092 ; }
0092 01E0 ldi R16,1
0094 .dbline -2
0094 L5:
0094 00D0 rcall pop_gset1
0096 .dbline 0 ; func end
0096 0895 ret
0098 .dbsym r BIT 20 c
0098 .dbend
0098 .dbfunc e VirtualPORTProccess _VirtualPORTProccess fV
.even
0098 _VirtualPORTProccess::
0098 .dbline -1
0098 .dbline 187
0098 .dbline 188
0098 20900300 lds R2,_IfPortChange
009C 2220 tst R2
009E 21F0 breq L9
00A0 .dbline 189
00A0 .dbline 190
00A0 04D0 rcall _refreshVirtualPORT
00A2 .dbline 191
00A2 2224 clr R2
00A4 20920300 sts _IfPortChange,R2
00A8 .dbline 192
00A8 L9:
00A8 .dbline -2
00A8 L8:
00A8 .dbline 0 ; func end
00A8 0895 ret
00AA .dbend
00AA .dbfunc e refreshVirtualPORT _refreshVirtualPORT fV
00AA ; TempData -> R20
00AA ; n -> R22
.even
00AA _refreshVirtualPORT::
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -