Jump to content

Button plugin: external Interrupt on RB0


Recommended Posts

Bug description:

The debugger do not recognize an external interrupt

activated by a button plugin (reproduceable).

 

The MPLAB simulator activates the interrupt.

Is this a bug of the debugger?

 

Button config: PortB, Pin 0

 

PicAntIDE version:   PicAndIDE 5.0

Compiler:               C2C-plus

Compiler version:     5.0e

OS:                      Windows 2000

 

 

void interrupt( void )
  {
  // Never reached this line...
  portb = 23;
  clear_bit( INTCON, INTF);  //clear external Interrupt
  }


void main(void)
{
option_reg = Bit(INTEDG); //interrupt on rising edge
trisb = 0x01;    
 portb = 0;

enable_interrupt( INTE );  //enable external Interrupt
enable_interrupt( GIE );
 
while(1); //endless loop
}

Link to post
Share on other sites
  • 1 month later...

I've had the same problem, running 5.0.4  Buttons connected to PortB are not causing interrupts, the assembled code works in the PIC ide debugger.  This concerns me as I was just about to purchase a copy of C2C.

 

Here's the code:

#include <p16f877.h>
void interrupt( void )
{
 char intFlags = intcon & 0x07;
 portd ^= intFlags;
 intcon = intcon & 0xF8;
}

main()
{
 option_reg = 0x07;      // set prescaler to 1:256
 trisd = 0x00;   	 
 trisb = 0xFF;    
 intcon = 0xB8;    

 while(1) 
 {
   clear_wdt();
 }
}

Link to post
Share on other sites

The simulator currently simulates:

Instruction decoding, ALU, W REG, STATUS register, Program counter, FSR register, RAM File Registers, Stack, TMR0

and EEPROM.

 

Interrupt generation from port b is not currently supported, but will be implemented very soon.

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...