SX-Key fails to program, read, or verify
Matthew Hagerty
Posts: 8
Greetings,
I'm trying to get a simple test program up and running on an SX28AC, here is my configuration:
Intel based HP laptop
Windows XP w/SP2
SX-Key Software v.3.2r3 (latest on the site as of yesterday)
SX-Key Programmer Rev F
Parallax USBto232 Adapter (my laptop does not have a serial port)
FTDI USB VCP Driver v. 2.0.0.0 from the FTDI website (the driver download on the parallax site is over 2 years old)
SX28AC microcontroller (28 pin dip)
All the software and drivers installed fine and the USBto232 adapter was found and made a COM1 port without problems. I plugged the SX-Key programmer directly into the USBto232 adapter.
Circuit power is from an AC power brick that puts out 6.5VDC @ 1A (I had a 300ma adapter at first, but thought maybe the SX-Key was using more than 200ma, so I switched to the 1A adapter). I run that into a 7805 to get the required 5VDC. I have the SX28AC on a breadboard with the minimal configuration shown in the SX-Key manual, i.e. VDD (pin 2) to +5VDC, VSS (pin 4) gnd, MCRL (pin 28) to +5VDC via 480ohm resistor, and the SX-Key connector to VDD, VSS, OSC1, and OSC2 as indicated. I have checked and rechecked these connections repeatedly over two 4-hour troubleshooting sessions.
I ran the SX-Key programmer software and selected COM1 (the only com port in the system) and keyed in a very simple program example from Gunther Daubach's book Programming the SX Microcontroller:
; Test 1
DEVICE SX28AC
DEVICE OSC4MHZ, TURBO, STACKX, OPTIONX
IRC_CAL IRC_4MHZ
FREQ 4_000_000
RESET 0
MOV !RB, #%11111110
LOOP CLRB RB.0
SETB RB.0
JMP LOOP
This is to blink an LED which I removed from the breadboard circuit since I'm having problems. This assembles without problems and when I hit debug I see two progress bars, one says something to the effect of "clearing..." and the other "programming...". After which I expect to see the debug window, but it never opens. There is a red LED on the USBto232 adapter that flashes during all of this activity.
After trying this a few time without any luck, I hit the "device" icon and tried the "Verify" button, which says "reading" with a progress bar, then I get an error message that says "Verify Failed at Oscillator".
If I do something like disconnect the power to the SX28 and SX-Key, the software says it cannot find the SX-Key on COM1, so I'm assuming some sort of communication is taking place?
I also tried setting the serial port speed to 1200 baud from 9600 (the default). Didn't help. No where can I find specs for any possible COM port settings, so I assume the SX-Key software sets up the COM port appropriately?
I have two SX28AC chips and I have tried them both in the circuit, each time the errors are the same. Eventually after poking around at the software long enough and trying to debug, assemble, run, verify, read, etc. the error message comes up and says "SX-Key not found on COM1". Closing the software and restarting it fixes this problem and puts me back to the "Verify Failed at Oscillator" error. I cannot find any diagnostic check to ensure the software can communicate with the SX-Key and that the SX-Key checks out.
This is getting very frustrating and any insight would be greatly appreciated. The only other thing I can think of is to try to program from my desktop computer that does have a real serial port, but I'm not very hopeful.
Thanks,
Matthew
I'm trying to get a simple test program up and running on an SX28AC, here is my configuration:
Intel based HP laptop
Windows XP w/SP2
SX-Key Software v.3.2r3 (latest on the site as of yesterday)
SX-Key Programmer Rev F
Parallax USBto232 Adapter (my laptop does not have a serial port)
FTDI USB VCP Driver v. 2.0.0.0 from the FTDI website (the driver download on the parallax site is over 2 years old)
SX28AC microcontroller (28 pin dip)
All the software and drivers installed fine and the USBto232 adapter was found and made a COM1 port without problems. I plugged the SX-Key programmer directly into the USBto232 adapter.
Circuit power is from an AC power brick that puts out 6.5VDC @ 1A (I had a 300ma adapter at first, but thought maybe the SX-Key was using more than 200ma, so I switched to the 1A adapter). I run that into a 7805 to get the required 5VDC. I have the SX28AC on a breadboard with the minimal configuration shown in the SX-Key manual, i.e. VDD (pin 2) to +5VDC, VSS (pin 4) gnd, MCRL (pin 28) to +5VDC via 480ohm resistor, and the SX-Key connector to VDD, VSS, OSC1, and OSC2 as indicated. I have checked and rechecked these connections repeatedly over two 4-hour troubleshooting sessions.
I ran the SX-Key programmer software and selected COM1 (the only com port in the system) and keyed in a very simple program example from Gunther Daubach's book Programming the SX Microcontroller:
; Test 1
DEVICE SX28AC
DEVICE OSC4MHZ, TURBO, STACKX, OPTIONX
IRC_CAL IRC_4MHZ
FREQ 4_000_000
RESET 0
MOV !RB, #%11111110
LOOP CLRB RB.0
SETB RB.0
JMP LOOP
This is to blink an LED which I removed from the breadboard circuit since I'm having problems. This assembles without problems and when I hit debug I see two progress bars, one says something to the effect of "clearing..." and the other "programming...". After which I expect to see the debug window, but it never opens. There is a red LED on the USBto232 adapter that flashes during all of this activity.
After trying this a few time without any luck, I hit the "device" icon and tried the "Verify" button, which says "reading" with a progress bar, then I get an error message that says "Verify Failed at Oscillator".
If I do something like disconnect the power to the SX28 and SX-Key, the software says it cannot find the SX-Key on COM1, so I'm assuming some sort of communication is taking place?
I also tried setting the serial port speed to 1200 baud from 9600 (the default). Didn't help. No where can I find specs for any possible COM port settings, so I assume the SX-Key software sets up the COM port appropriately?
I have two SX28AC chips and I have tried them both in the circuit, each time the errors are the same. Eventually after poking around at the software long enough and trying to debug, assemble, run, verify, read, etc. the error message comes up and says "SX-Key not found on COM1". Closing the software and restarting it fixes this problem and puts me back to the "Verify Failed at Oscillator" error. I cannot find any diagnostic check to ensure the software can communicate with the SX-Key and that the SX-Key checks out.
This is getting very frustrating and any insight would be greatly appreciated. The only other thing I can think of is to try to program from my desktop computer that does have a real serial port, but I'm not very hopeful.
Thanks,
Matthew
Comments
Here's you're problem - a 7805 requires a minumum of +7V in to get a stable +5V out. I suggest you switch to a 7.5V or 9V power supply. Another option is to swap the 7805 for an LM2940 - which will work reliably from a +6.5V power supply. You may also need to adjust the size of the output capacitor - the datasheet for the LM2940 recommends a minimum of a 22 uF output capacitor.
DEVICE SX28
DEVICE SX28L
DEVICE SX28AC
SX28L is what was in the example in the book, but I can not find any reference to a list of valid device names either. As for making the code crash, the code never even seems to make it to the device, so I have no idea if it runs, but I can't even get that far.
I also just tried programming from another computer with a real serial port and it did the same thing. When I try the "verify" button on the device window, I get the same "Verify Failed at Oscillator" message. I sure wish there was more information about error messages and troubleshooting procedures. Is the "oscillator" in that error referring to the oscillator on the SX-Key, or the oscillator pins on the device?
Matthew
You should definitely try programming the SX from a computer with a REAL com port. I have heard of many, many examples of software applications not working as they should with certain USB-to-serial adaptors. I believe Parallax has a USB-to-serial adaptor that they support as well as a USB version of the SX key. Look into these if you find that it works from your desktop PC but not your laptop.
I have had an experience similar to yours running under Windows 2000. I quickly gave up on using a USB-to-serial adaptor and switched to a dedicated serial port since one was available. I STILL have problems programming the SX at times. I can not figure out why. I have tried adjusting my FIFO buffers as suggested in an early thread but I could discern no difference. For me, I would say the device programs properly on the first attempt about 50% of the time. The other 50% of the time I may have to make 4-12 attempts to program the SX (with the average probably being around 6-8 times) before it will complete programming. When it is being finicky it tends to abort at seemingly random places during the programming with a "SX-Key not found on COM1" error. So I just try, try again. Eventually it does complete!
What is most interesting in my experience is that it programs fine for a while. Then gives me trouble for a while making programming changes a complete hassle for a time. Then it may work fine for a while again. I figure the problems I have must either be related to other processes running on the computer or else are somehow related to programming changes I have made to the SX code. It's kinda strange...
There is one last thing from my experience that I will pass on in the hopes that it may help you in some way. Last Friday when I was having trouble I could sometimes get the SX programmed in debug mode but only after numerous attempts. However, even so, it was never once able to pass the device verify test. All day Friday I had it fail the verification test with the "Verify Failed at Oscillator" error you have reported. (On pervious occasions this has verified fine. So I know it sometimes works. I do not know what makes the difference.) During this same time I was able to program the SX (as in the standalone program mode without running the debugger) several times and each of those times it passed the device verify operation just fine!
I am sorry I do not have a definite solution for you. I suggest trying to program from a real serial port and also trying to program it to run stand-alone without including the debugger. Knowing if either of those operations succeed or fail may help others who are more knowledgeable diagnose the problem.
I see that you did try using a real serial port. I had expected that to fix it! Perhaps you can obtain an older version of the software and try that. I'm out of ideas now.
Matthew
Thanks for the info. It sounds like programming can be a bit of a challenge! I have tried the "run" button instead of "debug", but it does not seem to make any difference. I'll go mash "run" 20 times in a row, just to make sure. But if it does work, I don't have much of a circuit to test with, I was hoping to be able to use the debug mode to learn what going on, etc.. I'll put the LED back in my circuit at RB0. Also, what settings did people suggest for the serial port buffers and such?
Thanks,
Matthew
Matthew