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

📄 cpu_init.s

📁 ICC LCD波形显示子程序,采用MEGA128单片机
💻 S
字号:
	.module cpu_init.c
	.area text(rom, con, rel)
	.dbfile D:\icc_work\LCD波形显示\cpu_init.c
	.dbfunc e port_init _port_init fV
	.even
_port_init::
	.dbline -1
	.dbline 10
; //ICC-AVR application builder : 2007-5-23 20:55:56
; // Target : M128
; // Crystal: 16.000Mhz
; #include <iom128v.h>
; #include <macros.h>
; #include "all.h"
; #define uchar unsigned char 
; #define uint unsigned int 
; void port_init(void)
; {
	.dbline 11
;  PORTA = 0x00;
	clr R2
	out 0x1b,R2
	.dbline 12
;  DDRA  = 0x00;
	out 0x1a,R2
	.dbline 13
;  PORTB = 0x00;
	out 0x18,R2
	.dbline 14
;  DDRB  = 0xff;
	ldi R24,255
	out 0x17,R24
	.dbline 15
;  PORTC = 0x00; //m103 output only
	out 0x15,R2
	.dbline 16
;  DDRC  = 0x00;
	out 0x14,R2
	.dbline 17
;  PORTD = 0x00;
	out 0x12,R2
	.dbline 18
;  DDRD  = 0x00;
	out 0x11,R2
	.dbline 19
;  PORTE = 0x00;
	out 0x3,R2
	.dbline 20
;  DDRE  = 0x00;
	out 0x2,R2
	.dbline 21
;  PORTF = 0x00;
	sts 98,R2
	.dbline 22
;  DDRF  = 0x00;
	sts 97,R2
	.dbline 23
;  PORTG = 0x00;
	sts 101,R2
	.dbline 24
;  DDRG  = 0x00;
	sts 100,R2
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e init_devices _init_devices fV
	.even
_init_devices::
	.dbline -1
	.dbline 29
; }
; 
; //call this routine to initialize all peripherals
; void init_devices(void)
; {
	.dbline 31
;  //stop errant interrupts until set up
;  CLI(); //disable all interrupts
	cli
	.dbline 32
;  XDIV  = 0x00; //xtal divider
	clr R2
	out 0x3c,R2
	.dbline 33
;  XMCRA = 0x00; //external memory
	sts 109,R2
	.dbline 34
;  port_init();
	xcall _port_init
	.dbline 35
;  system_init();
	xcall _system_init
	.dbline 37
;   
;  MCUCR = 0x00;
	clr R2
	out 0x35,R2
	.dbline 38
;  EICRA = 0x00; //extended ext ints
	sts 106,R2
	.dbline 39
;  EICRB = 0x00; //extended ext ints
	out 0x3a,R2
	.dbline 40
;  EIMSK = 0x00;
	out 0x39,R2
	.dbline 41
;  TIMSK = 0x00; //timer interrupt sources
	out 0x37,R2
	.dbline 42
;  ETIMSK = 0x00; //extended timer interrupt sources
	sts 125,R2
	.dbline 43
;  SEI(); //re-enable interrupts
	sei
	.dbline -2
L2:
	.dbline 0 ; func end
	ret
	.dbend

⌨️ 快捷键说明

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