<br><br><div class="gmail_quote">2009/9/20 P Zoltan <span dir="ltr"><<a href="mailto:zoltan.padrah@gmail.com">zoltan.padrah@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wed, 16 Sep 2009 18:28:26 +0200, santiago gonzalez<br>
<<a href="mailto:santigoro@gmail.com">santigoro@gmail.com</a>> wrote:<br>
<br>
> Ok... i think now pic simulation work quite better, the simulation run in<br>
> two diferent ways:<br>
><br>
> -When runed from the circuit button (play), simulation goes at real time<br>
> for<br>
> a 20 MHz compiled pic code, registers are not updated, breakpoints<br>
> doesn't<br>
> have effect, it's just like powering the pic.<br>
><br>
> -When running from the code (execute), it run slower and updates<br>
> registers<br>
> view every 25 ms and every cycle when step-by-step, breakpoints and any<br>
> other debug feature works here.<br>
><br>
<br>
</div>  From the point of usability I don't know if this is the best approach.<br></blockquote><div><br>I don't know.. this is is just a first aproach and should be discussed.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Maybe adding a "debug code" property to the PIC and setting it depending<br>
on the code launch method would be better. Your assuptions on the usage<br>
are good, but you can't know for sure what the user actually want. Maybe<br>
he wants to load the program on a pic, run it for a while, and only after<br>
that start it debugging (in the middle of the simulating process).<br></blockquote><div><br>Yes... no problem to do this, you can realtime-run the simulation from the "play" button in the circuit document, then pause the simulation and run it from the "execute" or "step" in the tool-bar that appears only when you are in the code document, if you execute from the document view you also can switch to the circuit view and see the circuit running, and at the same time the registers updating, then you can pause and realtime-run again.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
  Also some "mystic" slowdowns or speedups would really annoy me (if I<br>
don't have control over it).<br></blockquote><div> </div><div>You control it: if you run from the play button in the circuit then realtime.. if you run from the code view then not-realtime.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im"><br>
> Now i need two things:<br>
><br>
> -Create the "clock Mhz" property or any other way that the user can<br>
> choose<br>
> the clock speed. Someone can give a hand wit this?<br>
<br>
</div>  I don't know how the PICs works? Do they have clock/quartz input, and/or<br>
set up their operating frequency by them? We should do it in a way that<br>
resembles more the real hardware.<br></blockquote><div><br>Therea are several ways.. you can use external clock, external R-C, internal clock; from the point of view of the simulation this is no matter, the only important thing is that each step must be executed at the same speed that the pic program was code for; i think that having the chance to select the clock speed is enought (by now).<br>
<br>I already added a Clock MHz porperty to the pic component and a loop in simulator.cpp; depending on the clock speed selected, some steps of the loop are skiped... also another first aproach, but works reasonably well comparing with running at fixed speed.<br>
<br></div>But this needs a good timing in ktl, now there are some random behaivors. I hope that the actual work you are doing will improbe this.<br>For simulating all the supported pics, simulator should can update the pic at 10 MHz, but for the most used p16f with 5 MHz is enought.<br>
</div>