2012-05-09, 23:37:12
With my C compiler
and here is what he does in assembler
And when I use the interrupt
And when I use the interrupt in asm
Thank you for the attention ... and see you soon ... bye and sorry for my english again ^^
Code:
//IPC0bits.T1IP = 0; //T1IP<2:0>: Timer1 Interrupt Priority bits 111 = Interrupt is priority 7 (highest priority interrupt)
IEC0bits.T1IE = 1; //T1IE: Timer1 Interrupt Enable bit
T1CONbits.TCS = 0; //0 = Internal clock (FCY)
T1CONbits.TSYNC = 0;
T1CONbits.TCKPS = 0b00; //TCKPS<1:0>: Timerx Input Clock Prescale Select bits
T1CONbits.TGATE = 0;
T1CONbits.TSIDL = 0;
T1CONbits.TON = 0; //TON: Timer1 On bit 1 = Starts 16-bit
TMR1 = 25575 ;
and here is what he does in assembler
Code:
;Robot#3.c,1408 :: IEC0bits.T1IE = 1; //T1IE: Timer1 Interrupt Enable bit
BSET IEC0bits, #3
;Robot#3.c,1409 :: T1CONbits.TCS = 0; //0 = Internal clock (FCY)
BCLR T1CONbits, #1
;Robot#3.c,1410 :: T1CONbits.TSYNC = 0;
BCLR T1CONbits, #2
;Robot#3.c,1411 :: T1CONbits.TCKPS = 0b00; //TCKPS<1:0>: Timerx Input Clock Prescale Select bits
MOV #lo_addr(T1CONbits), W0
MOV.B [W0], W1
MOV.B #207, W0
AND.B W1, W0, W1
MOV #lo_addr(T1CONbits), W0
MOV.B W1, [W0]
;Robot#3.c,1412 :: T1CONbits.TGATE = 0;
BCLR T1CONbits, #6
;Robot#3.c,1413 :: T1CONbits.TSIDL = 0;
BCLR T1CONbits, #13
;Robot#3.c,1414 :: T1CONbits.TON = 0; //TON: Timer1 On bit 1 = Starts 16-bit Timer1
BCLR T1CONbits, #15
;Robot#3.c,1415 :: TMR1 = 25575 ;
MOV #25575, W0
MOV WREG, TMR1
And when I use the interrupt
Code:
void T1Interrupt() iv IVT_ADDR_T1INTERRUPT{
//...Code
//TMR1 = 25575;
TMR1 = 0;
//RAZ Timer1 Interrupt Flag Status bit
IFS0bits.T1IF = 0 ;
}
And when I use the interrupt in asm
Code:
;Robot#3.c,574 :: void T1Interrupt() iv IVT_ADDR_T1INTERRUPT{
;Robot#3.c,578 :: TMR1 = 0;
CLR TMR1
;Robot#3.c,581 :: IFS0bits.T1IF = 0 ;
BCLR IFS0bits, #3
Thank you for the attention ... and see you soon ... bye and sorry for my english again ^^