Mplab Sim


Closed Thread
Results 1 to 16 of 16

Thread: Mplab Sim

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink I/O salad ...

    Hi,

    The first thing I see is you have mixed inputs and outputs ...

    ex; if PIR = 1 then ... etc.etc. ... and PIR is declared as an output ( possible ... but really surprising here !!! )

    same for "lights" ...

    Begin by checking all your I/0 declares ... ( 0 for OUTPUT and 1 for Input = simple !!! )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Apr 2007
    Posts
    5


    Did you find this post helpful? Yes | No

    Question Mplab Sim

    That is " if pir is high then...", same with the lights "if lights high then...".
    Or have I done something wrong?

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Hi,

    I've just tried to explain you you were reading your outputs instead of the inputs ...

    Of course, MPSIM has some trouble with that !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,
    I've just tried to explain you you were reading your outputs instead of the inputs ...
    Of course, MPSIM has some trouble with that !!!
    Alain
    The HIGH and LOW commands automatically set the respective pins to outputs....but the few input statement still won't work....

    Also, PIR is a named register on PICs. You might not want to use that name for a variable. Might mess you up in the future. Same with RESET (could be confused with the MCLR function somewhere sometime) and ACC (some might confuse that with Accumulator).

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Cool, cool ...

    Hi, Skimask

    the "reserved word" is PIR1 ... then, no Pb with PIR.


    Now look at output initialisation :

    - the named outputs are declared as inputs in the TRIS ... and vice-versa.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Skimask
    the "reserved word" is PIR1 ... then, no Pb with PIR.

    Now look at output initialisation :
    - the named outputs are declared as inputs in the TRIS ... and vice-versa.

    Alain
    PIR - just pointing the PIR out as well as the others for future reference, something that might cause a problem in the future.

    I/O - yep, noticed that right away, but you got to it first

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Hi, Skimask

    You know what ???

    I really DO HATE "tuning" ....

    LOL

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. MPLAB SIM timing vs Real life
    By Bronurstomp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th July 2008, 17:32
  2. MPLab SIM question
    By presario1425 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd December 2007, 22:22
  3. Linker/COFF debugging in MPLAB SIM
    By RichardBowser in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2007, 19:28
  4. Tracing code in MPLAB Sim
    By ErnieM in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th August 2005, 17:00
  5. pause loop lockup with mplab sim
    By power67 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2005, 14:10

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts