Shop OBEX P1 Docs P2 Docs Learn Events
If you RUN with internal clock on, it messes the sx up? — Parallax Forums

If you RUN with internal clock on, it messes the sx up?

Clock LoopClock Loop Posts: 2,069
edited 2007-08-19 14:30 in General Discussion
I never realized that if you try to RUN a program, (i.e. generate a clock from the sxkey) and have OSC4MHZ on this will mess up your SX program.

I understand that trying to hook up an external clock when running OSC4MHZ would mess up the sx program, but I always thought the sxkey wouldn't try to generate a clock if OSC4MHZ (i.e. the internal clock was ON)


Is this true?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.

Comments

  • BeanBean Posts: 8,129
    edited 2007-08-18 20:58
    What do you mean by "messes up your SX program."

    If you specifiy OSC4MHZ and hit RUN, the sx-key will NOT drive the SX, the internal SX clock will. When you debug the sx-key DOES generate the clock (even if you specify OSC4MHZ) because it has to to do the debugging.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • PJMontyPJMonty Posts: 983
    edited 2007-08-19 00:08
    BPM,

    If you're using OSC4MHZ, why would you try and also tell the SX to generate a clock? If you have programmed the SX for standalone (non-debugging) operation, then you should disconnect the SX-Key and reset your board to get it running on its own.

    Thanks
    PeterM
  • Clock LoopClock Loop Posts: 2,069
    edited 2007-08-19 06:25
    Is a sx-key board disconnection required for the SX chip to run properly in internal clock mode??

    I guess I could just run off the sx-key clock, but I always thought I could run both and not have anything be wrong.

    I noticed problems when allowing the sx to generate a clock and also allowing the sx-key to generate a clock.

    The problems only showed up when doing division. One would say that is a code problem, but the code works fine when doing debug mode.
    I also noticed that my problems did go away when debugging.

    So I am guessing that running an internal clock REQUIRES one to power off, and fully disconnect the sx-key.

    Otherwise if the sx-key needs to be continually connected, the sx-key should ALWAYS do the clock generation???

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Meh. Nothing here, move along.
  • PJMontyPJMonty Posts: 983
    edited 2007-08-19 14:30
    BPM,

    First, I'm curious what you mean when you say "problems." You're very vague on this issue.

    Second, please understand that having multiple clock sources simultaneously is never a good idea with CPUs. I'm not sure I follow what the reason is for leaving the SX connected. When you are debugging your program, you have the SX attached, and it generates the clock while you are running under the debugger. This programming is done via the Run->Debug menu. Once your program is finished and debugged, you program it one last time for standalone mode via the Run->Program menu. When this is done, you power off, dis-connect the SX-Key, and then re-power your circuit. In your case, you are using the internal clock in the SX so you don't have to make any changes to your circuit.

    There is really no time where you need to have the SX hooked up to a chip that has been programmed for standalone operation. Because of this, there is really no time where you need to worry about who is generating the clock since the SX is only hooked up during debugging, and not during standalone operation. So, 2 simple rules:

    1 - Hook up the SX for debugging under the IDE's debugger
    2 - Disconnect the SX after the chip is programmed for standalone operation and the programming phase is completed.

    Thanks,
    PeterM
Sign In or Register to comment.