CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

compiler bug?? at clear_interrupt( INT_RBx );

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
YASU



Joined: 18 Mar 2010
Posts: 7

View user's profile Send private message

compiler bug?? at clear_interrupt( INT_RBx );
PostPosted: Sun Apr 11, 2010 8:12 pm     Reply with quote

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.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 12, 2010 1:15 pm     Reply with quote

Yes there is a bug. It's still there in vs. 4.106. You need to report it
to CCS tech support. Send them an email.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group