Erratic behavior with SX Tech Board and SX Key Software 3.2.92h BETA
One minute it programs straight and works fine, next minute I get errors. The debug mode also acts up. Seems like 3.2.92h is the only version I can use for the USB key. Is there no non-beta version I can use?
What I've been doing;
- plug usb into SX Key,
- plug key into tech board
- power up using clean 5v supply.
- load SX Key 3.2.92h beta.
- load led28.src, run, works fine most of the time.
- sometimes load the first program I made TUT001.src, then assemble
- click debug
- never even gone near the kit without static protection
- never hooked anything up backwards, etc.
Problems:
- In debug window, with TUT001.src sometimes I click walk and it steps through on it's own, no problem. Then I click stop, it stops. After toggling walk on and off a few times it stops stepping through by itself and says "sleeping" in the top window, buttons blank out.
- Sometimes it lets me step through manually with the step button and keep looping through, sometimes it takes one step then says "sleeping" again.
- At random times one second I hit run to program the chip, it works, next minute without changing anything it says it cannot find the chip, sometimes half way through the programming process.
- when I disconnect and run the board by itself, 90% of the time led28.src blinks the led fine, sometimes it cuts out.
- the led either never blinks or blinks erraticly when TUT001.src is loaded and the board stands by itself.
Variations I've tried:
- 5v, 7.2v and 9v supplies, tried wall adapters and batteries, no difference.
- 3 different USB cables, no difference.
- keeping all signal cables away from power lines and as close to PC as possible.
- sometimes the reset button in debug window corrects the issues, sometimes it does nothing.
- moving led and commands in TUT001.src to rb.1, rb.2, etc
~ Shawn shot it, and now it's for sale... http://www.ArtWanted.com/skSeattle
What I've been doing;
- plug usb into SX Key,
- plug key into tech board
- power up using clean 5v supply.
- load SX Key 3.2.92h beta.
- load led28.src, run, works fine most of the time.
- sometimes load the first program I made TUT001.src, then assemble
- click debug
- never even gone near the kit without static protection
- never hooked anything up backwards, etc.
Problems:
- In debug window, with TUT001.src sometimes I click walk and it steps through on it's own, no problem. Then I click stop, it stops. After toggling walk on and off a few times it stops stepping through by itself and says "sleeping" in the top window, buttons blank out.
- Sometimes it lets me step through manually with the step button and keep looping through, sometimes it takes one step then says "sleeping" again.
- At random times one second I hit run to program the chip, it works, next minute without changing anything it says it cannot find the chip, sometimes half way through the programming process.
- when I disconnect and run the board by itself, 90% of the time led28.src blinks the led fine, sometimes it cuts out.
- the led either never blinks or blinks erraticly when TUT001.src is loaded and the board stands by itself.
Variations I've tried:
- 5v, 7.2v and 9v supplies, tried wall adapters and batteries, no difference.
- 3 different USB cables, no difference.
- keeping all signal cables away from power lines and as close to PC as possible.
- sometimes the reset button in debug window corrects the issues, sometimes it does nothing.
- moving led and commands in TUT001.src to rb.1, rb.2, etc
~ Shawn shot it, and now it's for sale... http://www.ArtWanted.com/skSeattle
Comments
Found nothing in the FAQ about adding more capacitance.
The power supply is a 5v, 1a phone charger, should be smooth enough but I'll try adding an extra capacitor. Other than that I've tired other voltages between 6 and 9, and with batteries as well.
I have 2 resonators, 4mhz and 50mhz but have not hooked them up to the board. I read it can hurt things if you program or debug with a resonator plugged in.
I have no idea how to use internal or external clock. My choice would be internal but nothing was written in the books I got with the kit about how to set up a clock, at least not in the beginning when they tell you how to hook up and start programming.
I thought maybe something in the run (settings) menu may help but again, no clue how to set up internal clock and what each choice would do.
For active debugging you need to have any external clock sources removed (resonator, TTL osc, etc) so the SX-Key can act as the clock for the Target SX chip. Also when debugging the normal program that you've written isn't the only code in the chip. The debugger adds a little so that it can single step and control your program. If you select "Program" and reload your code then you just put your program in the chip without the debug code. Without the debug code in the chip some of the debugging options won't work.
A resonator can be left connected for programming but it must be removed for debugging. The other clocks (TTL osc, etc) have to be removed for programming and debugging.
If timing isn't critical for your project then you can certainly use the internal clock. The SX-Key can calibrate it during programming to make it a bit more accurate. However, if you are doing serial communications or other tasks that require an accurate and stable clock source then you are better off using a resonator or one of the TTL osc devices. Most of the time I have used a 4Mhz of 20Mhz resonator and they have worked out well. The 50Mhz is good when you need the extra speed. Just make sure you specify the matching decription in your code.
I would try programming the chip and using those resonators. Your program will probably run fine.
Robert
I did this:
- plugged a 4mhz resonator in.
- Went into Run>Clock and set that to 4mhz.
- Hit Program to reload.
Results: more stable in that I can now always see the results of programming. The LED is on now but blinks somewhat erraticly
Then tried:
- plugged a 50mhz res in
- Went into Run>Clock, set it to 50mhz
- Hit program
Results: more stable but blinking so fast it's hard to tell how much so.
I tried looking in Run>Device to see if something may need to be set up in there but it's confusing. Right now settings are
- Device: SX28 (the chip I'm using), Brownout: Off, Oscilator:Crystal-HX2 (this doesn't seem right), Crystal Drive: checked, Crystal feedback: checked, Options: only Turbo Mode and Stack + Option are checked, Reset Timer: nothing is selected.
For all tests listes above I used the following code:
;================================================
;Programmin the SX Microcontroller
;Tut001.src
;================================================
LIST Q = 37
DEVICE SX28L, TURBO, STACKX, OSCHS2
IRC_CAL IRC_FAST
FREQ 50_000_000
RESET 0
mov !rb, #%11111110
Loop
clrb rb.0
setb rb.0
jmp Loop
Post Edited (Shawn_nwahS) : 6/1/2009 1:00:00 AM GMT
Chuck
I second Chuck's suggestion RE the power supply. Like a dummy, I tried using a 1 Amp'er, instead of the recommended > 1.5 amp flavor. The "chip not found" error happened about 1 out of 3 or 4 times... I just kept clicking program... well that get's old when you've got lots to do... found a ref to this somewhere... yeah, it might have been in Gunther's great book... went to a 3 amp supply and put a beefy cap across the supply input on the board. Now it only happens one out of 20 times. (And that's only because the Key is SO small that it can't hold all the necessary Majic Smoke.)
cheers,
- Howard
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
No matter how much you push the envelope, it'll still be stationery.