原创 AVR Studio 的激励文件的建立与使用.

2008-4-1 10:27 3055 4 4 分类: MCU/ 嵌入式
 
    Using a stimulus file for simulation

 

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

点击看大图

 

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /1 下一条