diff --git a/PIC_Simulator/Form1.Designer.cs b/PIC_Simulator/Form1.Designer.cs index 13ef0e6..09ad2b3 100644 --- a/PIC_Simulator/Form1.Designer.cs +++ b/PIC_Simulator/Form1.Designer.cs @@ -798,7 +798,7 @@ this.edClockAddr.Name = "edClockAddr"; this.edClockAddr.Size = new System.Drawing.Size(64, 20); this.edClockAddr.TabIndex = 59; - this.edClockAddr.Text = "0x20"; + this.edClockAddr.Text = "0x05"; // // edClockBit // diff --git a/PIC_Simulator/Form1.cs b/PIC_Simulator/Form1.cs index b23f6b6..7a303f1 100644 --- a/PIC_Simulator/Form1.cs +++ b/PIC_Simulator/Form1.cs @@ -251,8 +251,9 @@ namespace PIC_Simulator btn_RB_Tris_6.Text = (programm.GetRegisterOhneBank(PICProgramm.ADDR_TRIS_B, 6) ? "i" : "o"); btn_RB_Tris_7.Text = (programm.GetRegisterOhneBank(PICProgramm.ADDR_TRIS_B, 7) ? "i" : "o"); - if (btnWD1.Font.Bold != programm.WatchDog.Aktiviert) btnWD1.Font = new Font(btnWD1.Font, programm.WatchDog.Aktiviert ? FontStyle.Bold : FontStyle.Regular); + if (btnWD1.Font.Bold != programm.WatchDog.Aktiviert) btnWD1.Font = new Font(btnWD1.Font, programm.WatchDog.Aktiviert ? FontStyle.Bold : FontStyle.Regular); if (btnWD0.Font.Bold == programm.WatchDog.Aktiviert) btnWD0.Font = new Font(btnWD0.Font, programm.WatchDog.Aktiviert ? FontStyle.Regular : FontStyle.Bold); + if (btnClockStart.Font.Bold != programm.TaktgeberAktiviert) btnClockStart.Font = new Font(btnClockStart.Font, programm.TaktgeberAktiviert ? FontStyle.Bold : FontStyle.Regular); } private void box_CodeView_DoubleClick(object sender, EventArgs e) diff --git a/PIC_Simulator/PIC/PICProgramm.cs b/PIC_Simulator/PIC/PICProgramm.cs index f243ba5..7c07aa2 100644 --- a/PIC_Simulator/PIC/PICProgramm.cs +++ b/PIC_Simulator/PIC/PICProgramm.cs @@ -230,8 +230,36 @@ namespace PIC_Simulator.PIC TaktgeberZahler += frequenz; if (TaktgeberZahler >= TaktgeberFrequenz) { + if (TaktgeberAdresse == ADDR_PORT_A) + { + var wert = SetBit(GetRegisterOhneBank(TaktgeberAdresse), TaktgeberBitnummer, !GetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer)); + + var ta = Register[ADDR_TRIS_A]; + + if (GetBit(ta, TaktgeberBitnummer)) + { + Latch_RA = (byte)(wert & 0xFF); + Register[ADDR_PORT_A] = wert; + } + } + else if (TaktgeberAdresse == ADDR_PORT_B) + { + var wert = SetBit(GetRegisterOhneBank(TaktgeberAdresse), TaktgeberBitnummer, !GetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer)); + + var tb = Register[ADDR_TRIS_B]; + + if (GetBit(tb, TaktgeberBitnummer)) + { + Latch_RB = (byte)(wert & 0xFF); + Register[ADDR_PORT_B] = wert; + } + } + else + { + SetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer, !GetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer)); + } + TaktgeberZahler = 0; - SetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer, !GetRegisterOhneBank(TaktgeberAdresse, TaktgeberBitnummer)); } }