Shop OBEX P1 Docs P2 Docs Learn Events
Device config window, and Device Directive in code listing... — Parallax Forums

Device config window, and Device Directive in code listing...

dkemppaidkemppai Posts: 315
edited 2004-10-27 20:37 in General Discussion
Hi all,

I'm having a little trouble programming my SX chips to work correctly with the 50mHz
ceramic resonators. Also I'm having trouble with the "Device" window behaving poorly.

My main problem is that the SX-Key software appears to override any device directives
listed in the code. OSCHS2, for example will not be properly programmed into the SX chip,
unless the "Device" window is updated the correct oscillator also. Also, the "Device" window
settings are not saved·at all. Thus on subsiquent restarts of the·SX-Key software, previous configurations are lost.

Maybe I'm missing something here, but I would think that the code directives should override
the SX-Key directive?!? I would think that this would help to ensure proper directive being programmed into the chip.

Also, the "Device" window seems unreliable at times. Clicking on some check boxes and radio buttons· 'greys' out some settings that are avaliable when the window is open even when they appear to be unrelated. (Changing boxes and buttons back does not return the options)

Any insights that I'm missing???

Thanks!
Dan
·

Comments

  • PJMontyPJMonty Posts: 983
    edited 2004-10-27 17:04
    Dan,

    My personal advice (others pay disagree) is to treat the device window as basically a "read only" dialog. All settings you want to make need to be in your "DEVICE" directive(s) in your code. Anything you have in the code will supercede the device directive and set the various checkboxes, etc on it.

    Try this experiment:

    1 - Load the source for a working project into the editor

    2 - Open the device window and move it so you can still see it when the you are working in the editor.

    3 - Assemble the code.

    4 - Change the DEVICE directive in the code so it uses a different chip. For exampl,e, if you're using the SX28 in the DEVICE directive, change it to SX48

    5 - Assemble the code while watching the device window.

    You'll see that as soon as you assemble the code, the device window is updated to reflect the DEVICE directive in your code. The moral of this story? Don't try and "set" things in the device window, just treat it as a way to load and save hex files, and to visually confirm your DEVICE directives.
      Thanks, PeterM
  • dkemppaidkemppai Posts: 315
    edited 2004-10-27 18:33
    PJMonty said...
    Try this experiment:

    1 - Load the source for a working project into the editor

    2 - Open the device window and move it so you can still see it when the you are working in the editor.

    3 - Assemble the code.

    4 - Change the DEVICE directive in the code so it uses a different chip. For exampl,e, if you're using the SX28 in the DEVICE directive, change it to SX48

    5 - Assemble the code while watching the device window.
    I figured it out...· ...Sort of...·· ...but it doesn't·work as expected, always...

    If the directives are ordered improperly, it appears that the default setting are recalled...

    Try the directive like this...
    DEVICE·SX28L···· ;28 pin chip
    DEVICE· OSCHS2··;(OSC or External TTL OSC)

    Then try the directive like this...
    DEVICE· OSCHS2··;(OSC or External TTL OSC)
    DEVICE·SX28L···· ;28 pin chip

    You will get different results with Each example...

    Ok, so the question is, what is the proper order of operations when
    setting the device directives in code???·

    Is the directive specifying·which mcu is the target device the only important one?

    -Dan
  • BeanBean Posts: 8,129
    edited 2004-10-27 18:45
    I always but all the directives on one DEVICE line and never had a problem.

    Bean.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-27 20:37
    Bean,

    I can only confirm this - I always use the DEVICE line in the source code to configure the SX.

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


    G
Sign In or Register to comment.