Searching \ for '[PIC]:MPLAB problem. Please help!' 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: 'MPLAB problem. Please help!'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:MPLAB problem. Please help!'
2001\03\28@124521 by Thomas N

picon face
Hello everyone,

Why do I have to make a port become an output port before I can modify its
content when I do the simulation?

When I simulate my code, and I want to modify a state of certain pin of a
port (to simulate an external input to the IC), I always have to make this
IO pin to be output first before I can make the change.  Is there a solution
for this?

Best regards.

Thomas




_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\28@133915 by Alan B. Pearce

face picon face
>Why do I have to make a port become an output port before I can modify its
>content when I do the simulation?

>When I simulate my code, and I want to modify a state of certain pin of a
>port (to simulate an external input to the IC), I always have to make this
>IO pin to be output first before I can make the change.  Is there a solution
>for this?

Look under the stimulus menu of MPLAB. You can set the state of an input port
there. It is also possible to set up a standard test file to do the stimulus for
you. Very useful if trying to simulate bit banging comms.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\28@141812 by Olin Lathrop

face picon face
> When I simulate my code, and I want to modify a state of certain pin of a
> port (to simulate an external input to the IC), I always have to make this
> IO pin to be output first before I can make the change.  Is there a
solution
> for this?

Check out the various simulator stimulus functions in the DEBUG menu.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\28@160703 by J.A.YOUNG

flavicon
face
Quoting Thomas N <.....thomasn101KILLspamspam@spam@HOTMAIL.COM>:

> Hello everyone,
>
> Why do I have to make a port become an output port before I can modify its
> content when I do the simulation?
>
> When I simulate my code, and I want to modify a state of certain pin of a
> port (to simulate an external input to the IC), I always have to make this
> IO pin to be output first before I can make the change.  Is there a solution
> for this?
>
By 'modifying the state', I'm presuming you're meaning put an input signal to a
pin. Assuming you've set the pin to INPUT (TRISB=1 sets pinRB0 to input, all
others to Output) in the code, you need to use Asynchronous Stimulus. Under the
Debug menu select Simulator Stimulus (or something similar) and another menu
will pop up with Asynchronous Stimulus. Click it, and the box will come up. By
using right click, you can then choose 'toggle' and assign a pin e.g.RB0, then
left-click during simulation to produce an input. The IO pin must be set up as
an _INPUT_ in the code for this to work.

Try looking at the MPLAB tutorial in the manual(if you have it).

John

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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