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

📄 sysinit.s

📁 ATmega128和ads7864实现ATP闭环控制
💻 S
字号:
	.module SysInit.C
	.area text(rom, con, rel)
	.dbfile D:\ATP_AVR\SysInit.C
	.dbfunc e port_init _port_init fV
	.even
_port_init::
	.dbline -1
	.dbline 9
; #include "public.h"
; 
; 
; 
; 
; 
; 
; void port_init(void)
; {
	.dbline 10
;  PORTA = 0x00;
	clr R2
	out 0x1b,R2
	.dbline 11
;  DDRA  = 0xFF;
	ldi R24,255
	out 0x1a,R24
	.dbline 12
;  PORTB = 0x00;
	out 0x18,R2
	.dbline 13
;  DDRB  = 0xF7;
	ldi R24,247
	out 0x17,R24
	.dbline 14
;  PORTC = 0xFF; //m103 output only
	ldi R24,255
	out 0x15,R24
	.dbline 15
;  DDRC  = 0x00;
	out 0x14,R2
	.dbline 16
;  PORTD = 0xFF;
	out 0x12,R24
	.dbline 17
;  DDRD  = 0xFE;	//PD0 input
	ldi R24,254
	out 0x11,R24
	.dbline 18
;  PORTE = 0x00;
	out 0x3,R2
	.dbline 19
;  DDRE  = 0xFE;	//PE0 input
	out 0x2,R24
	.dbline 20
;  PORTF = 0x00;
	sts 98,R2
	.dbline 21
;  DDRF  = 0x00;
	sts 97,R2
	.dbline 22
;  PORTG = 0x1F;
	ldi R24,31
	sts 101,R24
	.dbline 23
;  DDRG  = 0x1F;
	sts 100,R24
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e init_devices _init_devices fV
	.even
_init_devices::
	.dbline -1
	.dbline 28
; }
; 
; //call this routine to initialize all peripherals
; void init_devices(void)
; {
	.dbline 29
; 	 XDIV  = 0x00; //xtal divider
	clr R2
	out 0x3c,R2
	.dbline 30
; 	 XMCRA = 0x00; //external memory
	sts 109,R2
	.dbline 31
; 	 port_init();
	xcall _port_init
	.dbline 32
; 	 MCUCR = 0x00;
	clr R2
	out 0x35,R2
	.dbline 33
; 	 EICRA = 0x00; //extended ext ints
	sts 106,R2
	.dbline 34
; 	 EICRB = 0x00; //extended ext ints
	out 0x3a,R2
	.dbline 35
; 	 EIMSK = 0x00;
	out 0x39,R2
	.dbline 36
; 	 TIMSK = 0x00; //timer interrupt sources
	out 0x37,R2
	.dbline 37
; 	 ETIMSK = 0x00; //extended timer interrupt sources
	sts 125,R2
	.dbline -2
L2:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e SysInit _SysInit fV
	.even
_SysInit::
	.dbline -1
	.dbline 44
;  
; }
; 
; 
; 
; void SysInit(void)
; {
	.dbline 46
; 	//stop errant interrupts until set up
; 	 CLI(); //disable all interrupts
	cli
	.dbline 47
; 	init_devices();
	xcall _init_devices
	.dbline 49
; 
; 	spi_init();
	xcall _spi_init
	.dbline 52
; 
; 
; 	AD_Init();
	xcall _AD_Init
	.dbline -2
L3:
	.dbline 0 ; func end
	ret
	.dbend

⌨️ 快捷键说明

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