[X] Testprogramm 8 (Interrupts)

master
Mike Schwörer 5 years ago
parent 8dc2517509
commit e064604cf0
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
  1. 24
      PIC_Simulator/Form1.cs
  2. 10
      PIC_Simulator/PIC/PICProgramm.cs
  3. 4
      Projektinformationen/Tabelle.txt

@ -35,6 +35,7 @@ namespace PIC_Simulator
lvSpecial.Items.Add(new ListViewItem(new[] { "PC", "0x00" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Status", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Option", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Intcon", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Time", "0ms" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "RA (Backing)", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "RB (Backing)", "0b00000000" }));
@ -196,17 +197,18 @@ namespace PIC_Simulator
// Spezialregister aktualisieren
lvSpecial.Items[0].SubItems[1].Text = string.Format("0x{0:X2}", programm.Register_W);
lvSpecial.Items[1].SubItems[1].Text = string.Format("{0,4}", programm.PCCounter);
lvSpecial.Items[2].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS), 2).PadLeft(8, '0'));
lvSpecial.Items[3].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_OPTION), 2).PadLeft(8, '0'));
lvSpecial.Items[4].SubItems[1].Text = string.Format("{0}ms", programm.Stepcount * int.Parse(insertTime.Text));
lvSpecial.Items[5].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_A], 2).PadLeft(8, '0');
lvSpecial.Items[6].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_B], 2).PadLeft(8, '0');
lvSpecial.Items[7].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_C) ? "1" : "0";
lvSpecial.Items[8].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_DC) ? "1" : "0";
lvSpecial.Items[9].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_Z) ? "1" : "0";
lvSpecial.Items[10].SubItems[1].Text = string.Format("{0:0.000}ms", programm.WatchDog.time * 1000);
lvSpecial.Items[0].SubItems[1].Text = string.Format("0x{0:X2}", programm.Register_W);
lvSpecial.Items[1].SubItems[1].Text = string.Format("{0,4}", programm.PCCounter);
lvSpecial.Items[2].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS), 2).PadLeft(8, '0'));
lvSpecial.Items[3].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_OPTION), 2).PadLeft(8, '0'));
lvSpecial.Items[4].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_INTCON), 2).PadLeft(8, '0'));
lvSpecial.Items[5].SubItems[1].Text = string.Format("{0}ms", programm.Stepcount * int.Parse(insertTime.Text));
lvSpecial.Items[6].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_A], 2).PadLeft(8, '0');
lvSpecial.Items[7].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_B], 2).PadLeft(8, '0');
lvSpecial.Items[8].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_C) ? "1" : "0";
lvSpecial.Items[9].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_DC) ? "1" : "0";
lvSpecial.Items[10].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_Z) ? "1" : "0";
lvSpecial.Items[11].SubItems[1].Text = string.Format("{0:0.000}ms", programm.WatchDog.time * 1000);
lbStack.Items.Clear();
foreach (var u in programm.Stack) lbStack.Items.Add(u.ToString());

@ -132,6 +132,8 @@ namespace PIC_Simulator.PIC
public PICTimer Zaehler;
public PICWatchDog WatchDog;
public byte Merker_RB0;
public PICProgramm(Form1 f)
{
Zaehler = new PICTimer(this);
@ -810,7 +812,13 @@ namespace PIC_Simulator.PIC
Zaehler.TimerBerechnen(cycleCount);
WatchDog.Aktualisieren(cycleCount);
WatchDog.Aktualisieren(cycleCount);
if (Merker_RB0 != Register[ADDR_PORT_B])
{
Interrupt_RB(Merker_RB0, Register[ADDR_PORT_B]);
Merker_RB0 = Register[ADDR_PORT_B];
}
return PCCounter >= befehle.Count;
}

@ -8,7 +8,7 @@
[/] Variablenbezeichner / Variablennamen
[X] INIT-Werte bei RESET
[X] Laufzeitzähler
[?] Latchfunktion der IO-Register
[X] Latchfunktion der IO-Register
[X] frei wählbare Quarzfrequenz
[X] Breakpoints
[X] Hardwareansteuerung
@ -20,7 +20,7 @@
[X] Testprogramm 6 (indirekte Adressierung)
[X] Testprogramm 7 (Timer 0 )
[X] Ext. Taktgeber an RA4 + IO-Pin
[ ] Testprogramm 7 (Interrupts)
[X] Testprogramm 8 (Interrupts)
[X] Testprogramm 9 (Sleep-Befehl)
[X] Testprogramm 10 (PCL und PCLATH)
[X] Testprogramm 11 (Watchdog, Vorteiler)

Loading…
Cancel
Save