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

📄 cm320240.lst

📁 CM320240程序
💻 LST
字号:
__text_start:
__start:
    0046 EFCF      LDI	R28,0xFF
    0047 E1D0      LDI	R29,0x10
    0048 BFCD      OUT	0x3D,R28
    0049 BFDE      OUT	0x3E,R29
    004A 51C0      SUBI	R28,0x10
    004B 40D0      SBCI	R29,0
    004C EA0A      LDI	R16,0xAA
    004D 8308      STD	Y+0,R16
    004E 2400      CLR	R0
    004F E0E0      LDI	R30,0
    0050 E0F1      LDI	R31,1
    0051 E011      LDI	R17,1
    0052 30E0      CPI	R30,0
    0053 07F1      CPC	R31,R17
    0054 F011      BEQ	0x0057
    0055 9201      ST	R0,Z+
    0056 CFFB      RJMP	0x0052
    0057 8300      STD	Z+0,R16
    0058 E8EC      LDI	R30,0x8C
    0059 E0F0      LDI	R31,0
    005A E0A0      LDI	R26,0
    005B E0B1      LDI	R27,1
    005C E010      LDI	R17,0
    005D 38EC      CPI	R30,0x8C
    005E 07F1      CPC	R31,R17
    005F F021      BEQ	0x0064
    0060 95C8      LPM
    0061 9631      ADIW	R30,1
    0062 920D      ST	R0,X+
    0063 CFF9      RJMP	0x005D
    0064 940E0098  CALL	_main
_exit:
    0066 CFFF      RJMP	_exit
FILE: E:\SoftDevelop\C\AVR\CM320240\cm320240.C
(0001) //ICC-AVR application builder : 2008-3-11 14:38:57
(0002) // Target : M128
(0003) // Crystal: 8.0000Mhz
(0004) // CM320240-7 EricYY
(0005) 
(0006) #include <iom128v.h>
(0007) #include <macros.h>
(0008) 
(0009) //
(0010) #define data PORTA
(0011) #define lcd_busy PORTB0
(0012) #define lcd_int PORTB1
(0013) #define lcd_cs1 PORTB2
(0014) #define lcd_cs2 PORTB3
(0015) #define lcd_rs PORTB4
(0016) #define lcd_en PORTB5
(0017) #define lcd_rst PORTB6
(0018) 
(0019) 
(0020) 
(0021) void port_init(void)
(0022) {
(0023)  PORTA = 0x00;
_port_init:
    0067 2422      CLR	R2
    0068 BA2B      OUT	0x1B,R2
(0024)  DDRA  = 0xFF;
    0069 EF8F      LDI	R24,0xFF
    006A BB8A      OUT	0x1A,R24
(0025)  PORTB = 0x00;
    006B BA28      OUT	0x18,R2
(0026)  DDRB  = 0xFF;
    006C BB87      OUT	0x17,R24
(0027)  PORTC = 0x00; //m103 output only
    006D BA25      OUT	0x15,R2
(0028)  DDRC  = 0x00;
    006E BA24      OUT	0x14,R2
(0029)  PORTD = 0x00;
    006F BA22      OUT	0x12,R2
(0030)  DDRD  = 0x00;
    0070 BA21      OUT	0x11,R2
(0031)  PORTE = 0x00;
    0071 B823      OUT	0x03,R2
(0032)  DDRE  = 0x00;
    0072 B822      OUT	0x02,R2
(0033)  PORTF = 0x00;
    0073 92200062  STS	0x62,R2
(0034)  DDRF  = 0x00;
    0075 92200061  STS	0x61,R2
(0035)  PORTG = 0x00;
    0077 92200065  STS	0x65,R2
(0036)  DDRG  = 0x00;
    0079 92200064  STS	0x64,R2
    007B 9508      RET
(0037) }
(0038) 
(0039) //call this routine to initialize all peripherals
(0040) void init_devices(void)
(0041) {
(0042)  //stop errant interrupts until set up
(0043)  CLI(); //disable all interrupts
_init_devices:
    007C 94F8      BCLR	7
(0044)  XDIV  = 0x00; //xtal divider
    007D 2422      CLR	R2
    007E BE2C      OUT	0x3C,R2
(0045)  XMCRA = 0x00; //external memory
    007F 9220006D  STS	0x6D,R2
(0046)  port_init();
    0081 DFE5      RCALL	_port_init
(0047) 
(0048)  MCUCR = 0x00;
    0082 2422      CLR	R2
    0083 BE25      OUT	0x35,R2
(0049)  EICRA = 0x00; //extended ext ints
    0084 9220006A  STS	0x6A,R2
(0050)  EICRB = 0x00; //extended ext ints
    0086 BE2A      OUT	0x3A,R2
(0051)  EIMSK = 0x00;
    0087 BE29      OUT	0x39,R2
(0052)  TIMSK = 0x00; //time interrupt sources
    0088 BE27      OUT	0x37,R2
(0053)  ETIMSK = 0x00; //extended timer interrupt sources
    0089 9220007D  STS	0x7D,R2
(0054)  SEI(); //re-enable interrupts
    008B 9478      BSET	7
    008C 9508      RET
(0055)  //all peripherals are now initialized
(0056) }
(0057) 
(0058) //delay 1ms
(0059) void delay_1ms(void)
(0060) {
(0061)  unsigned int i;
(0062)  for(i=1;i<(unsigned int)(8*143-2);i++)
_delay_1ms:
  i                    --> R16
    008D E001      LDI	R16,1
    008E E010      LDI	R17,0
    008F C002      RJMP	0x0092
    0090 5F0F      SUBI	R16,0xFF
    0091 4F1F      SBCI	R17,0xFF
    0092 3706      CPI	R16,0x76
    0093 E0E4      LDI	R30,4
    0094 071E      CPC	R17,R30
    0095 F3D0      BCS	0x0090
    0096 9508      RET
(0063)  ;
(0064) }
(0065) 
(0066) //communiate with CM320240****************************
(0067) //write to register
(0068) void lcd_regwr(unsigned char regdata)
(0069) {
_lcd_regwr:
  regdata              --> Y+0
    0097 9508      RET
(0070) }
(0071) 
(0072) void main(void)
(0073) {
(0074)  while(1)
FILE: <library>
_main:
    0098 CFFF      RJMP	_main
    0099 9508      RET

⌨️ 快捷键说明

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