fatcat1985
Newbie level 1
Hello everyone:
I wanna emulate my program in MPlab by choosing MPLAB SIM as the debugger. However, I found that even the context in CCPR1L and CCPR1H met that in Timer 1, nothing happened. The CCP1IF did not be set at all. Did anyone met this problem before?
My init section as follow:
The timer1 was set as D8 00 at first
INITIAL
;============IO init============
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW 0FFH
MOVWF TRISB
MOVWF 00H
MOVWF TRISC
MOVLW 00H
MOVWF TRISD
MOVLW 00H
MOVWF OPTION_REG
;============INT init=============
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW 05H
MOVWF PIE1
MOVLW 80H
MOVWF ADCON1
BCF STATUS,RP0
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
MOVLW 09H
MOVWF ADCON0
;====AD初始化结束=====
MOVLW 0CH
MOVWF T1CON
MOVLW 0D9H
MOVWF CCPR1H
MOVLW 99H
MOVWF CCPR1L
MOVLW 0AH
MOVLW CCP1CON
MOVLW 0D8H
MOVWF INTCON
RETURN
I wanna emulate my program in MPlab by choosing MPLAB SIM as the debugger. However, I found that even the context in CCPR1L and CCPR1H met that in Timer 1, nothing happened. The CCP1IF did not be set at all. Did anyone met this problem before?
My init section as follow:
The timer1 was set as D8 00 at first
INITIAL
;============IO init============
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW 0FFH
MOVWF TRISB
MOVWF 00H
MOVWF TRISC
MOVLW 00H
MOVWF TRISD
MOVLW 00H
MOVWF OPTION_REG
;============INT init=============
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW 05H
MOVWF PIE1
MOVLW 80H
MOVWF ADCON1
BCF STATUS,RP0
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
MOVLW 09H
MOVWF ADCON0
;====AD初始化结束=====
MOVLW 0CH
MOVWF T1CON
MOVLW 0D9H
MOVWF CCPR1H
MOVLW 99H
MOVWF CCPR1L
MOVLW 0AH
MOVLW CCP1CON
MOVLW 0D8H
MOVWF INTCON
RETURN