1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

simulation tutorial? Asynchronous interrupts?

Discussion in 'Embedded' started by mike, Apr 20, 2014.

  1. mike

    mike Guest

    I'm writing simple programs for a PIC 16F877A.
    Attempting to simulate with MPLAB.

    Linear code...no problem.

    But I've never written a program that didn't have
    multiple asynchronous interrupt inputs and timers.

    The MPSIM seems to fall apart in that instance.
    Yes, there are ways to simulate inputs, but the
    asynchronous nature is where all the problems happen.

    State another way, no problem simulating things that
    can be fixed by inspecting the code. Adding test code
    messes up the timing.

    Is there a tutorial on dealing with asynchronous
    microcode? Tips for organizing code to minimize
    those asynchronous problems? Simulation of same?

    Better freeware simulator?
    mike, Apr 20, 2014
    1. Advertisements

  2. mike

    Ian Malcolm Guest

    MPLAB 8 has a fairly comprehensive Stimulus Control Language (SCL) for
    scripting the simulator's 'inputs'. As the simulator is a discrete
    digital simulation with single instruction cycle time resolution, any
    effects on a finer timescale than that cant be simulated.

    SCL is a subset of VHDL and you can find out more about it here:


    Although MPLAB X supports SCL, its simulator is known to be fairly buggy
    and I'd stick to using MPLAB 8 SIM for now.

    Some people like the PIC simulator in Proteus, (fairly expensive
    commercial product), but, of forum posts mentioning Proteus, the
    proportion about code and circuits that simulate OK but fail to work in
    real life is pretty high.
    Ian Malcolm, Apr 20, 2014
    1. Advertisements

  3. mike

    Paul Rubin Guest

    You should probably read a book about operating systems. Back in my
    day, Tanenbaum's book was actually ok. I don't know what the current
    favorites are.
    Paul Rubin, Apr 20, 2014
  4. mike

    mike Guest

    I stand by my original statement, but it's not worth argument.
    At $58.36 that ain't gonna happen.

    The question was about simulation.
    You and I know how to examine code and determine the effects of
    asynchronous interrupts.
    Problem is that the person I'm trying to help can't grasp the concept.
    I'm trying to offload my involvement so he can use simulation.
    Sometimes, you do stuff for friends that you'd not do for strangers.
    I can't just tell him to FOAD.
    mike, Apr 21, 2014
  5. mike

    Tim Wescott Guest

    I didn't realize you were asking for someone else. The right answer, in
    my humble opinion, is to get it right by design. But yes, giving someone
    tools so that they can hopefully succeed while doing it their way is

    I can't help you there -- I just work hard do it right from the git-go...
    Tim Wescott, Apr 22, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.