📄 poweronreset.asm
字号:
;==============================================================================
; Power On Reset
;------------------------------------------------------------------------------
;==============================================================================
; Revision History:
;
; 2005-01-31 Initial version
;------------------------------------------------------------------------------
include ../pic.inc
include ../lib/dallas1307.inc
include display.inc
include hardware.inc
errorlevel -302
global PowerOnReset
extern BeginClocking
;==============================================================================
code
PowerOnReset:
; Disable PORT B pull ups and /64 prescaler
banksel OPTION_REG
movlw (1<<NOT_RBPU)|(1<<PS2)|(1<<PS0)
movwf OPTION_REG
; Configure PORT A as all digital I/O
banksel ADCON0
clrf ADCON1
banksel ADCON1
movlw b'00000111'
movwf ADCON1
; Ensure that the SSP module is disabled
banksel SSPCON
clrf SSPCON
; Configure I/O ports and clear latches
banksel TRISA
clrf TRISA
clrf TRISB
clrf TRISC
clrf TRISD
bsf TRISD,HZ
clrf TRISE
bsf TRISE,SW_R
bsf TRISE,SW_H
bsf TRISE,SW_M
banksel PORTA
clrf PORTA
clrf PORTB
clrf PORTC
clrf PORTD
clrf PORTE
; Initialise segment patterns and led, map, buzzer state
banksel SEG1
movlw h'ff'
movwf SEG1
movwf SEG2
movwf SEG3
movwf SEG4
clrf CTRL
; Set up timer TMR0 to interrupt on roll over.
banksel TMR0
clrf TMR0
bcf INTCON,T0IF
bsf INTCON,T0IE
bsf INTCON,GIE
; Start the real clock I/O processing
lgoto BeginClocking
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -