#138 Computed GOTO cycle timing wrong

closed-fixed
None
5
2013-03-24
2012-03-22
Anonymous
No

I run the following code in gpsim, Using the GUI stopwatch, one trip through the loop is reported as 5 cycles. On the hardware, this takes 6 cycles since modifying PCL causes a stall while the new (computed) instruction is fetched. Essentially, it looks as if gpsim counts instructions which modify PCL diretcly as taking one cycle to execute, when they should take two cycles.

list P=PIC12F508
#include <P12F508.INC>

ORG 0

MAIN_LOOP:
movlw 0
addwf PCL
nop
goto MAIN_LOOP

END

Discussion

  • Roy Rankin

    Roy Rankin - 2013-03-24
    • assigned_to: nobody --> roy_r_rankin
    • status: open --> closed-fixed
     
  • Roy Rankin

    Roy Rankin - 2013-03-24

    The data sheet is unclear about this clarified in this exchange http://www.microchip.com/forums/m27650.aspx
    Code tried to do right thing but failed.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks