Shop OBEX P1 Docs P2 Docs Learn Events
Having problems with TUT022.SCR from Prog. the SX Microcont.-A complete guide — Parallax Forums

Having problems with TUT022.SCR from Prog. the SX Microcont.-A complete guide

bikejunkybikejunky Posts: 33
edited 2008-01-22 06:59 in General Discussion
·Hello I am working my way thru the Tutorial and I can't make the Debugger or the Simulator show me that the "Timer" register is decrementing. The program flashes the led fine with out the Debugger running.

I have had some problems the Debugger and/or the Simulator using interrupts. It is as if they ignore them totally, but when the program is run on the SX28 live, it works with out a problem.

I was just currious if I was doing something wrong, because I would like to be able to step thru the whole program including the interrupts to help me fully understand what was going on.


Thank

·Charlie

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2008-01-19 08:48
    Charlie,

    I have just tested TUT022 with SXSim, and it works as expected. As SXSim operates much slower than the real SX with a 50 MHz clock, it takes minutes until Timer decrements the first time when you run the program from SXSim. Single-stepping through the code might take you weeks to see Timer decrement, and maybe months until the LED toggles the first time.

    To speed up the code for debugging, you might change

    mov !option, #%10000111

    into

    mov !option, #%10000000

    This disables the RTCC prescaler, so RTCC increments on each clock cycle instead of each 256th clock cycle, and the ISR is invoked much faster.

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

    G
  • bikejunkybikejunky Posts: 33
    edited 2008-01-22 06:59
    thanks for the help

    Charlie
Sign In or Register to comment.