Searching \ for 'PIC16C84 simulator available (C++ source)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/languages.htm?key=c%2B%2B
Search entire site for: 'PIC16C84 simulator available (C++ source)'.

Truncated match.
PICList Thread
'PIC16C84 simulator available (C++ source)'
1996\07\26@124808 by Luigi Rizzo

flavicon
face
Two students of mine have written a 16C84 simulator, in C++.  It
simulates correctly all peripherals (timer, interrupts, io ports,
EEPROM writes), and CPU instructions (including the delay slots
after every modification to the PC -- something that the Microchip
simulator does not do).

The program has a command line interface, and a chunky-graphics
output which displays the state (or changes) of I/O pins.
A small manual (only in Italian at the moment, sorry) is available
with the sources. A short help function (in english, this time) is
also included in the command set.

The code has been written with Turbo C++, and ported to g++ . It
should compile without much problems.

The full sources are available at the following address:

       http://www.iet.unipi.it/~luigi/simulpic.tgz

email about this program can be directed to

       spam_OUTsimulpicTakeThisOuTspamiet.unipi.it

Bug reports, suggestions, enhancements are welcome.

       Luigi
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: .....luigiKILLspamspam@spam@iet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522              http://www.iet.unipi.it/~luigi/
====================================================================

1996\07\26@142836 by Eric Smith

flavicon
face
Luigi Rizzo <luigispamKILLspamLABINFO.IET.UNIPI.IT> writes:

> Two students of mine have written a 16C84 simulator, in C++.  It
> simulates correctly all peripherals (timer, interrupts, io ports,
> EEPROM writes), and CPU instructions (including the delay slots
> after every modification to the PC -- something that the Microchip
> simulator does not do).

Do you mean that the Microchip simulator only counts one cycle for instructions
that write to PCL?  Are they really that inept?

Of course, the Microchip documentation erroneously states

       If an instruction causes the program counter to change (e.g. GOTO)
       then two cycles are required to complete the instruction

This would imply that the goto in the sequence

       goto    next
next:

or the addwf in the sequence

       movlw   0
       addwf   pcl

should only take one cycle, since the program counter isn't changed.

What they really should have said is that instructions that *may* change
the program counter always take two cycles.

While we're on the subject, has anyone tested the behavior (on real parts,
not a simulator) of writing to the PCL *indirectly*?  I.e.,

       movlw   pcl
       movwf   fsr
       movlw   label
       movwf   ind     ; should take two cycles
       incf    foo     ; should not execute
       ...

label:  incf    bar     ; should continue here

It wouldn't surprise me one bit if the part didn't notice that the indirect
write affected pcl, and actually executed the incf foo.



Cheers,
Eric

1996\07\26@144830 by Luigi Rizzo

flavicon
face
> Luigi Rizzo <.....luigiKILLspamspam.....LABINFO.IET.UNIPI.IT> writes:
>
> > after every modification to the PC -- something that the Microchip
> > simulator does not do).
>
> Do you mean that the Microchip simulator only counts one cycle for
instructions
> that write to PCL?  Are they really that inept?
>
> Of course, the Microchip documentation erroneously states
>
>         If an instruction causes the program counter to change (e.g. GOTO)
>         then two cycles are required to complete the instruction

I was partly wrong. The problem is with the stimulus files, which apparently
allows
you to change inputs _only_ after an integer number of STEPs
(corresponding to instructions, not Tcycles). Since STEPS may las 1 or
2 Tcycles, it is hard to fed the PIC with the exact timing, it depends
on what is actually running.

At least, this is from the docs; I haven't checked personally.

       Luigi
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: EraseMEluigispam_OUTspamTakeThisOuTiet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522              http://www.iet.unipi.it/~luigi/
====================================================================

1996\07\26@151315 by fastfwd

face
flavicon
face
Luigi Rizzo <PICLISTspamspam_OUTMITVMA.MIT.EDU> wrote:

> I was partly wrong. The problem is with the stimulus files, which
> apparently allows you to change inputs _only_ after an integer
> number of STEPs (corresponding to instructions, not Tcycles). Since
> STEPS may las 1 or 2 Tcycles, it is hard to fed the PIC with the
> exact timing, it depends on what is actually running.
>
> At least, this is from the docs; I haven't checked personally.

   Luigi:

   The simulator allows stimulus files to be based either on either
   instruction steps OR cycles.  For details, see the long message
   I posted to the list a day or two ago.

   As someone from Microchip (Darrel?) pointed out in a response to
   that message, the newest version of the simulator (MPLAB-SIM)
   ONLY allows stimulus based on instruction cycles.

   -Andy

Andrew Warren - @spam@fastfwdKILLspamspamix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\07\30@005034 by Robert Lunn
flavicon
face
> Of course, the Microchip documentation erroneously states
>
>         If an instruction causes the program counter to change
>         then two cycles are required to complete the instruction

> What they really should have said is that instructions that *may* change
> the program counter always take two cycles.

Rubbish, you can *change* the program counter without *altering* the
program counter.

___Bob

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