gnupic: Question regarding gpsim
Subject:
Re: Question regarding gpsim
From:
Scott Dattalo ####@####.####
Date:
20 Oct 2002 14:22:02 -0000
Message-Id: <Pine.LNX.4.44.0210200708060.30582-100000@ruckus.brouhaha.com>
On Sun, 20 Oct 2002, Tobias Schlottke wrote:
> Hi,
>
> I am using gpsim 0.20.14. I have some problems
> with understanding of stimuli.
>
> I do the following:
> Startup gpsim with command file:
> gpsim -c prog.stc
>
> prog.stc contains the following:
>
> #------------------------------------------
> processor pic16f84 fred
> load s prog.cod
> node n1
> stimulus asy initial_state 1 name m_in end
> attach n1 m_in porta0 porta1 porta2
> #-----------------------------------------
>
> Then I do a dump.
>
> What I expect is portb equal 07,
You mean PORTA?
> because the lower three bits are set.
> But I get 00.
> The same if I load the instruction file
> from the cli with
> load c prog.stc
>
> If I execute every instruction manually
> into the cli, I get the expected result.
>
> What do I do wrong?
It may be fred who's the problem.
Are you sure 1) You're looking at the right port (a) or (b), 2) That the
TRIS bits are set properly?
I'm not discounting a bug in gpsim... If you're sure that fred is behaving
properly, then a workaround in the stimulus file can be:
stimulus asy
initial_state 1
start_cycle 1
period 0x10000000
# cycle data
2 1
name m_in
end
This should work. What it says is that at cycle # 1 (start_cycle) begin
the stimulus with the initial state of 1. At cycle 2+start_cycle set the
stimulus to "1" (no effect since it is already 1). Then after 0x10000000
cycles repeat this (again, no observable effect since the output is
already high).
Scott