MPLab SIM question


Results 1 to 7 of 7

Threaded View

  1. #7
    Join Date
    Nov 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jerson View Post
    It may be possible to do what you want. Look under Debugger->SCL generator->New workbook->Register injection.

    Here you will find that you can specify a stimulus file. I haven't used this feature, but I'm sure that it works and will be wonderful to use. I have played a lot with the stimulus features and can encourage others to try the simulator.

    Let us know how it goes with the injection feature.
    I guess I picked a difficult one to simulate.

    The problem is that OWIN and OWOUT are both toggling the TRISB.4 bit (changing this pin between Input and Output) and therefore a constant "1" for PortB.4 (The DS18B20's DQ pin) did not work for me. What I did was create an asynchronous event for RB4 (set RB to High) and whenever my TRISB was 00010000 (RB4 is input), I just hit this asynchronous event that set RB to 1. If I was careful and hit this event at the right time, the "Busy" variable would finally be 1 and thus the program would finally get out of the infinite loop.

    I didn't play with the PORT/Register injection. I guess the easiest thing would be to define a value for RAWTEMP at the beginning of the program (just for debugging process) and see if my temperature conversion subroutines worked correctly (and they did ). I wanted to check the negative temperature read and conversion routine in particular since I was inside my house and the outside temperature was not below zero, or I didn't feel like pouring liquid nitrogen on the sensor (not that I had any liquid nitrogen in my house).

    If anyone else wants to take a shot at simulating the One-Wire commands correctly (from a timing point of view), good luck.
    Last edited by presario1425; - 3rd December 2007 at 21:29.

Similar Threads

  1. MPLAB SIM timing vs Real life
    By Bronurstomp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th July 2008, 16:32
  2. Linker/COFF debugging in MPLAB SIM
    By RichardBowser in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2007, 18:28
  3. Using MPLAB SIM
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th July 2006, 04:20
  4. Tracing code in MPLAB Sim
    By ErnieM in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th August 2005, 16:00
  5. pause loop lockup with mplab sim
    By power67 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2005, 13: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