??? 08/21/06 04:46 Modified: 08/21/06 05:03 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#122673 - An alternative to Atmels ISP CABLE Responding to: ???'s previous message |
If one has a look at the original schematic of Atmel's "IPS cable", which I recall here partially
one can see, that a 74VHC244 is used to buffer the ISP programming signals emitted by the printer port. The circuit looks simple, but is not! The presence of D1 at the pull-ups should ring a bell... Why cannot a simple 74HC244 or else be used instead of this 74VHC244? CMOS chips usually contain a protection circuitry at their inputs to prevent damage caused by overvoltage, from ESD, for instance, or resulting from overshots caused by improper termination of transmission lines, etc. This protection circuit looks like that, or similar: One can see, that a protection diode is connected from each input to Vcc. Now remember, the "ISP cable", means the above buffer circuitry, is connected to the target micro to be programmed and is also powered by the micro's Vcc. How to proceed, when the programming is done and the micro shall be removed from the "ISP cable"? Simply disconnecting the cable? No! This could produce unsane togglings at the ISP programming lines, which could badly affect the programming, either by destroying parts of the just programmed code or by clearing the lock bits. But how to terminate the programming? Only by turning-off Vcc of micro and THEN disconnecting the cable. AND: During the power-off no changes of logic states at the ISP programming lines must occur!!! Also, do never power-on and power-off the micro with an inactive reset line!!! During power-on and power-off the reset line must always be logic high! But how to do this with a simple 74HC244, or similar, which contains these protection diodes from inputs to Vcc? A power down of Vcc would not have the intended effect, because any high potential being emitted from one of the printer port lines would still power the micro! Because it will keep Vcc at high potential due to the action of protection diodes! Only a buffer that does NOT contain these protection diodes from inputs to Vcc will work here. And that's just what the 74VHC244 provides! It's a buffer which is 5V tolerant at the inputs, when powered by a smaller supply voltage, for instance 3.3V. Here, this protection diode would cause the same trouble. Because of that, the 74VHC244 contains a different protection scheme, not shunting any overvoltage at the inputs to Vcc! Now it's clear, why the original scheme contains this diode D1: Omitting the diode would again shunt high potential at one of the printer port lines to Vcc and make a turn-off of Vcc impossible. That's why the 74VHC244 is used by the Atmel's original "ISP cable". It has nothing to do with speed or fan-out capability or else. No, the serial transmission is very slowly compared to the propagation delay times of buffers, and the output drive capability of 74VHC244 isn't superior at all either. Theoretically also a 74LVC244 could be used, which doesn't contain these unsuited protection diodes at inputs either. But this chip isn't specified for a supply voltage of 5V. What to use, if a 74VHC244 isn't available? A LS-TTL variant does also provide an unwanted path from input to Vcc. So, I would recommend to split the buffering and the 5V tolerancy into two parts, like shown here: The 74LS540 provides proper compatibility to the TTL signals of printer port. Take note that with many todays printer ports it's impossible to achieve CMOS compatible signals by the use of pull-ups!!! Especially if the printer port circuitry is powered by a 3.3V supply. So, using a 74HC540 with pull-ups at the inputs will not do the trick! Printer port signals are really nasty! They go hardly above 3V when emitting high state and rise times of these signals can be up to 10µsec!! I measured a rise time of 8µsec in bidirectional or ECP mode at "Strobe"! Some better with EPP mode, though, happily. So, not only the TTL levels makes it difficult to use a CMOS buffer but also the giant rise times of signals! This means: To be on the safe side, any circuit being connected to the printer port of a PC should have a 74LS244 compatible buffer at input, which can not only handle the TTL levels, but also the huge rise times, due to its Schmitt-trigger inputs! Take note, the 74LS540 gets its own 5V supply, means this buffer is powered nearly all the time! The 5V tolerancy is implemented by the following Schottky diodes, the 4k7 pull-ups and the 74HC14. And because the 74HC14 isn't strong enough to drive a transmission line, an additional 74HC541 is used. 74HCMOS was chosen to keep the supply current low. Remember, this circuitry must be powered by the micro's Vcc, too. Do only use a flat ribbon cable to the target. Do not change the pinning!!! Keep this cable as short as possible, no longer than 50cm. Connect the circuitry directly to the printer port (DB25 plug). Do not use a cable here, if possible. The following snippet shows, how the ISP cable should be connected to the micro: During the programming, remove the jumper at the reset input of micro! How to program the AT89S52 finally with all this above? 1. Start the Atmel's original ISP programming software (which is free, by the way) installed on your PC. 2. Turn-on Vbuffer. 3. Connect the circuit to the printer port (EPP mode preffered!). 4. Connect the ISP cable to the target (micro to be programmed). 5. Turn-on Vcc. 6. Do all the programmings (blank check, erase, write, verfiy, what ever you need). 7. When the micro was successfully programmed, turn-off Vcc. 8. Disconnect the ISP cable from the target. 9. Disconnect the circuit from the printer port. 10. Turn-off Vbuffer. Happy programming! Kai |