Searching \ for 'How to use Pin Stimulus files in MPLAB' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'How to use Pin Stimulus files in MPLAB'.

Truncated match.
PICList Thread
'How to use Pin Stimulus files in MPLAB'
1999\12\28@010824 by Robert A. LaBudde

flavicon
face
<x-flowed>I'm using MPLAB 4.12.12, and wrote a demo program for a 12c509a for the
first time. The program makes a one-chip crystal controlled sq. wave
oscillator by using 4 GPIO pins (GP0=output, GP1,GP2,GP3=input). I arranged
for the GP1:GP2:GP3 set to select one of eight frequencies (1/10 Hz, 1, 10,
100, 1k, 10k, 100kHz) based on input values 000 - 111.

In order to test the program (which also switches dynamically between
frequencies when inputs are changed), I need to use a pin stimulus file.

I wrote the following sample ("sqwave.sti"):

!12.28.99 23.15     SQWAVE.STI
!stimulus file for SQWAVE.ASM
CYCLE   GPIO1  GPIO2  GPIO3
1       1      0      0
2       1      1      1
3       0      1      1
4       0      0      1
5       0      0      0
6       1      0      0
7       0      1      0
8       1      0      0
9       1      1      1
10      0      1      0
20      1      0      0
30      0      1      0
100     1      1      1
1000    0      0      0

I reset the program in MPLAB and enabled the pin stimulus file.

But when I run MPLAB step-by-step, the GPIO register stays at b'0000100x'
instead of matching the stimulus pin values I wanted.

What am I missing? I went ahead and burned the eprom, and the circuit works
exactly as intended. So there's nothing wrong with the inputs in real life.

Any suggestions? This has to be a simple fix.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: spam_OUTralTakeThisOuTspamlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\12\28@051412 by David J Binnington

flavicon
face
Robert A. LaBudde wrote:

>
> I wrote the following sample ("sqwave.sti"):
>
> !12.28.99 23.15     SQWAVE.STI
> !stimulus file for SQWAVE.ASM
> CYCLE   GPIO1  GPIO2  GPIO3
> 1       1      0      0
>

I don't have MPLAB or the documentation to hand so I could be wrong, but I
believe the first line of a stim file MUST always begin with CYCLE... etc.
If you put remarks or anything else there then the whole file is ignored!

I vaguely remember this catching me out as a Microchip newbe a few months
ago since I always fully document everything fully and it came as a surprise
that you cannot use a header in a stim file.

Dave B

1999\12\28@113948 by Robert A. LaBudde

flavicon
face
<x-flowed>At 10:12 AM 12/28/99 +0000, Dave wrote:
>Robert A. LaBudde wrote:
>
> >
> > I wrote the following sample ("sqwave.sti"):
> >
> > !12.28.99 23.15     SQWAVE.STI
> > !stimulus file for SQWAVE.ASM
> > CYCLE   GPIO1  GPIO2  GPIO3
> > 1       1      0      0
> >
>
>I don't have MPLAB or the documentation to hand so I could be wrong, but I
>believe the first line of a stim file MUST always begin with CYCLE... etc.
>If you put remarks or anything else there then the whole file is ignored!
>
>I vaguely remember this catching me out as a Microchip newbe a few months
>ago since I always fully document everything fully and it came as a surprise
>that you cannot use a header in a stim file.

That doesn't seem to change the result. GPIO remains unchanged as I step
through the program.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam@spam@lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\12\28@125404 by Erik Reikes

flavicon
face
The first thing I'd try is taking out those first comments.  They should be
ok, but something to try.  Also make sure that you close the file in
whatever you are editing it in.  I few days ago I had similar symptoms
(i.e. no symptoms), and through experimentation I found that it was due to
the file still being open in Excel.  When I closed the file it worked.

Also, make sure your stopwatch is reset to 0, as the file is keyed off of this.

-Erik Reikes


At 01:07 AM 12/28/99 -0500, you wrote:
{Quote hidden}

1999\12\28@140203 by Robert A. LaBudde

flavicon
face
<x-flowed>At 09:52 AM 12/28/99 -0800, Erik wrote:
>The first thing I'd try is taking out those first comments.  They should be
>ok, but something to try.  Also make sure that you close the file in
>whatever you are editing it in.  I few days ago I had similar symptoms
>(i.e. no symptoms), and through experimentation I found that it was due to
>the file still being open in Excel.  When I closed the file it worked.
>
>Also, make sure your stopwatch is reset to 0, as the file is keyed off of
>this.

1. Removed all vestiges of comments.
2. Close files.
3. Selected pin stimulus file.
4. Zeroed stopwatch.
5. Reset simulator.
6. Stepped (F7) until clock 50.

Result: GPIO doesn't change except for bit 0 complementing in program.

Q.Is there some kind of special alignment in the .STI file? E.g., tabs,
spaces, particular columns?

Q. Has anyone gotten this to work?

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam.....lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\12\29@013550 by John

flavicon
face
I think the designation of the pins is GP1, GP2
and so forth.

John-


>I wrote the following sample ("sqwave.sti"):
>
>!12.28.99 23.15     SQWAVE.STI
>!stimulus file for SQWAVE.ASM
>CYCLE   GPIO1  GPIO2  GPIO3
>1       1      0      0
>2       1      1      1
>

1999\12\29@031225 by Robert A. LaBudde

flavicon
face
<x-flowed>At 12:33 AM 12/29/99 -0600, John wrote:
>I think the designation of the pins is GP1, GP2
>and so forth.
>
> >I wrote the following sample ("sqwave.sti"):
> >
> >!12.28.99 23.15     SQWAVE.STI
> >!stimulus file for SQWAVE.ASM
> >CYCLE   GPIO1  GPIO2  GPIO3
> >1       1      0      0
> >2       1      1      1

Thanks, John. The "GPIO" version was a relic of my trying everything to get
this to work.

Now, with GP1-GP3 as pin names AND all comments removed, the inputs do seem
to be appearing at the GPIO port register! Ta-Dah!

However, now I've got a new problem. Although I've configured ~MCLR off,

        __CONFIG   _CP_OFF & _WDT_OFF & _MCLRE_OFF & _XT_OSC

MPLAB continues to go into reset whenever GP3 goes low. The 12c509a burned
with the program works correctly, though.

Any suggestions as to how to deal with this? MPLAB apparently won't give up
on GP3 being ~MCLR instead of an input pin.



================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: EraseMEralspam_OUTspamTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\12\29@035705 by Robert A. LaBudde

flavicon
face
<x-flowed>At 03:11 AM 12/29/99 -0500, I wrote:
{Quote hidden}

After considerable fooling around with this, I have now doped out the rules
for using the MPSIM function in MPLAB:

1. No comments at top of .STI file.
2. Start first line with "CYCLE" followed by pin names.
3. Pin names are GP0-GP5 for 12C509A.
4. Save file as "name.STI".
5. Under OPTIONS|PROCESSOR SETUP|HARDWARE, set your configuration,
regardless of any __CONFIG line in the assembler file. Only this option's
settings will be used, including clock type and various enables.
6. Set DEBUG|STIMULATOR STIMULUS|PIN STIMULUS|ENABLE to the "name.STI" file
used. ONLY the saved file will be used. Any open window with changes will
be ignored. You must perform this function EVERY time the project is
loaded. The setting is NOT saved!
7. Clear the StopWatch  (WINDOW|STOPWATCH), or have it clear itself on reset.
8. Reset the simulator and step through the program.

If you do all of this, the simulator seems to work correctly. (Whew!)

It is annoying to have to assign the stimulus file each time the project is
accessed, but I guess you can't have everything.

PS. Myke! For your 2nd edition, you should correct the examples in your
book to match the results listed above.
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: ralspamspam_OUTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...