📄 interrup.inc
字号:
Ext_Int0: ldi tempi,0x00
out GIMSK,tempi ; disable INT0 & INT1
rjmp reset
Tim0_OVF: nop
in flags,sreg
reti
UART_RXC: in flags,sreg
in tempi,UDR
mov address,data1
mov data1,data2
mov data2,checkz
mov checkz,tempi
ldi tempi,Code
eor checkz,tempi
out sreg,flags
reti
Reset: ldi temp,Low(RAMEND)
out SPL,temp ; Set stack pointer to last internal RAM location
ldi temp,High(RAMEND)
out SPH,temp
ldi temp,0b10011000
out UCR,temp ;
; ldi temp,BRR
ldi temp,0x07
out UBRR,temp ;
ldi temp,timerval
out TCNT0,temp
ldi temp,3
out TCCR0,temp
ldi temp,2
out TIMSK,temp
; modify PortA, PA.0~PA.3 as input button, PA.4~PA.7 as output LED
ldi temp, 0b11110000 ; pin 4-7 are output, 0-3 are input, portA
out DDRA,temp
ldi temp,0xff
out PortA,temp ;close all LED
; 2003.1.7 below instr is close for 903 test
; out PortC,temp ; turn on pullups on all pins on port C
;
; 2003.1.7 for 903 test
; Port C is for 903 control interface
ldi temp, 0b01111111 ; pin 5-7 are output, 0-4 are input, portD
out DDRC,temp
sbi PortC,0 ; Pullup on PIN0 of Port C, for C_SENSE input
clr temp ; ini 903 control port on power on
out PortC,temp
;;;;
ldi temp, 0b11100000 ; pin 5-7 are output, 0-4 are input, portD
out DDRD,temp
sbi PortD,2 ; Pullup on PIN2, Port D.
clr counter
TurnOn: sei
ldi channel,2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -