Wednesday, June 29, 2011

Working with simulator

I've been working on a real ZPUino simulator, one that can run all your sketches directly.

Although it's not a perfect one (proper timing is not implemented) it's fully functional, and I'm even putting out a GUI for it.

And it's a lot of fun! And it's rather easy to add simulation for your own devices.

Alvie



8 comments:

  1. Looks promising, however with regards to the actual ZPUino soft core I seem to have a problem with the UART. I don't know if it's a timing issue or what but I can't make even simple 'duino/processing sketches work reliably. If I should be so lucky to make a connection, after a short while the papilio starts spewing garbage characters. No such problem with the default AVR8.

    ReplyDelete
  2. Now, that is really ODD.

    Can you please send me the sketch you're using (by email) ?

    Alvie

    ReplyDelete
  3. Sure, will do. In the mean while look at the ASCIITable sketch, it's totally silent on my papilio.

    ReplyDelete
  4. I misspoke. The ASCIITable demo now seems to work most of the time altho I've seen some corruption with it once or twice too. However what works unreliably for me is the simple case of setup() { Serial.begin(9600); } loop() { Serial.println("Hello world!"); }

    ReplyDelete
  5. The beta 2 seems a bit better (eg. zpuinoprogrammer.exe does not crash anymore, yay!) but does not eliminate the issue with Serial.println() without interspersed delay()s (3ms seems to be a minimum for reliabl comms in my case). Maybe this is simply due to lack of hardware flow control or something, in which case this could be considered as being "by design". Maybe you should just make an appnote or something. :)

    ReplyDelete
  6. You're using a papilio, right ?

    Note that programmer does a intensive write/read in papilio boards, at 1Mbps, and you should not expect any issue with it.

    Care to send me the sketch you're using ?

    ReplyDelete
  7. (Email sent). Yes, I hav the Papilio One 250k. The programmer works just fine now even tho it used to crash in Beta1 and even that didn't prevent it from doing the programming part, it just crashed at the end of every upload (or windows perceived it as a crashing app, don't know if it really did). As for the serial troubles, I don't think it's worth pursuing at the moment unless somebody more knowledgeabl about UARTs and Processing can make up more test cases. The sketch is pretty much the same as in my third comment, just with a delay() added after the Serial.println(). Making the delay between the lines shorter than 3ms is asking for troubl in my case. But it's just an annoyance, nothing more.

    ReplyDelete