Shop OBEX P1 Docs P2 Docs Learn Events
Device settings and debug — Parallax Forums

Device settings and debug

$WMc%$WMc% Posts: 1,884
edited 2009-01-29 02:50 in General Discussion
Hello All

I want to speed the clock up on the SX28 to 50Mhz. I set the device settings to.

DEVICE········ SX28, OSCHS2, TURBO, STACKX, OPTIONX
FREQ············50_000_000
ID················"COUNT"

Is this the correct Directive to use? I'm not sure the syntax is right Because now the DEBUG terminal doesn't seem to work.The DEBUG worked great with the 4MHz internal Oscillator.

I'm trying to count a·77kHz Sq. wave signal·(clock) from a serial device. I found that the SX28 would only read to 5 kHz with the 4MHz OSC. and the example program "COUNT.SXB". I'm using a BK-Precision Function Generator with a 5volt sq.wave to mimic the clock.

I'm new to the SX28 and the SX-Key, Also the SK-Key v3.2.92h BETA software.

Thanks in advance for any help here.

__________$WMc%_______

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············································ BoogerWoods, FL. USA

Comments

  • ZootZoot Posts: 2,227
    edited 2009-01-28 02:01
    Your settings are correct. Remember that the DEVICE line is *irrelevant* for debug -- in debug mode, the FREQ directive tells the SX-Key what clock speed to generate; when running standalone, the DEVICE line OSC directive tells the SX what "range" of clock may be attached, but the clock speed will be whatever the clock (i.e. resonator, crystal, oscillator) actually generates.

    Also, when debugging, you need to make sure that your header pins are clean, you've got a solid connection with the SX-Key, that the external resonator/crystal/clock is removed. Otherwise you may not get a good connection for debugging (often manifested in the debug buttons like "stop", "run", etc. being "grayed out").

    Do you want to post your code if you're still having trouble?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Mark HubersMark Hubers Posts: 19
    edited 2009-01-28 02:01
    Hi $WMc%
    You cannot do any debugging with the SX-Key at 50Mhz. You can only use the debugger up to 4Mhz.

    Mark
  • ZootZoot Posts: 2,227
    edited 2009-01-28 02:23
    Umm, Mark Hubers, I don't think that is accurate. I've got two projects on the bench now that I am debugging -- one at 20mhz, one at 50mhz. At 50mhz, noise, dirty connections, etc. can certainly break the comm., but it's certainly doable.

    I know that some folks report varying success w/debugging 50mhz+ on the USB key, but Bean and others can probably address that specifically.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • ZootZoot Posts: 2,227
    edited 2009-01-28 02:26
    In fact, 50mhz is considered a "default" debugging speed for the SX-Key (it's the default FREQ when none is chosen):

    SX-Key Manual said...

    The following is required to use the debug features:
    • SX-Key Rev. E (or greater) – The SX-Blitz cannot be used for debugging.
    • SX chip date code 9825 or later.
    • No external clock source connected to the SX chip. This includes oscillator packs, crystals,
    resonators and RC circuits.
    • The SX-Key connected to the 4-pin programming header of the SX system to be debugged.
    • The SX system must be powered.
    Source code to be debugged must include the RESET directive (see Chapter 7.3.21), must have
    WATCHDOG set to off, and must have 2 free words in the first page of code and 136 free words near
    the end of the last page of code (from 177 to 1FE, 377 to 3FE, 577 to 5FE, 777 to 7FE, 977 to 9FE, B77 to
    BFE, D77 to DFE, F77 to FFE), depending on the number of E2Flash pages. If an oscillator frequency of
    other than 50 MHz (the default) is desired, the source code should contain a FREQ directive (see
    Chapter 7.3.9) stating the frequency. When the FREQ directive is missing, the assembler will generate a
    warning message, indicating that 50 MHz is used by default.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Mark HubersMark Hubers Posts: 19
    edited 2009-01-28 02:38
    Zoot,
    Sorry I should have not said it that way. I never had luck getting it to work pass 4Mhz. [noparse];)[/noparse]
  • BeanBean Posts: 8,129
    edited 2009-01-28 12:20
    For the USB version of the SX-Key 20MHz should be the most reliable debug frequency.

    P.S. You should be able to COUNT up to 40KHz with the 4MHz clock. If you post your complete code, it would help us help you.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2009-01-28 23:58
    Hi all,

    you may ask why 20 MHz is the most reliable debug frequency. The answer is pretty simple: During debugging, the SX-Key has to communicate with the SX under test periodically in order to update the the status display, and for other tasks. This communication requires that the SX under test is clocked at a well-defined clock rate to sync up with the SX-Key. During debugging, the SX-Key supplies the clock for the SX under test generated by an on-board variable clock chip. During debug communication, the SX-Key switches this clock to 20 MHz, and after the communication is done, it returns back to the clock frequency specified with the application'a FREQ directive.

    When 20 MHz is defined by the FREQ directive, there is no need at all for the SX-Key to switch the clock frequency before and after the debugging communication, so this is why 20 MHz is most reliable.

    Nevertheless, debugging usually works fine at slower and faster clocks as well. Most of my SX-based designs are either clocked at 50 MHz or at 4 MHz, and I never had problems with the SX-Key at these frequencies, although I found out that the new SX-Key USB is more critical when the parasitic loads (capacitive or inductive) on the OSC1 or OSC2 lines are too high due to long or distrubuted traces for these signals. Therefore, it is a good idea to keep both of them as short as possible, especially for higher clock frequencies, like 50 MHz.

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

    G
  • $WMc%$WMc% Posts: 1,884
    edited 2009-01-29 02:50
    Hello All

    Thanks for ALL the help!

    Zoot: I cleaned the pins on My ProDevBoard,That did the trick.

    Bean: I came up with around 40kHz with a clock speed of 4Mhz? I dont now why 5kHz is the limit?

    Mr.Daubach: Thanks for the info on the SX-Key. This explains the glitches I was seeing.

    Heres the code.
    Its right out of the examples with the OSC speed changed.I've tried 4 - 20 -50 - 75Mhz OSC speed 39kHz seems to be the fastest I can read!

    I dont want to push the SX28 to the MAX, I'm sure some code mod.s will make this work at around 20Mhz OSC speed to read a 77kHz signal clock. After I get a stable read on the 77kHz clock signal, I have two 24 bit words to read, I'll need to oversample or read them 2 to 3 times for error checking,But thats is a ways off.·


    _____Thanks Again for the help___________$WMc%_____

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA

    Post Edited ($WMc%) : 1/29/2009 3:19:44 AM GMT
Sign In or Register to comment.