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

📄 remote.lis

📁 硬盘MP3播放器-MEGA128-VS1001K-USB-遥控-LCD-ICCAVR代码-硬盘-支持FAT32-单面PCB 第二部分
💻 LIS
📖 第 1 页 / 共 5 页
字号:
                        .module remote.c
                        .area data(ram, con, rel)
 0000           _TimeOut::
 0000                   .blkb 2
                        .area idata
 0000 0000              .word 0
                        .area data(ram, con, rel)
 0002                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0002                   .dbsym e TimeOut _TimeOut i
 0002           _Key::
 0002                   .blkb 1
                        .area idata
 0002 00                .byte 0
                        .area data(ram, con, rel)
 0003                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0003                   .dbsym e Key _Key c
 0003           _LinePtr::
 0003                   .blkb 1
                        .area idata
 0003 00                .byte 0
                        .area data(ram, con, rel)
 0004                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0004                   .dbsym e LinePtr _LinePtr C
 0004           _ListType::
 0004                   .blkb 1
                        .area idata
 0004 00                .byte 0
                        .area data(ram, con, rel)
 0005                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0005                   .dbsym e ListType _ListType c
 0005           _NewMessage::
 0005                   .blkb 1
                        .area idata
 0005 00                .byte 0
                        .area data(ram, con, rel)
 0006                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0006                   .dbsym e NewMessage _NewMessage c
 0006           _Refresh::
 0006                   .blkb 1
                        .area idata
 0006 00                .byte 0
                        .area data(ram, con, rel)
 0007                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0007                   .dbsym e Refresh _Refresh c
 0007           _Light::
 0007                   .blkb 2
                        .area idata
 0007 0000              .word 0
                        .area data(ram, con, rel)
 0009                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0009                   .dbsym e Light _Light i
 0009           _Cont::
 0009                   .blkb 1
                        .area idata
 0009 19                .byte 25
                        .area data(ram, con, rel)
 000A                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 000A                   .dbsym e Cont _Cont c
                        .area text(rom, con, rel)
 0000                   .dbfile C:\DATA\MP3\Remote\Code\remote.c
 0000                   .dbfunc e main _main fV
                        .even
 0000           _main::
 0000 2297              sbiw R28,2
 0002                   .dbline -1
 0002                   .dbline 35
 0002           ; // Check Remote hardware version in Remote.h
 0002           ; 
 0002           ; #include <iom8v.h>
 0002           ; #include <macros.h>
 0002           ; #include <string.h>
 0002           ; #include <stdio.h>
 0002           ; #include "NokiaLCD.h"
 0002           ; #include "remote.h"
 0002           ; #include "eeprom.h"
 0002           ; 
 0002           ; //#define NOTIMEOUT
 0002           ; 
 0002           ; //******************************************************************
 0002           ; //*   MAIN Global Variable
 0002           ; //******************************************************************
 0002           ; unsigned int TimeOut = 0;
 0002           ; unsigned char Key = NONE;
 0002           ; char Line[5][MAXLEN];
 0002           ; unsigned char RxData[MAXLEN*2];
 0002           ; signed char LinePtr = 0;
 0002           ; unsigned char ListType = SONG;
 0002           ; unsigned char NewMessage = FALSE;
 0002           ; unsigned char Refresh = FALSE;
 0002           ; unsigned int Light = 0; 
 0002           ; unsigned char Cont = 25;
 0002           ; 
 0002           ; unsigned char UpdateLcd;
 0002           ; 
 0002           ; 
 0002           ; unsigned char buffer[10];
 0002           ; //*************************************
 0002           ; // void main(void)
 0002           ; //*************************************
 0002           ; void main(void)
 0002           ; {
 0002                   .dbline 41
 0002           ; // PortB is setup by LcdInit() 
 0002           ; // PB1 is share for LCD and 38khz oscilator
 0002           ; // PB6..7 is for external Xtal
 0002           ; 
 0002           ; // PortC is for KeyPad and set as input
 0002           ; DDRC = 0x00;        // PC as input
 0002 2224              clr R2
 0004 24BA              out 0x14,R2
 0006                   .dbline 42
 0006           ; PORTC = 0xff;       // Pull up on PC pin      
 0006 8FEF              ldi R24,255
 0008 85BB              out 0x15,R24
 000A                   .dbline 45
 000A           ; 
 000A           ; // PortD is for Serial TX&RX, and Int0 input
 000A           ; DDRD = 0x18;        // All input exept PD4 output VRX, PD3 output LIGHT
 000A 88E1              ldi R24,24
 000C 81BB              out 0x11,R24
 000E                   .dbline 46
 000E           ; PORTD = 0xe4;       // Pull up on all PD exept TX & RX & LIGHT
 000E 84EE              ldi R24,228
 0010 82BB              out 0x12,R24
 0012                   .dbline 49
 0012           ; 
 0012           ; // Int0 is for Keypress interrupt done via diode on each key 
 0012           ; MCUCR = 0x02;       // int0 on falling eage level
 0012 82E0              ldi R24,2
 0014 85BF              out 0x35,R24
 0016                   .dbline 50
 0016           ; GICR = 0x40;        // int0 enable
 0016 80E4              ldi R24,64
 0018 8BBF              out 0x3b,R24
 001A                   .dbline 53
 001A           ; 
 001A           ; // Timer 0
 001A           ; TCCR0 = 0x04;       // Timer1 / 256
 001A 84E0              ldi R24,4
 001C 83BF              out 0x33,R24
 001E                   .dbline 56
 001E           ; 
 001E           ; // Timer 1
 001E           ; TCCR1B = 0x09;                // Timer 1 prescaler at /1
 001E 89E0              ldi R24,9
 0020 8EBD              out 0x2e,R24
 0022                   .dbline 57
 0022           ; OCR1A  = 0x17;                // for 38khz
 0022 87E1              ldi R24,23
 0024 90E0              ldi R25,0
 0026 9BBD              out 0x2b,R25
 0028 8ABD              out 0x2a,R24
 002A                   .dbline 60
 002A           ; 
 002A           ; // Serial
 002A           ; UCSRA = 0x00;                 // Clear flags, single speed, No multi processor
 002A 2BB8              out 0xb,R2
 002C                   .dbline 61
 002C           ; UCSRC = 0x8e;                 // Asynch, No parity, 2 stopbit, 8bit
 002C 8EE8              ldi R24,142
 002E 80BD              out 0x20,R24
 0030                   .dbline 62
 0030           ; UBRRL = 47;                   // 2400bps at 1.8432Mhz
 0030 8FE2              ldi R24,47
 0032 89B9              out 0x9,R24
 0034                   .dbline 63
 0034           ; UBRRH = 0x00;  
 0034 20BC              out 0x20,R2
 0036                   .dbline 64
 0036           ; UCSRB = 0x98;                 // RX & TX Enable
 0036 88E9              ldi R24,152
 0038 8AB9              out 0xa,R24
 003A                   .dbline 66
 003A           ; 
 003A           ; Line[0][0] = 0x00;
 003A 20926D00          sts _Line,R2
 003E                   .dbline 67
 003E           ; Line[1][0] = 0x00;
 003E 20929500          sts _Line+40,R2
 0042                   .dbline 68
 0042           ; Line[2][0] = 0x00;
 0042 2092BD00          sts _Line+80,R2
 0046                   .dbline 69
 0046           ; Line[3][0] = 0x00;
 0046 2092E500          sts _Line+120,R2
 004A                   .dbline 70
 004A           ; Line[4][0] = 0x00;
 004A 20920D01          sts _Line+160,R2
 004E                   .dbline 72
 004E           ; 
 004E           ; TIMSK = 0x01;       // Timer0 overflow interrupt enable
 004E 81E0              ldi R24,1
 0050 89BF              out 0x39,R24
 0052                   .dbline 74
 0052           ; 
 0052           ; LcdInit();
 0052 00D0              rcall _LcdInit
 0054                   .dbline 75
 0054           ; EEPROM_READ(0x10, Cont);      
 0054 81E0              ldi R24,1
 0056 90E0              ldi R25,0
 0058 9983              std y+1,R25
 005A 8883              std y+0,R24
 005C 20E0              ldi R18,<_Cont
 005E 30E0              ldi R19,>_Cont
 0060 00E1              ldi R16,16
 0062 10E0              ldi R17,0
 0064 00D0              rcall _EEPROMReadBytes
 0066                   .dbline 76
 0066           ; LcdContrast(Cont);
 0066 00910900          lds R16,_Cont
 006A 00D0              rcall _LcdContrast
 006C                   .dbline 77
 006C           ; Presentation();
 006C D0D0              rcall _Presentation
 006E                   .dbline 78
 006E           ; LineDisplay();
 006E 04D1              rcall _LineDisplay
 0070                   .dbline 79
 0070           ; SEI();
 0070 7894              sei
 0072                   .dbline 81
 0072           ; 
 0072           ; PORTD |= VRX;
 0072 949A              sbi 0x12,4
 0074 BAC0              rjmp L10
 0076           L9:
 0076                   .dbline 84
 0076           ; 
 0076           ; while(1)
 0076           ;               {
 0076                   .dbline 85
 0076           ;               _StackCheck();
 0076 00D0              rcall __StackCheck
 0078                   .dbline 87
 0078           ; 
 0078           ;               if (TimeOut <= 10000)
 0078 80E1              ldi R24,10000
 007A 97E2              ldi R25,39
 007C 20900000          lds R2,_TimeOut
 0080 30900100          lds R3,_TimeOut+1
 0084 8215              cp R24,R2
 0086 9305              cpc R25,R3
 0088 08F4              brsh X1
 008A 92C0              rjmp L12
 008C           X1:
 008C                   .dbline 88
 008C           ;                  {
 008C                   .dbline 89
 008C           ;                  if (NewMessage == TRUE)
 008C 80910500          lds R24,_NewMessage
 0090 8130              cpi R24,1
 0092 31F4              brne L14
 0094                   .dbline 90
 0094           ;                         {
 0094                   .dbline 91
 0094           ;                         CLI();
 0094 F894              cli
 0096                   .dbline 92
 0096           ;                         AnalyseData();
 0096 D6D2              rcall _AnalyseData
 0098                   .dbline 93
 0098           ;                         NewMessage = FALSE;
 0098 2224              clr R2
 009A 20920500          sts _NewMessage,R2
 009E                   .dbline 94
 009E           ;                         SEI();
 009E 7894              sei
 00A0                   .dbline 95
 00A0           ;                         }
 00A0           L14:
 00A0                   .dbline 97
 00A0           ;  
 00A0           ;                  if (Light > 1000) 
 00A0 88EE              ldi R24,1000
 00A2 93E0              ldi R25,3
 00A4 20900700          lds R2,_Light
 00A8 30900800          lds R3,_Light+1
 00AC 8215              cp R24,R2
 00AE 9305              cpc R25,R3
 00B0 30F4              brsh L16
 00B2                   .dbline 98
 00B2           ;                         {
 00B2                   .dbline 99
 00B2           ;                         PORTD &= ~LIGHT;
 00B2 9398              cbi 0x12,3
 00B4                   .dbline 100
 00B4           ;                         Light = 1001;
 00B4 89EE              ldi R24,233
 00B6 90930800          sts _Light+1,R25
 00BA 80930700          sts _Light,R24
 00BE                   .dbline 101
 00BE           ;                         }
 00BE           L16:
 00BE                   .dbline 103
 00BE           ; 
 00BE           ;                  if (Key != NONE)
 00BE 20900200          lds R2,_Key
 00C2 2220              tst R2
 00C4 09F4              brne X2
 00C6 91C0              rjmp L13
 00C8           X2:
 00C8                   .dbline 104
 00C8           ;                         {
 00C8                   .dbline 105
 00C8           ;                         TimeOut = 0;
 00C8 2224              clr R2
 00CA 3324              clr R3
 00CC 30920100          sts _TimeOut+1,R3
 00D0 20920000          sts _TimeOut,R2
 00D4                   .dbline 106
 00D4           ;                         Light = 0;
 00D4 30920800          sts _Light+1,R3
 00D8 20920700          sts _Light,R2
 00DC                   .dbline 107
 00DC           ;                         PORTD |= LIGHT;
 00DC 939A              sbi 0x12,3
 00DE                   .dbline 109
 00DE           ;                         
 00DE           ;                         if (Key == RESET) 
 00DE 80910200          lds R24,_Key
 00E2 8632              cpi R24,38
 00E4 31F4              brne L20
 00E6                   .dbline 110
 00E6           ;                                {
 00E6                   .dbline 111
 00E6           ;                                CLI();
 00E6 F894              cli
 00E8                   .dbline 112
 00E8           ;                                TIMSK = 0x00;
 00E8 29BE              out 0x39,R2
 00EA                   .dbline 113
 00EA           ;                                UCSRB = 0x18;                  // RX & TX Enable
 00EA 88E1              ldi R24,24
 00EC 8AB9              out 0xa,R24
 00EE                   .dbline 114
 00EE           ;                                asm("jmp 0x0000");
 00EE 0C940000          jmp 0x0000

⌨️ 快捷键说明

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