diff --git a/bin/Model/Microcontroller/RAM.class b/bin/Model/Microcontroller/RAM.class index b1254ab..35941ca 100644 Binary files a/bin/Model/Microcontroller/RAM.class and b/bin/Model/Microcontroller/RAM.class differ diff --git a/bin/Model/MyModel.class b/bin/Model/MyModel.class index c1ac517..a8e4fe2 100644 Binary files a/bin/Model/MyModel.class and b/bin/Model/MyModel.class differ diff --git a/src/Model/Microcontroller/RAM.java b/src/Model/Microcontroller/RAM.java index 931c435..ab14f10 100755 --- a/src/Model/Microcontroller/RAM.java +++ b/src/Model/Microcontroller/RAM.java @@ -758,6 +758,20 @@ public class Ram { //Bank0 PortB public synchronized void set_RB0_INT(boolean value) { int portB = get_PORTB(); + boolean bOldRB0 = get_RB0_INT(); + //If INTEDG is set, check if rising edge appeared + if (get_INTEDG()) { + //If rising edge appeared, set INT-Interrupt-Flag + if ((!bOldRB0) && value) { + set_INTF(true); + } + //If INTEDG is clear, check if falling edge appeared + } else { + //If falling edge appeared, set INT-Interrupt-Flag + if (bOldRB0 && (!value)) { + set_INTF(true); + } + } if (value) { portB |= 0b00000001; } else { diff --git a/src/Model/MyModel.java b/src/Model/MyModel.java index d42a621..12893c6 100644 --- a/src/Model/MyModel.java +++ b/src/Model/MyModel.java @@ -61,6 +61,7 @@ public class MyModel extends Thread { } //Check if interrupt was acknowledged if (oPIC.interruptAcknowledged()) { + qDataToView.add(oPIC); //Execute ISR oPIC.InterruptServiceRoutine(); } else { @@ -113,11 +114,16 @@ public class MyModel extends Thread { //Check if breakpoints are initialized if (abBreakpoints != null) { //Check if breakpoint is set - int iProgC = oPIC.getRam().get_Programcounter(); - iProgC &= abBreakpoints.length; - if (!abBreakpoints[iProgC]) { - step(); - qDataToView.add(oPIC); + if (!abBreakpoints[oPIC.getRam().get_Programcounter()]) { + //Check if interrupt acknowledged + if (oPIC.interruptAcknowledged()) { + qDataToView.add(oPIC); + //Execute ISR + oPIC.InterruptServiceRoutine(); + } else { + step(); + qDataToView.add(oPIC); + } } } else { System.out.println("Please load file!");