📄 1602test.lis
字号:
.module _1602test.c
.area data(ram, con, rel)
0000 _str1::
0000 .blkb 17
.area idata
0000 4E4F313A20202020204E4F323A202020 .byte 'N,'O,49,58,32,32,32,32,32,'N,'O,50,58,32,32,32
0010 00 .byte 0
.area data(ram, con, rel)
0011 .dbfile D:\医疗电子采样板\1602test\1602test.c
0011 .dbsym e str1 _str1 A[17:17]c
0011 _str2::
0011 .blkb 17
.area idata
0011 4E4F333A20202020204E4F343A202020 .byte 'N,'O,51,58,32,32,32,32,32,'N,'O,52,58,32,32,32
0021 00 .byte 0
.area data(ram, con, rel)
0022 .dbfile D:\医疗电子采样板\1602test\1602test.c
0022 .dbsym e str2 _str2 A[17:17]c
.area lit(rom, con, rel)
0000 _t_per::
0000 9999 .byte 153,153
0002 9999 .byte 153,153
0004 9999 .byte 153,153
0006 9999 .byte 153,153
0008 9999 .byte 153,153
000A 9999 .byte 153,153
000C 9999 .byte 153,153
000E 9897 .byte 152,151
0010 9695 .byte 150,149
0012 9493 .byte 148,147
0014 9290 .byte 146,144
0016 8988 .byte 137,136
0018 8685 .byte 134,133
001A 8483 .byte 132,131
001C 8281 .byte 130,129
001E 8078 .byte 128,'x
0020 7776 .byte 'w,'v
0022 7574 .byte 'u,'t
0024 7372 .byte 's,'r
0026 7170 .byte 'q,'p
0028 7069 .byte 'p,'i
002A 6867 .byte 'h,'g
002C 6665 .byte 'f,'e
002E 6463 .byte 'd,'c
0030 6261 .byte 'b,'a
0032 6059 .byte 96,'Y
0034 5858 .byte 'X,'X
0036 5757 .byte 'W,'W
0038 5656 .byte 'V,'V
003A 5555 .byte 'U,'U
003C 5453 .byte 'T,'S
003E 5352 .byte 'S,'R
0040 5150 .byte 'Q,'P
0042 5049 .byte 'P,'I
0044 4948 .byte 'I,'H
0046 4848 .byte 'H,'H
0048 4747 .byte 'G,'G
004A 4646 .byte 'F,'F
004C 4545 .byte 'E,'E
004E 4444 .byte 'D,'D
0050 4443 .byte 'D,'C
0052 4343 .byte 'C,'C
0054 4242 .byte 'B,'B
0056 4141 .byte 'A,'A
0058 4040 .byte 64,64
005A 4039 .byte 64,57
005C 3938 .byte 57,56
005E 3837 .byte 56,55
0060 3737 .byte 55,55
0062 3636 .byte 54,54
0064 3535 .byte 53,53
0066 3534 .byte 53,52
0068 3433 .byte 52,51
006A 3333 .byte 51,51
006C 3232 .byte 50,50
006E 3231 .byte 50,49
0070 3130 .byte 49,48
0072 3030 .byte 48,48
0074 2929 .byte 41,41
0076 2828 .byte 40,40
0078 2727 .byte 39,39
007A 2727 .byte 39,39
007C 2626 .byte 38,38
007E 2625 .byte 38,37
0080 2524 .byte 37,36
0082 2424 .byte 36,36
0084 2323 .byte 35,35
0086 2322 .byte 35,34
0088 2222 .byte 34,34
008A 2121 .byte 33,33
008C 2120 .byte 33,32
008E 2020 .byte 32,32
0090 1919 .byte 25,25
0092 1918 .byte 25,24
0094 1818 .byte 24,24
0096 1717 .byte 23,23
0098 1616 .byte 22,22
009A 1615 .byte 22,21
009C 1515 .byte 21,21
009E 1414 .byte 20,20
00A0 1413 .byte 20,19
00A2 1313 .byte 19,19
00A4 1212 .byte 18,18
00A6 1211 .byte 18,17
00A8 1111 .byte 17,17
00AA 1010 .byte 16,16
00AC 0909 .byte 9,9
00AE 0908 .byte 9,8
00B0 0807 .byte 8,7
00B2 0706 .byte 7,6
00B4 0606 .byte 6,6
00B6 0505 .byte 5,5
00B8 0504 .byte 5,4
00BA 0403 .byte 4,3
00BC 0302 .byte 3,2
00BE 0201 .byte 2,1
00C0 0100 .byte 1,0
00C2 0000 .byte 0,0
00C4 0001 .byte 0,1
00C6 0102 .byte 1,2
00C8 0203 .byte 2,3
00CA 0304 .byte 3,4
00CC 0403 .byte 4,3
00CE 0505 .byte 5,5
00D0 0506 .byte 5,6
00D2 0708 .byte 7,8
00D4 0909 .byte 9,9
00D6 1010 .byte 16,16
00D8 1111 .byte 17,17
00DA 1212 .byte 18,18
00DC 1313 .byte 19,19
00DE 1414 .byte 20,20
00E0 1515 .byte 21,21
00E2 1616 .byte 22,22
00E4 1717 .byte 23,23
00E6 1818 .byte 24,24
00E8 1920 .byte 25,32
00EA 2122 .byte 33,34
00EC 2324 .byte 35,36
00EE 2526 .byte 37,38
00F0 2728 .byte 39,40
00F2 2930 .byte 41,48
00F4 3132 .byte 49,50
00F6 3334 .byte 51,52
00F8 3536 .byte 53,54
00FA 3738 .byte 55,56
00FC 3940 .byte 57,64
00FE 50 .byte 'P
00FF .dbsym e t_per _t_per A[255:255]kc
.area text(rom, con, rel)
0000 .dbfile D:\医疗电子采样板\1602test\1602test.c
0000 .dbfunc e main _main fV
.even
0000 _main::
0000 .dbline -1
0000 .dbline 80
0000 ; //ICC-AVR application builder : 2006-11-14 10:39:01
0000 ; // Target : M16
0000 ; // Crystal: 4.0000Mhz
0000 ;
0000 ; #include <iom16v.h>
0000 ; #include <macros.h>
0000 ; #define vfd_data_port PORTB
0000 ; #define vfd_data_ddr DDRB
0000 ; #define vfd_busy_pin PINB
0000 ; #define vfd_busy_ddr DDRB
0000 ; #define vfd_control_port PORTD
0000 ; #define vfd_control_ddr DDRD
0000 ; #define vfd_RS 0x20 //PORTD^5
0000 ; #define vfd_EN 0x40 //PORTD^6
0000 ; #define vfd_RW 0x80 //PORTD^7
0000 ; //#define vfd_RW 0x40 //PORTD^1
0000 ; //#define vfd_EN 0x80 //PORTD^2
0000 ; #define busy 0x80 //VFD_DB7
0000 ; struct sem
0000 ; {
0000 ; unsigned int ad_samp; //a/d sampling data
0000 ; unsigned int pc_trans; //pc transfer to chip
0000 ; unsigned char class_addr[4]; //data addr
0000 ; unsigned char class_data[7]; //asc ii code from pc to chip or chip to pc
0000 ; }dypass[9];
0000 ; unsigned char adc_mux,i;
0000 ; unsigned int adc_rel,adc_old,sin;
0000 ; unsigned char adc_meas[20];
0000 ; unsigned char hex_meas[5];
0000 ; unsigned char rece_coun;
0000 ; unsigned char meas_coun;
0000 ; unsigned char *point;
0000 ; unsigned char channel;//sampling channel
0000 ; /*----------------------------------函数声明------------------------------------------*/
0000 ; void vfd_init(void);
0000 ; void vfd_write_command(unsigned char command,unsigned char wait_en);
0000 ; void vfd_write_data(unsigned char char_data);
0000 ; void wait_enable(void);
0000 ; void display_a_char(unsigned char position,unsigned char char_data);
0000 ; void d_a_s(unsigned char col,unsigned char *ptr);
0000 ; void display_a_ch_r(unsigned char position,unsigned char char_data);
0000 ; void delay_1ms(void);
0000 ; void delay_nms(unsigned int n);
0000 ; void adc_init(void);
0000 ; void filter(unsigned char maj);
0000 ; void hex_asc(unsigned int dt_meas,unsigned char *g);
0000 ; //显示的两行字符
0000 ; unsigned char str1[]="NO1: NO2: ";
0000 ; unsigned char str2[]="NO3: NO4: ";
0000 ; const unsigned char t_per[255]={
0000 ; 0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,//0~9
0000 ; 0x99,0x99,0x99,0x99,0x98,0x97,0x96,0x95,0x94,0x93,//10~19
0000 ; 0x92,0x90,0x89,0x88,0x86,0x85,0x84,0x83,0x82,0x81,//20~29
0000 ; 0x80,0x78,0x77,0x76,0x75,0x74,0x73,0x72,0x71,0x70,//30~39
0000 ; 0x70,0x69,0x68,0x67,0x66,0x65,0x64,0x63,0x62,0x61,//40~49
0000 ; 0x60,0x59,0x58,0x58,0x57,0x57,0x56,0x56,0x55,0x55,//50~59
0000 ; 0x54,0x53,0x53,0x52,0x51,0x50,0x50,0x49,0x49,0x48,//60~69
0000 ; 0x48,0x48,0x47,0x47,0x46,0x46,0x45,0x45,0x44,0x44,//70~79
0000 ; 0x44,0x43,0x43,0x43,0x42,0x42,0x41,0x41,0x40,0x40,//80~89
0000 ; 0x40,0x39,0x39,0x38,0x38,0x37,0x37,0x37,0x36,0x36,//90~99
0000 ; 0x35,0x35,0x35,0x34,0x34,0x33,0x33,0x33,0x32,0x32,//100~109
0000 ; 0x32,0x31,0x31,0x30,0x30,0x30,0x29,0x29,0x28,0x28,//110~119
0000 ; 0x27,0x27,0x27,0x27,0x26,0x26,0x26,0x25,0x25,0x24,//120~129
0000 ; 0x24,0x24,0x23,0x23,0x23,0x22,0x22,0x22,0x21,0x21,//130~139
0000 ; 0x21,0x20,0x20,0x20,0x19,0x19,0x19,0x18,0x18,0x18,//140~149
0000 ; 0x17,0x17,0x16,0x16,0x16,0x15,0x15,0x15,0x14,0x14,//150~159
0000 ; 0x14,0x13,0x13,0x13,0x12,0x12,0x12,0x11,0x11,0x11,//160~169
0000 ; 0x10,0x10,0x9,0x9,0x9,0x8,0x8,0x7,0x7,0x6,//170~179
0000 ; 0x6,0x6,0x5,0x5,0x5,0x4,0x4,0x3,0x3,0x2,//180~189
0000 ; 0x2,0x1,0x1,0x0,0x0,0x0,0x0,0x1,0x1,0x2,//190~199
0000 ; 0x2,0x3,0x3,0x4,0x4,0x3,0x5,0x5,0x5,0x6,//200~209
0000 ; 0x7,0x8,0x9,0x9,0x10,0x10,0x11,0x11,0x12,0x12,//210~219
0000 ; 0x13,0x13,0x14,0x14,0x15,0x15,0x16,0x16,0x17,0x17,//220~229
0000 ; 0x18,0x18,0x19,0x20,0x21,0x22,0x23,0x24,0x25,0x26,//230~239
0000 ; 0x27,0x28,0x29,0x30,0x31,0x32,0x33,0x34,0x35,0x36,//240~249
0000 ; 0x37,0x38,0x39,0x40,0x50,};//250~254
0000 ; /*------------------------------------主函数-------------------------------------------*/
0000 ; //在VFD上显示hello和www.xmbyte.com两行字符
0000 ; void main(void)
0000 ; {
0000 .dbline 81
0000 ; adc_init();
0000 F9D0 xcall _adc_init
0002 .dbline 82
0002 ; vfd_data_port=0xff;
0002 8FEF ldi R24,255
0004 88BB out 0x18,R24
0006 .dbline 83
0006 ; vfd_data_ddr=0xff;
0006 87BB out 0x17,R24
0008 .dbline 84
0008 ; vfd_control_port=0xF0;
0008 80EF ldi R24,240
000A 82BB out 0x12,R24
000C .dbline 85
000C ; vfd_control_ddr=0xF0;
000C 81BB out 0x11,R24
000E .dbline 86
000E ; DDRC = 0xFF;
000E 8FEF ldi R24,255
0010 84BB out 0x14,R24
0012 .dbline 87
0012 ; PORTC = 0xff; //m103 output only
0012 85BB out 0x15,R24
0014 .dbline 89
0014 ;
0014 ; vfd_init();
0014 C6D1 xcall _vfd_init
0016 ECC0 xjmp L3
0018 L2:
0018 .dbline 93
0018 ; //d_a_s(0,str1);
0018 ; //d_a_s(1,str2);
0018 ; while(1)
0018 ; {
0018 .dbline 94
0018 ; PORTC=0XFF;
0018 8FEF ldi R24,255
001A 85BB out 0x15,R24
001C .dbline 95
001C ; vfd_write_command(0xf,1);
001C 21E0 ldi R18,1
001E 0FE0 ldi R16,15
0020 E4D1 xcall _vfd_write_command
0022 .dbline 96
0022 ; vfd_write_command(0x6,1);
0022 21E0 ldi R18,1
0024 06E0 ldi R16,6
0026 E1D1 xcall _vfd_write_command
0028 .dbline 97
0028 ; d_a_s(0,str1);
0028 20E0 ldi R18,<_str1
002A 30E0 ldi R19,>_str1
002C 0027 clr R16
002E 1AD2 xcall _d_a_s
0030 .dbline 100
0030 ;
0030 ; //A/D 采样四个通道
0030 ; filter(0);
0030 0027 clr R16
0032 3FD1 xcall _filter
0034 .dbline 101
0034 ; filter(1);
0034 01E0 ldi R16,1
0036 3DD1 xcall _filter
0038 .dbline 102
0038 ; filter(2);
0038 02E0 ldi R16,2
003A 3BD1 xcall _filter
003C .dbline 103
003C ; filter(3);
003C 03E0 ldi R16,3
003E 39D1 xcall _filter
0040 .dbline 104
0040 ; sin=4;
0040 84E0 ldi R24,4
0042 90E0 ldi R25,0
0044 90931F00 sts _sin+1,R25
0048 80931E00 sts _sin,R24
004C .dbline 105
004C ; for(i=2;i<=3;i++)
004C 82E0 ldi R24,2
004E 80932400 sts _i,R24
0052 1FC0 xjmp L8
0054 L5:
0054 .dbline 106
0054 .dbline 107
0054 80E0 ldi R24,<_dypass+8
0056 90E0 ldi R25,>_dypass+8
0058 E0912400 lds R30,_i
005C FF27 clr R31
005E E80F add R30,R24
0060 F91F adc R31,R25
0062 2080 ldd R2,z+0
0064 80E0 ldi R24,<_str1
0066 90E0 ldi R25,>_str1
0068 E0911E00 lds R30,_sin
006C F0911F00 lds R31,_sin+1
0070 E80F add R30,R24
0072 F91F adc R31,R25
0074 2082 std z+0,R2
0076 .dbline 108
0076 80911E00 lds R24,_sin
007A 90911F00 lds R25,_sin+1
007E 0196 adiw R24,1
0080 90931F00 sts _sin+1,R25
0084 80931E00 sts _sin,R24
0088 .dbline 109
0088 L6:
0088 .dbline 105
0088 80912400 lds R24,_i
008C 8F5F subi R24,255 ; addi 1
008E 80932400 sts _i,R24
0092 L8:
0092 .dbline 105
0092 83E0 ldi R24,3
0094 20902400 lds R2,_i
0098 8215 cp R24,R2
009A E0F6 brsh L5
009C .dbline 110
009C ; {
009C ; str1[sin]=dypass[0].class_data[i];
009C ; sin++;
009C ; }
009C ; str1[6]=0x1a;
009C 8AE1 ldi R24,26
009E 80930600 sts _str1+6,R24
00A2 .dbline 111
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -