Shop OBEX P1 Docs P2 Docs Learn Events
sxsim rtcc skip count — Parallax Forums

sxsim rtcc skip count

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2009-02-12 18:21 in General Discussion
Hi,

The attached program simply increments a 32bit timer in the interrupt.
I noticed that in SxSim 2.08.05 that on a snz instruction with Z=0
that rtcc increments by 3. Datasheet says a skip takes 2 cycles.
device  SX48,OSCHS2
freq  25000000
reset  _reset
  org $30
dvpTimer1 ds 1
dvpTimer2 ds 1
dvpTimer3 ds 1
dvpTimer4 ds 1
;first isr run should take 4([url=mailto:jmp@)+3(call)+10(sub)+1(mov]jmp@)+3(call)+10(sub)+1(mov[/url] w)+3(retiw) = 21 cycles
       ;first run
  ORG $000
  jmp @dvpTMR_vector  ; 4  4
_reset
  mov fsr,#dvpTimer1
  clr ind
  mov w,#$88
  mov !option,w
  mov w,#$F8
  mov rtcc,w
  jmp $
dvpTMR_vector
  call dvpTMR_S0  ; 3   3
  mov w,#(-217)&255  ; 1   1
  retiw    ; 3   3
dvpTMR_S0
  inc dvpTimer1  ; 1       1
  snz    ; 1/2     2 (NZ)
  inc dvpTimer2  ; 1
  snz    ; 1/2     2
  inc dvpTimer3  ; 1
  snz    ; 1/2     2
  inc dvpTimer4  ; 1
  retp    ; 3       3



SxSim bug?

regards peter

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-02-12 11:27
    I just downloaded and installed sxsim v2.08.06 and that shows rtcc increments 2 on skip.
    Problem solved.
    Apparently the latest IDE v3.2.92h beta installs sxsim v2.08.05

    regards peter
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2009-02-12 18:21
    Peter,

    sorry for the mess-up...

    The SX-Key IDE not always auto-installs the most recent version of SXSim. This is because Peter and I sometimes run out of sync when releasing new versions. So, the best idea is to always check if there is a newer version of SXSim available in the "sticky" SXSim post in this forum section after you have installed a new version of the IDE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.