YASU
Joined: 18 Mar 2010 Posts: 7
|
compiler bug?? at clear_interrupt( INT_RBx ); |
Posted: Sun Apr 11, 2010 8:12 pm |
|
|
Now I got trouble that I could not clear interrupt flag by using
clear_interrupt( INT_RBx );
I think this is compiler bug.
Please give me some advice, and show me how to solve it.
Device PIC16LF1937
software
MPLAB 8.46
CCS C PCM 4.104/4.105
I make isr as following.
Code: |
void rb_isr( void )
{
ucDummy = input_b();
disable_interrupts( INT_RB0 );
disable_interrupts( INT_RB1 );
disable_interrupts( INT_RB2 );
disable_interrupts( INT_RB5 );
disable_interrupts( INT_RB6 );
disable_interrupts( INT_RB7 );
disable_interrupts( INT_RB );
clear_interrupt( INT_RB0 );
clear_interrupt( INT_RB1 );
clear_interrupt( INT_RB2 );
clear_interrupt( INT_RB3 );
clear_interrupt( INT_RB4 );
clear_interrupt( INT_RB5 );
clear_interrupt( INT_RB6 );
clear_interrupt( INT_RB7 );
clear_interrupt( INT_RB );
}
|
And I checked disassembly list, then
it seems like clear PIR2 register CCP2IF bit.
Code: |
912: #int_rb
913: void rb_isr( void )
914: {
915: ucDummy = input_b();
0051 30FF MOVLW 0xff
0052 0021 MOVLB 0x1
0053 008D MOVWF 0xd
0054 0020 MOVLB 0
0055 080D MOVF 0xd, W
0056 00AF MOVWF 0x2f
916: disable_interrupts( INT_RB0 );
0057 0027 MOVLB 0x7
0058 1014 BCF 0x14, 0
0059 1015 BCF 0x15, 0
917: disable_interrupts( INT_RB1 );
005A 1094 BCF 0x14, 0x1
005B 1095 BCF 0x15, 0x1
918: disable_interrupts( INT_RB2 );
005C 1114 BCF 0x14, 0x2
005D 1115 BCF 0x15, 0x2
919: disable_interrupts( INT_RB5 );
005E 1294 BCF 0x14, 0x5
005F 1295 BCF 0x15, 0x5
920: disable_interrupts( INT_RB6 );
0060 1314 BCF 0x14, 0x6
0061 1315 BCF 0x15, 0x6
921: disable_interrupts( INT_RB7 );
0062 1394 BCF 0x14, 0x7
0063 1395 BCF 0x15, 0x7
922: disable_interrupts( INT_RB );
0064 0194 CLRF 0x14
0065 0195 CLRF 0x15
923: clear_interrupt( INT_RB0 );
0066 0020 MOVLB 0
0067 1012 BCF 0x12, 0
924: clear_interrupt( INT_RB1 );
0068 1012 BCF 0x12, 0
925: clear_interrupt( INT_RB2 );
0069 1012 BCF 0x12, 0
926: clear_interrupt( INT_RB3 );
006A 1012 BCF 0x12, 0
927: clear_interrupt( INT_RB4 );
006B 1012 BCF 0x12, 0
928: clear_interrupt( INT_RB5 );
006C 1012 BCF 0x12, 0
929: clear_interrupt( INT_RB6 );
006D 1012 BCF 0x12, 0
930: clear_interrupt( INT_RB7 );
006E 1012 BCF 0x12, 0
931: clear_interrupt( INT_RB );
006F 1012 BCF 0x12, 0
|
I think it sould be like as followings
Code: |
922: clear_interrupt( INT_RB0 );
MOVLB 7
BCF 0x16, 0
923: clear_interrupt( INT_RB1 );
BCF 0x16, 1
924: clear_interrupt( INT_RB2 );
BCF 0x16, 2
925: clear_interrupt( INT_RB3 );
BCF 0x16, 3
926: clear_interrupt( INT_RB4 );
BCF 0x16, 4
927: clear_interrupt( INT_RB5 );
BCF 0x16, 5
928: clear_interrupt( INT_RB6 );
BCF 0x16, 6
929: clear_interrupt( INT_RB7 );
BCF 0x16, 7
|
Someone help me. |
|