EDN首页   博客首页

日志档案

发表于 2008-4-1 10:27:42

1

标签: 无标签

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

 

    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
点击看大图
 

系统分类: 单片机   |   用户分类: 无分类   |   来源: 原创   |   【推荐给朋友】   |   【添加到收藏夹】

    阅读(203)    回复(0)  

投一票您将和博主都有获奖机会!