Supremely Basic SX Question
Zoot
Posts: 2,227
I am eagerly awaiting my SX-Key and a few SXs so I can dive into some SX projects. I've been reading over the documentation for some weeks, and I want to make sure I have the basic setup crystal clear.
Am I correct in my understanding that you *can* program the SX with the SX-Key *and* a resonator still connected, but that you can *NOT* debug with the resonator attached? In other words, does the SX-Key only generate a clock for the SX for debug purposes, but not for program purposes?
Am I still better off always removing my resonator when downloading code, just to be safe?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Am I correct in my understanding that you *can* program the SX with the SX-Key *and* a resonator still connected, but that you can *NOT* debug with the resonator attached? In other words, does the SX-Key only generate a clock for the SX for debug purposes, but not for program purposes?
Am I still better off always removing my resonator when downloading code, just to be safe?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Comments
You are correct…You can program and DEBUG without the resonator in, but you cannot DEBUG while the resonator is installed. You cannot program or debug when a TTL OSC is installed, which is why we have the Proto Boards interlocked to prevent this. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
So...what's the difference between a TTL oscillator and a resonator? Is the former a small IC with some kind of precise timer/oscillator (powered?) while a resonator is just a crystal that "hums"? When would you prefer one over the other?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
The Resonator is a relatively passive component while the TTL Osc is an active component with it’s own power supply. It will try to force drive the clock line against the SX-Key/Blitz!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The SX-Key basically can perform three different functions:
1. Programming the SX chip
2. Provide a clock signal for the SX chip
3. Communicate with the SX chip for debugging
1. While programming, the SX-Key applies Vpp (a voltage of about 12V) to the OSC1 pin, and performs a serial communication with the SX through the OSC2 pin. Usually, a resonator or crystal attached to the OSC1 and 2 pins does not interfere, and Vpp does not harm the resonator or crystal. This is why a resonator/crystal can usually stay in place while programming the SX. TTL ocillators, on the other hand, will put enough load to the OSC1 pin in most cases (even when their clock output is turned off) that the SX-Key can't build up Vpp. This is why TTL oscillators must always need to be removed. The SX-Key IDE will report a "Vpp generation failed" error message in such cases.
2. When the SX-Key provides the clock signal for the SX, it acts as an external clock generator, like a TTL oscillator. So it is most obviously that no other clock-generating device can be attached to the OSC1 pin in parallel. So, a TTL oscillator needs to be removed, and the connection between the OSC1 pin and a resonator/crystal needs to be opened (the other end of the resonator/crystal may still remain connected to the OSC2 pin). This is why you find some boards with a jumper allowing to isolate the OSC1 pin from the resonator/crystal.
3. When the SX-Key communicates with the SX chip for debugging, it provides the clock for the SX via the OSC1 pin, and communicates with the SX via the OSC2 pin. The clock frequency is switched between 20 MHz (when the SX-Key performs a communication), and the frequency defined with the FREQ directive in the source code (when the SX runs the program). Similar to case 2, no TTL oscillator must be connected to OSC1, as its output would override the clock signal generated by the SX-Key, and no "leg" of a resonator/crystal must be connected either to OSC1, where the other "leg" connected to the OSC2 pin usually does not cause a problem.
The same is true for the SX-Blitz with the exception that it does not allow for option 3.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G