EFX-TEK

TEK Talk => Prop-SX => Topic started by: crpalmer on December 30, 2008, 06:07:19 PM

Title: sx-key debugger is "sleeping"
Post by: crpalmer on December 30, 2008, 06:07:19 PM
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?
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on December 31, 2008, 12:01:56 AM
Do you have a resonator installed in the board?
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on December 31, 2008, 05:48:31 AM
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).
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on December 31, 2008, 09:45:04 AM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on December 31, 2008, 03:40:54 PM
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
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on December 31, 2008, 04:20:48 PM
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
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on December 31, 2008, 05:08:53 PM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: 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).
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 17, 2009, 08:21:40 AM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on January 17, 2009, 05:49:55 PM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 18, 2009, 06:00:46 AM
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?
Title: Re: sx-key debugger is "sleeping"
Post by: johnb on January 18, 2009, 07:26:17 AM
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
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 20, 2009, 06:03:04 AM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: johnb on January 20, 2009, 02:50:46 PM
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
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on January 20, 2009, 03:31:11 PM
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.
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 20, 2009, 04:35:25 PM
Quote from: johnb on January 20, 2009, 02:50:46 PM
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...

Yes, I have a resistor there so that sounds like that may really be the problem.  My soldering skills are pretty minimal which means I'll need to go with the cross-ship option.
Title: Re: sx-key debugger is "sleeping"
Post by: johnb on January 20, 2009, 06:13:50 PM
Okay, that's fine.  Can you reference the invoice that accompanied the order?  I need the Sales Order number or at least the date the order was made.  I will get a new (and freshly tested) Prop-SX out to you.  When you get the new one, just send the old one to me via snail mail.  The address will be on the new Sales Order.

Sorry about the trouble.

John B
EFX-TEK
Title: Re: sx-key debugger is "sleeping"
Post by: johnb on January 22, 2009, 08:24:36 AM
Hi Chris,
I found your invoice (to get your address, etc.) and have sent a freshly tested Prop-SX.  Here's the tracking number: 1Z759V1X0341152575
Please send the original Prop-SX and SX-Key back to:

EFX-TEK
214 Norfolk Drive
Knoxville, TN
37922
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 23, 2009, 04:38:46 AM
Quote from: johnb on January 22, 2009, 08:24:36 AM
Hi Chris,
I found your invoice (to get your address, etc.) and have sent a freshly tested Prop-SX.  Here's the tracking number: 1Z759V1X0341152575
Please send the original Prop-SX and SX-Key back to:

EFX-TEK
214 Norfolk Drive
Knoxville, TN
37922

I guess this means you didn't get the email I sent on Tuesday?  If so, thanks for taking the time to dig the info out yourself.  FYI, I sent the sx-key back on Tuesday.
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 27, 2009, 05:28:02 AM
I received the new Prop-SX last night.  I didn't have time to do a whole lot with it, but I loaded up Blink1.SXB (posted earlier in this thread) and had no problems debugging it.  I think that the resistor was the problem and I'm good to go now.
Title: Re: sx-key debugger is "sleeping"
Post by: crpalmer on January 29, 2009, 08:37:23 AM
As an FYI, it looks like the resistor you removed was doing something...

I have a program that sends data to a LCD display using serial I/O (clipped pin, on the ULN and all that).  If I run this with the SX-Key plugged into the Prop-SX and my computer, it works fine.  If I disconnect the USB for the SX-Key from the computer but leave the SX-Key attached to the Prop-SX then it doesn't work (either the serial communication is not working or it's not able to run at all).  If I unplug the SX-Key from the Prop-SX then it all works fine.

When I was doing this I had a 4MHz resonator and used the OSCHS1 device line.

Not a big deal, but wanted to let you know.
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on January 29, 2009, 09:45:24 AM
The USB SX-Key gets its power from the USB port, so if you disconnect the port it cannot generate a clock signal for the Prop-SX, and may in fact load the OSC pins and prevent a resonator from working.
Title: Re: sx-key debugger is "sleeping"
Post by: gmatocha on April 11, 2012, 08:49:10 AM
Hi,

I'm using a PropSX I've had on the shelf for a couple of years for the first time. I'm having the same problem described here, and the small resistor between the OSC1 and OSC2 pins is present on my board. I'm already using the latest version from Parallax - SXKey v3.3.0. I've been working around the debugging problem with an LDC display.

I could easily remove the resistor - do you still recommend removing the resistor as a fix? Since I'll probably never use another PropSX, using the SXKey debugger would be "nice-to-have" but not critical at this point. I would hate to damage the controller. Is this a pretty safe modification with no side effects?
Title: Re: sx-key debugger is "sleeping"
Post by: JonnyMac on April 11, 2012, 09:06:54 AM
If you're not using the SX debugger don't worry about it.