Shop OBEX P1 Docs P2 Docs Learn Events
can I run the SX Tech board without the Key? — Parallax Forums

can I run the SX Tech board without the Key?

JoeAJoeA Posts: 33
edited 2008-09-26 23:21 in General Discussion
I have an SX tech board and the serial SX-Key (ref F) connected via a USB converter (rev B), and am using SX-Key v.3.2.3 software.
If I download a program with the key connected, everything works fine, but if I disconnect the Key, the SX won't run on its own (the Tech board is still powered by the 7.5v adaptor).· Do I need some additional circuitry?· I didn't have a resonator plugged in to the socket.
I was hoping to be able to program multiple SX's with the same Key (one at a time, of course.)
Joe

Comments

  • VelocitVelocit Posts: 119
    edited 2008-09-23 21:56
    If your program uses the internal oscillator, you should be fine without anything additional. If it uses a resonator, then you'll need one of those. When you program the chip, make sure you hit the "Program" button (control + P). Any other command (i.e. run or debug) won't work without the SX-Key attached.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Paul
  • JoeAJoeA Posts: 33
    edited 2008-09-26 14:28
    Paul, Thanks for the suggestion.· I tried it, but·I'm still not seeing the behavior·I expected.
    I'm not sure about the oscillator settings--I copied the first part of the program from a tutorial.
    Using the SX Key Assembler, I assembled a program and then, with the·Key installed,·clicked Program.
    The popup says the program downloaded successfully, but the program·is not running on the Tech board while the key is installed.
    Then when I remove the key, the program runs once (or briefly).· If I press the reset button on the Tech board, the program no longer runs.
    Reinserting and removing the key (without clicking Program or any other software activity) causes the program to run once more. It seems it is the removal of the key that causes the program to run.
    In fact, I'm not even sure the program is still running with the key removed--the program ends with an input-output loop, but the program does not respond to changed input--the outputs at the time of key removal are "frozen".
    device sx28L,oschs3
      device turbo,stackx,optionx
      IRC_CAL IRC_SLOW
      reset start_point
      freq 50000000 ; 
      org 0
      ;set RA 3210 pins to input
    start_point mov W,#%00001111 
      mov !ra,W
      ;set RB RC all pins to output
      mov W,#%00000000
      mov !rb,W
      mov !rc,W
      ;output constant to RC
      mov W,#%1001_1001
      mov rc,W
    loop
      ;input RA
      mov W,ra
      ;output to RB
      mov rb,W
      jmp  loop
      sleep
    

    I thought pressing RESET on the board would re-run the program, as it does in RUN mode, but in PROGRAM mode, it is behaving as if removing the Key is·running it--and only briefly.· The program ends with a loop, but the loop is inactive once the key is removed.· Is there some code or external wiring I need to rerun the (presumably) stored SX program without using the Key?
    Joe
  • PJMontyPJMonty Posts: 983
    edited 2008-09-26 23:09
    Joe,

    You didn't indicate if you put the resonator in after removing the SX-Key and then hitting the reset button. Without a resonator or other clock source, how do you expect the SX to run? It's like a car with an empty gas tank - looks pretty but just sits there.

    Thanks,
    PeterM
  • ZootZoot Posts: 2,227
    edited 2008-09-26 23:15
    What PJMonty said.

    But you can test to see *where* things are breaking down -- I would try changing your freq and osc directives to use the internal RC oscillator. (4_000_000 and OSC4MHZ). Then see if the program runs without the key connected and without a resonator/crystal in place.

    If it works, then you know you've got a freq/resonator/key conflict... try it again with 50_000_000 and OSCHS2, then run again without the key connected and *with* a 50mhz resonator in place. Also, do you have a 10k or so resistor connected beween osc1 and osc2 (the resistor is generally a good idea to startup the resonator properly -- see the SX datasheet. The big ceramic DIP resonators already have the caps· inside them, small surface mount resonators do not).

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

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2008-09-26 23:21
    Joe,

    in your program code, you have configured the SX to generate a 50 MHz system clock from an external crystal or ceramic resonator connected to the OSC1 and OSC2 pins.

    With the SX-Key attached to the SX Tech board, the SX-Key will first program the SX28 on the SX Tech board, when you select "Run - Run" from the SX-Key IDE (or press Ctrl-R instead), and it then will supply the 50 MHz clock to the SX Tech board.

    With the SX-Key removed, the SX28 on the SX Tech board needs a crystal or resonator to be attached to the OSC1/OSC2 pins instead, for generating the clock signal. In your case, you should plug the 50 MHz resonator (the blue 3-legged device that came with the SXTech Board, with a print reading like 50.00 on it) into the 3-pole socket on the SX Tech board.

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

    G
Sign In or Register to comment.