Can the Simulator Use a Stimulus File?

This forum is for all topics related to Simulator for Arduino v0.98. Please include sample code where possible.

Moderator: Adrian

Jim
Posts: 2
Joined: Mon Feb 18, 2013 11:30 pm

Can the Simulator Use a Stimulus File?

Postby Jim » Tue Feb 19, 2013 12:08 am

Hello there. Is there or will there be any provision for a text-based Stimulus file? A search of the forum and the PDF Data Sheet did not return any use of the word.

Thanks,
Jim

Simulator_admin
Site Admin
Posts: 239
Joined: Thu Feb 02, 2012 6:07 pm

Re: Can the Simulator Use a Stimulus File?

Postby Simulator_admin » Sat Feb 23, 2013 4:24 pm

At present, no, but we have had a few people ask for this feature.

With the latest Beta, we have had a crack at this. Below are the contents of a stimulus file: test.sti
20,pinMode(1,OUTPUT);
50,pinMode(5,OUTPUT);
100,digitalWrite(5,HIGH);

In the code, a new hidden command has been added:
// Stimulus(test.sti)

This command loads up the lines into an array, and when the microseconds reaches the first number onthe line, the second part of the line is executed. To make it easier to follow, the Status bar shows the status as Next: line STIM: 10/30us pinMode(1,OUTPUT);

This should be available soon. Thanks

Not sure about another request for a logic analyser style window to see the digital pin states!

Jim
Posts: 2
Joined: Mon Feb 18, 2013 11:30 pm

Re: Can the Simulator Use a Stimulus File?

Postby Jim » Tue Feb 26, 2013 3:21 pm

That's good news, the stimulus file input will be in a future version. Regarding the possible future features of a stimulus input, a periodic input capability would be nice, like sine or square waveforms for example. Or even a scheduled or conditional serial input like SPI, I2C, or 8N1.

A Logic Analyzer view eh? A Logic Analyzer view would be a useful addition, but a LA may not be function well as a timing device. I mean, the timing being an estimate and all, verses an actual sum of the clock cycles of the assembled code.

The Simulator for Arduino is great for checking to see if I/O, calls, and loops are working correctly. And maybe having 'exact timing' is outside of that intended purpose.

Thanks.


Simulator_admin
Site Admin
Posts: 239
Joined: Thu Feb 02, 2012 6:07 pm

Re: Can the Simulator Use a Stimulus File?

Postby Simulator_admin » Fri Mar 08, 2013 8:59 am

OK, thanks we will think about this.

With the logic analyzer, this may not be that hard. We could add the digital output state to the trace and then use the trace info to make a graph. At present, we use 1us per instruction which is a very rough approximation, and unless we jump into AVR assembler code, will have to stay that way.

Thanks for the positive feedback.


Return to “Version 0.98”

Who is online

Users browsing this forum: Google [Bot] and 1 guest