• AVR Freaks

Hot!Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time

Author
Ziknich
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2020/05/17 22:04:47
  • Location: México
  • Status: offline
2020/05/22 23:18:36 (permalink)
5 (1)

Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time

Good day to all. I'm doing a digital clock with the PIC18F45K50 using the MPLAB X IDE V5.30. When I Debug the program, the time measurment seems correct but the actual time that took for my PC to simulate it is aproximately 8.3333 minutes for each second.

What I mean is that the MPLAB's stopwatch in the Debug says it took 1s to complete my delay but my pc took 8.3333 minutes to execute that second. Does that mean that if a try my code in an actual PIC18F45K50, will not count time correctly?

The same happens in Proteus. Is that normal?
post edited by Ziknich - 2020/05/23 00:09:30
#1

9 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1753
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 00:42:26 (permalink)
    +1 (3)
    You didn't post your code for people to comment on.
    Did you configure correctly your OSCCON register if using internal oscillator?

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #2
    1and0
    Access is Denied
    • Total Posts : 10780
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 04:54:43 (permalink)
    +2 (2)
    Ziknich
    What I mean is that the MPLAB's stopwatch in the Debug says it took 1s to complete my delay but my pc took 8.3333 minutes to execute that second.
    ...
    Is that normal?


    Yes, computer execution is slower; although 8+ minutes is a bit long. Are you animating this; i.e. automatic single stepping? Go with the stopwatch timing, provided you've entered the correct oscillator frequency (or instruction frequency) in the project properties.
     
    post edited by 1and0 - 2020/05/23 05:00:25
    #3
    NorthGuy
    Super Member
    • Total Posts : 6085
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 07:33:42 (permalink)
    +1 (1)
    1and0
    Yes, computer execution is slower



    Strange. My computer instruction execution speed, although not exactly measurable, is roughly 1000 times faster than PIC16. If I were to simulate PIC16, I would expect it to run faster than the real one.
    #4
    1and0
    Access is Denied
    • Total Posts : 10780
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 08:48:55 (permalink)
    +2 (2)
    I was thinking of the "Animate" feature of the simulator in MPLAB8, which on my computer it takes 3+ minutes to animate 100 ms delay at the fastest animate step time. If you let it "Run" it will be fast. On that note, does MPLABX has this "animate" feature?
     
    #5
    upand_at_them
    Super Member
    • Total Posts : 437
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: online
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 09:37:05 (permalink)
    +1 (1)
    What computer and OS is Ziknich using?  I know on my machine (Pentium4, WinXP) simulating is slooooow.
    #6
    dan1138
    Super Member
    • Total Posts : 3496
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 10:29:53 (permalink)
    +2 (2)
    NorthGuy
    Strange. My computer instruction execution speed, although not exactly measurable, is roughly 1000 times faster than PIC16. If I were to simulate PIC16, I would expect it to run faster than the real one.

    For reasons unknowable the simulation tool in MPLABX is a whole lot slower than MPLAB v8.92 but then MPLABX supports a lot more controllers with vastly different architectures.
    #7
    upand_at_them
    Super Member
    • Total Posts : 437
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: online
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 12:10:36 (permalink)
    +1 (1)
    dan1138For reasons unknowable the simulation tool in MPLABX is a whole lot slower than MPLAB v8.92 but then MPLABX supports a lot more controllers with vastly different architectures.

     
    Does MPLABX use .NET?  That might explain it.
    #8
    ric
    Super Member
    • Total Posts : 27022
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/23 14:58:43 (permalink)
    +3 (3)
    upand_at_them
    dan1138For reasons unknowable the simulation tool in MPLABX is a whole lot slower than MPLAB v8.92 but then MPLABX supports a lot more controllers with vastly different architectures.

     
    Does MPLABX use .NET?  That might explain it.


    Worse, it uses Java.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    GlennP
    Super Member
    • Total Posts : 749
    • Reward points : 0
    • Joined: 2009/03/29 15:04:55
    • Location: El Paso County, CO, USA
    • Status: offline
    Re: Debuggin takes a long time, 1 second in simulation takes 8.333 minutes in real time 2020/05/24 07:00:18 (permalink)
    0 (2)
    upand_at_them ...
    Does MPLABX use .NET?  That might explain it.

     
    Until recently, .NET wasn't multi-platform.  I'm pretty sure MPLabX predates .NET Core.  So .NET could not have been used by MPLabX.
     
    Also, .NET's performance isn't bad after startup and assuming you have enough memory.  If you look at the Midori project (cancelled) at MSFT, you'd see an entire OS written in C# with an underlying structure almost identical to a contemporary .NET.  Performance was decent.  As ric implies, .NET's performance is better than Java's.
     
    GP
    #10
    Jump to:
    © 2020 APG vNext Commercial Version 4.5