AVR Freaks

AVR studio 4 forum - Problem with stimuli files in AVRStudio

tdct - Oct 27, 2006 - 09:08 AM
Post subject: Problem with stimuli files in AVRStudio
Hi,

I use AVRStudio version 4.12 - build 460.

I am able to load a stimuli (*.sti) file for an I/O port into my project; but when I run the project; no state changes for the I/O port occur. Although my stimuli file requests a state change an the pins of the port, no state changes occur as I run the project.

This is what I do:

I wrote a stimuli file (portb.sti) which looks like this:
00000000:0F
00000010:FF
00000020:00
00000030:FF
00000040:00
00000050:FF
00000060:00
00001000:FF
00002000:00
00010000:FF
00020000:00

I open my project and start the debugger. In the simulator options I select the correct device and clock -> ATMEGA162 @ 8 MHz. I also add my stimuli file as an entry for portB. I select a log file with option 'To screen' selected to capture the states for PortB (portb.log). So the action list in the simulator options looks like this:

Port Funtion Screen File
PORTB Stimuli No c:\portb.sti
PORTB Logging Yes c:\portb.log

I exit the simulator options and set the stop watch to 0 us and enable the I/O view. Pinb register has value 0.

I step through my code and expect the value for pinb register to change immediately because the first index in my stimuli file requests value 0x0F on pinB.
Unfortunately pinB value is still 0. My log file contains only one index:
000013566:B0

Can anyone please tell me what I do wrong?

Many thanks,

Tom
tdct - Nov 03, 2006 - 10:42 AM
Post subject: Problem solved
For all people who might encounter the same problem in the future, I'm going to reply to my own post, now that the problem is solved.

I completely reïnstalled AVRStudio and installed service pack 4. Then I double checked my code and made sure that all GPIO lines where initialised (either as input or as output). Also I added the following line at the end of my stimuli file:
99999999:FF because in the AVRStudio help files, it is said to be mandatory.

That did it, now I have no more problems with simulation in AVRStudio.

Hope this saves somebody some time in the future.
leinad - Nov 20, 2006 - 05:56 PM
Post subject: RE: Problem solved
Hello freaks,

I am having a similar problem with my stimuli file. I used the stimuli generator program to generate the stimuli file. When I import the file into AVR Studio, it executes the first statement but then nothing. It doesn't change the values on the port at all after that.

Here is my stimuli file:
Code:
000000001:21
008000000:22
016000000:23
024000000:24
032000000:25
040000000:26
048000000:27
056000000:28
072000000:08
080000000:07
088000000:06
096000000:05
104000000:04
112000000:03
120000000:02
128000000:01
144000000:21
152000000:22
160000000:23
168000000:24
176000000:25
184000000:24
192000000:25
200000000:28
208000000:20
216000000:00
999999994:40
999999995:1F
999999996:E8
999999997:03
999999998:00
999999999:FF


I'd appreciate any help you have.
leinad - Nov 20, 2006 - 06:06 PM
Post subject: RE: Problem solved
I've found the problem!

The problem was that the simulator (when running) takes longer than real time. A lot longer.

I had set the transitions to change every second for a 8MHz clock. But in the simulator, every second (for the real system)takes about a minute of simulator time. I reduced the time for each transtion and i saw the results.

I hope this helps somone in the future!
All times are GMT + 1 Hour
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits