I currently use SmulIDE 0.14.15 on Debian Linux 11 and the code is being generated on MPLAB X IDE v5.50 with XC8 compiler v2.32.
With the exception of fusebits, the code is summarized as follows:
The assembled circuit is shown in the following figure:
The simulator does not execute the interrupt routine (ISR) when the button is pressed. However, it works perfectly when this same firmware is simulated on an equivalent circuit in Proteus.
I performed another test mounting another one similar to what I had done in Proteus and loading the firmware generated in MikroC PRO for PIC. This mount also did not work correctly in SimulIDE, not executing interrupts. At the moment the focus is on this mid-range PIC, PIC16F887 and I think some setting or option should be activated to enable interrupt recognition.
I've been using SimulIDE more intensively now because I'm helping to monitor the Microcontrollers course in the Electrical Engineering department at the Federal University of Sergipe, where I'm also a student.
I am fully interested in recommending the use of SimulIDE to my classmates, as it is light, fast, cross-platform and free. Thank you in advance for any support in solving this problem.
With the exception of fusebits, the code is summarized as follows:
- Code:
#include <xc.h>
#include <pic16f887.h>
void __interrupt() myisr();
// Programa principal
void main(){
// Configura registradores gerais
ANSEL = 0x00;
ANSELH = 0x00;
C1ON = 0;
C2ON = 0;
// Configura direcao e valores para entradas e saidas
TRISB = 0x03;
TRISC = 0x00;
PORTC = 0x01;
// Configura OPTION_REG
OPTION_REGbits.INTEDG = 1;
// Configura interrupção externa
INTCONbits.INTF = 0;
INTCONbits.RBIF = 0;
INTCONbits.GIE = 1;
INTCONbits.INTE = 1;
INTCONbits.RBIE = 1;
// Loop infinito
while (1){
// if (RB0==0) PORTD ^= 0b00000001;
}
}
// ISR
void __interrupt() myisr(){
PORTC = 0b00000011;
if(INTF){
PORTC ^= 0b00000001;
INTCONbits.INTF = 0;
}
INTCONbits.RBIF = 0;
}
The assembled circuit is shown in the following figure:
The simulator does not execute the interrupt routine (ISR) when the button is pressed. However, it works perfectly when this same firmware is simulated on an equivalent circuit in Proteus.
I performed another test mounting another one similar to what I had done in Proteus and loading the firmware generated in MikroC PRO for PIC. This mount also did not work correctly in SimulIDE, not executing interrupts. At the moment the focus is on this mid-range PIC, PIC16F887 and I think some setting or option should be activated to enable interrupt recognition.
I've been using SimulIDE more intensively now because I'm helping to monitor the Microcontrollers course in the Electrical Engineering department at the Federal University of Sergipe, where I'm also a student.
I am fully interested in recommending the use of SimulIDE to my classmates, as it is light, fast, cross-platform and free. Thank you in advance for any support in solving this problem.
Last edited by arcachofo on Tue Dec 28, 2021 10:42 am; edited 5 times in total (Reason for editing : Marked as solved (green color))