Atmel/Microchip ATF1502AS CPLD problem - SOLVED. - Page 1
Forum section: electronics / general

author: Zondar
author_rank: Regular Contributor
timestamp: October 15, 2025, 10:55:02 pm
content: Hello Forum Members,I'm attempting to use the Atmel / Microchip ATF150x series CPLDs, namely the ATF1502AS in particular.I've gone through several so far, and only one has worked. The working one used ~20 mA power at idle, was able to be programmed, and tested running correctly.All others so far have used ~0 mA, and have not been able to be programmed. These appear dead as far as I can tell. They are all fresh, legitimate chips. All 4 power and all 4 ground pins, and all programming pins, etc., tested correct in all cases.Does anyone have a clue as to why this is happening? I'm growing quite desperate for an answer or solution. I can provide more info if you have questions.Thank you!

author: Psi
author_rank: Super Contributor
timestamp: October 15, 2025, 11:02:06 pm
content: FPGA/CPLD can be more susceptible to damage from static/ESD and just stray voltages.There's obviously the issue of handling the raw chips with care, but I would also look into your grounding, especially any mains earth grounding of your test setup and any grounds from different sources.You may have some voltage between mains/PSU/PC ground and your circuits ground and when you connect something it's moving your circuit up/down by some amount of volts, it could be quite small but enough to cause damage when you connect something referenced to a different ground.Remember that power supplies usually have Y caps connected between phase and earth, you do get a little coupling there.In rare cases you actually see tiny sparks when connecting grounds together. Usually something is a little wrong in that case, but it happens.One thing you can try to rule this out is use a laptop running on battery to program the chip while powering the chip from something isolated like 5Vreg on some batteries. If the problem goes away that might be the issue.Or you can also use a DMM on AC and DC to poke around your circuit grounds and I/O and things, checking for any voltage between things it should be. But it can sometimes be hard to find.

author: Andy Watson
author_rank: Super Contributor
timestamp: October 15, 2025, 11:09:45 pm
content: What have you done with any unused inputs and pins? Do not allow them to float.

author: wraper
author_rank: Unknown
timestamp: October 15, 2025, 11:22:03 pm
content: Quote from: Andy Watson on October 15, 2025, 11:09:45 pmIt should not cause malfunction, only increased current consumption. Also ATF1502AS does not need external pull-ups.Quote

author: Zondar
author_rank: Regular Contributor
timestamp: October 15, 2025, 11:43:44 pm
content: One more data point: The failures (if that's what they are) have occured before any attempts to program them. That is, I've been finding ~0 power consumption immediately after soldering and prior to programming.I've soldered in the chips in several different ways by now: hand soldered, hot-air (touched up by hand) and via a stencil and hot-plate. None have reliably resulted in a working part.I've used a power supply for programming, with its GND terminal also connected to the earth ground. The soldering iron is also earth-grounded through its 3-pronged power cord. I could try a battery-like power source next time, but again, the failures have been before programming anyway.If they are being destroyed by handling, all I can say is that I've never seen chips a million miles as sensitive as this before.

author: Psi
author_rank: Super Contributor
timestamp: October 15, 2025, 11:54:03 pm
content: Go through each IO pin and confirm it requires no special state for programming and confirm you have it in that state if so.I've seen chips work intermittently before when a boot pin was floating so could be something similar.Sometimes its useful to google image search for a schematic from someone else using the same IC. Compare how they have connected pins vs how you have. Sometimes something pops out as different and you can investigate that pin in the datasheet.

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 11:16:17 am
content: While measuring the current consumption (it could be lower than 1mA when not active and/or not programmed, imho) try to touch the pins via say 10k resistor wired to gnd or 5V and watch the changes in the current cons..Also you may try to wire 10k pullups on the jtag pins (like the tms/tdi).Btw., the programmer shall provide 5V level signals and Vcc shall be 5V during programming too - doublecheck as well..PS: the eval boards for testing -https://github.com/whitequark/ATF15xx-EVB

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 03:10:41 pm
content: I keep thinking that there is something I'm missing or that I'm making an obvious mistake somewhere.There is no "boot pin," The non-volatile memory is internal and does not need to be loaded. There's an automatic power-on reset function, though, but that's just to clear the internal registers.Unused pins are generally floating, but they test to be at ground potential. I'll probe one with a high value pull-up resistor on it to see if they are actively held at ground (i.e., via the 100k pin-keeper resistor) or if they are truly floating. I agree with the above comment that this, at worst, should only result in higher power consumption. I don't see any excess, though. Still, I could hack them to ground if necessary. I could also add constraints on them in the source code.I could add pull-ups on the TDI and TMS pins. However, the one chip that programmed correctly did so without them, and again the main problem (main symptom is improperly low power use) occurs prior to attempts to program it.There are two pins, "PD1" and "PD2" which can optionally be used to enter the chip into a power-down mode. For use, this option must be selected in the programming source file. However, if selected, then if either PD1 or PD2 (or both) is high, the chip will enter the power-down state. This would look like what I'm seeing, but the function isnotexplicitly selected. I'll check these pins again and maybe ground them anyway, though.I have more new boards coming with all of the unused pins grounded.

author: free_electron
author_rank: Super Contributor
timestamp: October 16, 2025, 03:45:02 pm
content: unused cpld pins are typically set to output and "low" by the synthesizer. (at least on altera). they don't want noise to come in (or out). NEVER wire anything to an unused pin !TDI TMS are not critical. TRST is ! check that thing.

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 05:36:21 pm
content: There does seem to be a debate about whether to ground unused pins or not. My normal practice is to not allow any floating pins, and generally to ground them. I didn't in this case due to other advice.There is no TRST pin, because "the TAP controller is automatically reset at power-up."I don't believe unused pins are automatically set to anything special by default. I tried to measure the output impedance of unconnected pins, and they seem high-Z.Again, the most significant problem is the lack of expected power consumptionpriorto programming (<=1 mA vs. ~20mA). I just tried another new CPLD with the same result (~1 mA power consumption yet again). I can't keep doing this.I believe my static, etc., handling procedures are fully adequate and should not cause the parts to catastrophically fail over and over. Something else must be going on! But what!?

author: free_electron
author_rank: Super Contributor
timestamp: October 16, 2025, 05:42:51 pm
content: sanity check- how are you contacting these devices ? are they in a socket ? soldered down ? -> check the connections- is the power rail stable? if the rise time of the power rail is too slow the device may note reset properly.- if there is no TRST then check the TMS polarity is correct (pull up or down). not having this right may result in a locked up device at power on- where di d you buy these ?

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 06:00:15 pm
content: * The chips are in TQFP's and are soldered down.* All used connections including all 4 power and all 4 ground pins and all 4 JTAG pins have been verified, including right on the pins, not just the tracks.* Yes, the power is stable.* I've tried connecting TMS to power and to ground (and also floating). No change.* "Reset" in this device is automatic upon power on, but only clears the data flip-flops.* Digikey. I have no doubts that these are new, unprogrammed and legit.I connected PD1 and PD2 pins (power down pins) to ground. No change. These are normally treated as regular I/O pins unless specified in the code to be used as PD pins, but as the devices are not even programmed yet, they should not be active as PD pins anyway. Still, I had to try, since power down would look like the problem I'm having.Once again: the first big problem is apparently inappropriate power consumption (<=1mA vs. ~20 mA) prior to programming. The parts not recognized as present if an attempt is made to program them in this state.

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 06:01:59 pm
content: Why do you assume the Icc < 1mA is not good when idle (no clock)??The DS says Icc is 700uA in the pin controlled power down(??) - see fig 3-5, afaik..

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 06:19:32 pm
content: Quote from: iMo on October 16, 2025, 06:01:59 pmTrue. That's why one suspicion is that the device is fine but just powered down. But to use the power down feature you first have to program it to use that function, and also raise PD1 and/or PD2.So if it's not yet programmed, and even if it was then if PD1 and PD2 are both held low, the device should not be in power-down.I also experimented by applying a 20 MHz clock, which I think should trigger the chip to exit any lower-power (but not power-down) state. No significant change.But all that said, yes, assuming I'm not breaking the chips, it does sound like it's just in a low-power state.By the way, I don't see a figure "3-5." The ATF1502AS data sheet seems to jump from "2-1" to "4-1". Which document are you looking at?

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 06:25:11 pm
content: A possible scenario:1. the fresh chips show Icc <1mA2. After first programming it shows a higher Icc, unless you activate the PD pins3. you cannot program them when fresh (and Icc<1mA) because a problem with the programming process (wiring mismatch, long leads - poor signal integrity, faulty programmer, faulty firmware in the programmer, usb issues, wrong sw/settings on the PC side, etc.)..

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 06:31:49 pm
content: Yes, I've considered that possibility. But a few things:The one(!) time I successfully programmed one, the chip was using 20 mA before programming. This one was hand-soldered in, with no other components on the board. I note that I moved this chip to an otherwise-built board, whereupon it failed (the usual ~1 mA problem)! As a last resort, I can put a new chip on my last unpopulated board to see if that changes anything, but I can't see how.Attempts to program the chip while it is in the ~1mA state do not work. The chip simply isn't recognized as being there at all. No progress can be made.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: October 16, 2025, 06:37:02 pm
content: Quote from: Zondar on October 16, 2025, 05:36:21 pmHow do you connect a board ?Donotplug into a hot cable - we had issues on one test fixture doing that.I think the cable inductance plus very sharp current edge caused significant overvoltage ringing.We solved this by using a somewhat large series resistance, but our circuit allowed that, with a CPLD maybe a soft start switch box ?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: October 16, 2025, 06:40:51 pm
content: Quote from: Zondar on October 16, 2025, 06:31:49 pmThat certainly suggests some power ramp issue.When you say ‘no other components’ does that mean not even a single decoupling cap ?

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 06:44:20 pm
content: Quote

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 06:46:38 pm
content: I'm not sure what you mean by "plug in a hot cable." Generally, what I do is connect a power supply (with an inactive output) to the board via clips, and then activate the power supply's output. Not sure what else would be more appropriate. I mean, if these chips can't withstand that, they can't withstand anything.The empty board only had the CPLD and 4 decoupling caps (one on each power pin).The populated boards only connect the CPLD to analog switch control inputs through some resistors. The analog switches only use a few tens of uA, so I don't think the "power ramp" is an issue.

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 06:52:32 pm
content: What programmer do you use and how is your wiring from the programmer to the CPLD? Does the programmer power the cpld during programming?

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 06:56:11 pm
content: Quote from: iMo on October 16, 2025, 06:44:20 pmThanks. That's what I've been using as a reference too. To enter power down, the chip must be programmed to do so and then also have either PD1 or PD2 high. I've grounded both, and also the chip has not been programmed yet.The "reduced power" state of ~20 mA is where it should be (chart 3-1), and that's the state during which I was able to program one CPLD.I'm using the official programmer: ATDH1150USB. It does not power the chip, but it requires power input (i.e., from the board) to determine what the correct programming voltage levels should be.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: October 16, 2025, 07:01:52 pm
content: Quote from: Zondar on October 16, 2025, 06:46:38 pmSince you have an apparently working method, try thatexactsequence again with a new device.Something is different between your working and not working cases.

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 07:05:32 pm
content: Quote from: Zondar on October 16, 2025, 06:56:11 pmDoublecheck the wiring to the programmer, also doublecheck the programming sw settings - it may be set to 3.3V ASL version and when it sees 5V it rejects the chip..

author: free_electron
author_rank: Super Contributor
timestamp: October 16, 2025, 07:07:23 pm
content: You use a bench power supply. Do you have any local regulator on the board ? bench power supplies typically have "slow" turn-on times.I suspect it's the turn-on of the power supply. Do a simple test. put a 5 volt regulator (like a 7805) close to the supply rail of the CPLD with a small capacitor on its output ( max 10uF) . then hotplug the input of the 7805if this is 3.3 v then use a 3.3 volt equivalent of course. LT1117-3.3 for example

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 07:15:49 pm
content: I've checked the wiring from the programmer (JTAG pins, etc.). The programmer has two additional wires (power and ground) to be connected to the board's power supply. That's how the programmer knows what levels to use. The software side also indicates what exact chip is being used. This particular chip is 5V only.But once again, the low-power problem existsbeforeattempting to program it. It should be using ~20 mA even beforehand. Connecting a misbehaving chip to the programmer and attempting to program it does not improve anything. Indeed, the chip is not recognized as even being there at all.I just re-attached a CPLD (exhibiting ~1mA power) to an unpopulated board. It did not revert back to working. I could do the same with a new chip, but I'll run out again soon if I keep supposedly "breaking" them.As for replicating how I made the sole working chip, the only difference from what I just did is how I soldered it. In the working case, it was hand-soldered. I consider that worse than using the hot air gun, but in any event I don't think hand-soldering was responsible for itworking.

author: iMo
author_rank: Super Contributor
timestamp: October 16, 2025, 07:49:40 pm
content: Another scenario for example: there is an design/wiring issue on your pcb and the first one cpld (the 20mA one) worked because you a) shorted some pins while soldering the cpld onto the board, or, b) you did not solder some pins properly on the pads there..In other words an issue with hand soldering bypassed an issue with the pcb tracks mess ..PS: the fastest check would be to glue a cpld dead bug on a piece of proto pcb and wire those jtag programming wires directly to the pins (plus the Vcc and GND and some decoupling) and then test the programming chain with some blinking a led..

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 08:31:50 pm
content: I've checked the wiring so many times that I'm quite confident that there is no problem with them. Also the soldering. I have checked everything from right on the pins themselves to wherever they are going (JTAG connector, etc.).When they are in the anomalous ~1 mA scenario, the programmer will not program at all because it doesn't "see" a part at all. I suppose I could look at whatever it's producing anyway, but that probably won't solve the "why isn't it drawing 20mA as expected" problem.I guess I can start over with my last clean board, put a fresh CPLD only on it, then see. I have 3 unused CPLD's left and can buy more if necessary. I also have 3 more boards coming in about 2 weeks. Those have all unused pins grounded. I just hope I can solve this so I don't have to consider an alternate to this CPLD!

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 09:12:49 pm
content: OK, there's actually no problem at all!I tried programming one again (while it was using ~1 mA), andeverything went perfectly fineon the first attempt without any drama at all.I still don't understand why some CPLD's started life at 1mA and others at 20 mA, or why I had trouble programming it earlier. But I'll take the win, if stubbornly believing there was a problem when there wasn't one allows for that.Anyway, thank you all for patiently trying to help.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: October 16, 2025, 09:32:48 pm
content: Quote from: Zondar on October 16, 2025, 09:12:49 pmDoallparts now pgm ok, or is there still some roulette effect ?

author: Zondar
author_rank: Regular Contributor
timestamp: October 16, 2025, 09:40:32 pm
content: I'm not sure yet.The only difference this time vs. last is that I included bodge wires from the power-down pins PD1 and PD2 to ground. However, I'm not confident that this actually helped anything.I'll have to make at least one new board shortly, and I'll report back if there's anything new to say.

author: xvr
author_rank: Frequent Contributor
timestamp: October 18, 2025 01:41:35 pm
content: How long have the chips been exposed to the environment (after opening the shipping packaging)? This chip has an MSL of 3 (168 hours), so after opening the package, after 168 hours, it can no longer be soldered with hot air, reflow, or in an oven—it will fail. However, hand soldering with a soldering iron is still possible. Perhaps this is your case?