Manually stimulating an in port to simulate a project can be tedious.AVR Studio provides the option of using a stimulus file (.sti), to apply a pre-determined input pattern to the pins of any port at a specified clock cycle.
Making use of a .sti file can help get more accurate simulation results, as the input patterns will always be identical for a given file.
Format of a stimulus file:
000000001:01
000000200:00
XXXXXXXXX:XX
.
.
999999999:FF
Writing the .sti file is simple.Specify the cycle number, and the value(in hex) you want to apply to the pins at that cycle, separating the two items by a colon.
Be sure to end your .sti file with the line:
999999999:FF
Now that you have created some stimulus, the only thing left to do is associate your .sti file with the project to be simulated.
As you run or step through the code in simulator, the values you set in the .sti file will change the port pins automatically.
Select “AVR Simulator Options” at the the bottom of the debug menu
Select the .sti file you created as input, specify the port to be simulated, and click add entry.You are also able to setup a .log file to save a history of port activity.
Be sure to set the proper frequency under ‘Device selection’.This will allow the stopwatch to show correct timing information for your simulation
文章评论(0条评论)
登录后参与讨论