November 26, 2024, 01:47:05 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


sx-key debugger is "sleeping"

Started by crpalmer, December 30, 2008, 06:07:19 PM

Previous topic - Next topic

crpalmer

I just got my first prop-sx and sx-key (usb).  I installed the 3.2.92h version of the SX-Key IDE.  I cut and paste in an ever popular led test program and put a prop-1 trainer on the prop-sx.  Programming the prop-sx worked fine and my led blinked on and off.  This looks like the controller is working fine, and that I have the USB setup correctly.

However, when I try to debug the same program it almost always says "Sleeping" at the top of the debugging window.

This sounds vaguely like some things I read on the parallax forums about defective sx-key's, such as

http://forums.parallax.com/forums/default.aspx?f=7&m=309601&g=309646#m309646

but they seem to say setting the freq to 20MHZ solves the problem.  Doing that didn't change anything for me.  Is there something stupid that I am doing or anything that I should try to figure out what's wrong?

JonnyMac

Do you have a resonator installed in the board?
Jon McPhalen
EFX-TEK Hollywood Office

crpalmer

Nope, no resonator.  Just the sx-key and the power supply are plugged into the prop-sx (even removed the prop-1 trainer, just in case).

JonnyMac

Can you attach your code.  I've been programming the SX for a long time so I have standard serial keys -- I'll get a USB-Key and give it a try to see if I can help with this.
Jon McPhalen
EFX-TEK Hollywood Office

crpalmer

One other thing that I just found.  If I keep clicking reset on it it will eventually be "idle" instead of sleeping.  When it's idle, I can double click an assembly line to set the PC to that line.  When I do this, it says "Chip connection failed".

I've tried all kinds of combinations of directives / frequencies and nothing much changes, I just added the interrupt handler to see if that might be needed.  I've tried this with some C generated code and different SX/B code.  The code that I last ran was:

' BLINK1.SXB

DEVICE          SX28
FREQ            4_000_000


Led             PIN     RB.0

interrupt
   return

PROGRAM Start

Start:
  HIGH Led
  GOTO START

JonnyMac

Try this version -- the one above has important information left out of the header (like clock source) and other details needed by SX/B.

' BLINK1.SXB

DEVICE          SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42
FREQ            4_000_000

Led             PIN     RB.0

PROGRAM Start

Start:
  HIGH Led
  PAUSE 100
  LOW Led
  PAUSE 100
  GOTO Start
Jon McPhalen
EFX-TEK Hollywood Office

crpalmer

Aside from the brown-out directive, I think that was the first version I started with.  Hard to remember for sure.  But it does the same thing (reports "sleeping" and if I keep clicking reset it eventually ends up idle and if I double click on an address it says "chip connection failed").

I rebooted my laptop to make sure it wasn't some funky windows issue but it's doing the same thing after a fresh boot.

JonnyMac

It could be the USB SX-Key; there have been a few issues reported.  If it is we'll exchange it for you (assuming you bought the Key from us -- we don't sell many).
Jon McPhalen
EFX-TEK Hollywood Office

crpalmer

Quote from: JonnyMac on December 31, 2008, 06:27:03 PM
It could be the USB SX-Key; there have been a few issues reported.  If it is we'll exchange it for you (assuming you bought the Key from us -- we don't sell many).

I got the replacement last night (this one is a Rev. B SX-Key, the first one was a Rev. A) and I'm still seeing the same behaviour.

I've tried 2 computers, 3 USB cables.  I onl have the 1 prop-SX to test with which means it seems like it's either me or the prop-SX somehow.  The best of "me" is to tell you what I did to test on the second computer:

* downloaded and installed SX-Key® Software v. 3.2.92h BETA (5.90 MB) - includes IDE, SX/B Compiler (v1.51.03), and Help Files, and supports the SX-Key (USB).
* it installed the USB driver
* I copied your blink code into the editor
* There is no resonator on the board
* I have a prop-1 trainer on P0-P7
* I have a ULN that has no PIN7 (is that the 2803 or something?)
* I have the same on the upper pins, except I also clipped the P14 pin on the ULN
* Run >> Debug it erases and then goes to debugging mode
* It says "sleeping"

Any other suggestions for things to try?  I could try another power supply (but I think I would need to dig out a prop from last year to try using a second power supply I purchased from you).  The one I am using now was purchased from you so there shouldn't be anything unusual about it.

JonnyMac

I'm pretty sure it's not a bad Prop-SX -- we test them pretty carefully, and I was able to duplicate the issue with a Rev A USB SX-Key. 

Try this before we exchange the controller: set the frequency to 20 MHz and give it a try.  I found a tread in the Parallax forums where this seemed to solve the problem (which appears to be some issue between the IDE and the new USB SX-Key).  The USB SX-Key has been tricky for Parallax because the clock generator used on the original key is no longer available; the new clock generator device seems to be very finicky.
Jon McPhalen
EFX-TEK Hollywood Office

crpalmer

Quote from: JonnyMac on January 17, 2009, 05:49:55 PM
Try this before we exchange the controller: set the frequency to 20 MHz and give it a try.  I found a tread in the Parallax forums where this seemed to solve the problem (which appears to be some issue between the IDE and the new USB SX-Key).  The USB SX-Key has been tricky for Parallax because the clock generator used on the original key is no longer available; the new clock generator device seems to be very finicky.

I agree that it is really unlikely to the Prop-SX.  I really feel like the most likely is that there is something really stupid that I'm doing which is why I was trying to be very explicit in the steps I followed.

The 20Mhz hack was actually one of the first things I tried (I think we probably found the same thread at parallax).  But I'm not sure what device line I used so I just retried a few.  All had:

FREQ            20_000_000

and I tried all of these:

DEVICE          SX28, OSCHS1, TURBO, STACKX, OPTIONX, BOR42
DEVICE          SX28, OSCHS2, TURBO, STACKX, OPTIONX, BOR42
DEVICE          SX28, OSCHS3, TURBO, STACKX, OPTIONX, BOR42
DEVICE          SX28, OSCRC, TURBO, STACKX, OPTIONX, BOR42
DEVICE          SX28, OSCXT2, TURBO, STACKX, OPTIONX, BOR42

and all had the "Sleeping" behaviour when I tried to debug them.  I did not have a resonator plugged in and I cycled the power on the prop-sx after removing the resonator that was in there.

I have to admit I don't understand the different OSC___s and what they apply for.  When I first started I noticed some things didn't work that I would expect but I assumed that was just me.  I'll mention it here in case it is indicative of anything being wrong.  If I use 20Mhz resonator then all the settings I expect would work do work (OSCXT2, OSCHS1-3).  If I use a 4Mhz resonator then OSCHS1 and OSCXT2 work (led blinks) but OSCHS2 & 3 and OSCXT1 don't (no led blinks).  Is that normal?

johnb

Hi there,
One thing that the SX-Key is persnickety about is the power supply.  Please be sure that it can supply 1 Amp or more at the rated regulated voltage.  Also, it needs to supply a clean voltage (i.e. no electrical noise).  A PC power supply will not work and should not be used.  Can you please measure the output voltage?  Also, what voltage and current is the power supply rated for?

John B.
EFX-TEK

crpalmer

The power supply that I'm using is the 12V/1000ma that you sell.  After checking the one I've been using, I dug out two other power supplies and they all exhibit the same behaviour.

The voltages on them are 12.2V, 12.35V and 12.4V.

johnb

Hi Chris,
I got everything set up to replicate the problem and saw the same thing you are seeing, so I began troubleshooting.

I encountered two problems, but likely only one of them is causing you grief: there is a 10K resistor across OSC1 and OSC2 that should not be there.  You can confirm/deny this - just look at the left side of the SX chip on your Prop-SX.  If you see a small resistor between the SX chip and the pads for the SMD resonator, then you've found the problem too.  If you are comfortable with a soldering iron, you can simply remove the resistor from the board.  If not, let me know and I will arrange to have a cross ship.
The other problem is that my software was old.  I went to the Parallax site to download the latest.  Now everything works perfectly.
Let me know what you find...

John B
EFX-TEK

JonnyMac

Good catch, JB, I just confirmed here in the LA office as well.  Must be that the new clock generator circuit doesn't have the same drive capability as the old serial SX-Key.  I whipped up a little test program that would Debug properly with a Rev. A USB SX-Key and after downloading a normal program (Debugging instructions removed) it ran fine stand-alone using a resonator.
Jon McPhalen
EFX-TEK Hollywood Office