Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GAL20V8A #22

Open
Fisiekk opened this issue Aug 29, 2022 · 16 comments
Open

Support for GAL20V8A #22

Fisiekk opened this issue Aug 29, 2022 · 16 comments

Comments

@Fisiekk
Copy link

Fisiekk commented Aug 29, 2022

So i have few GAL20V8A and wanted to ask if they are supported or is it possible to add support for them

@ole00
Copy link
Owner

ole00 commented Aug 31, 2022

Hi, AFAIK nobody reported any test results for GAL20V8A so they are not supported (but in theory they may work). There was some success with GAL20V8B (see #20), but please note that this particular IC requires an adapter for the proper pin mapping /connection. The pin mapping for GAL20V8 is published in the 22v10 schematic, also the adapter's pcb design file is in the 'pcb' directory (no gerbers yet).

@Fisiekk
Copy link
Author

Fisiekk commented Aug 31, 2022

Ok, i will try to program it in this month or so

@artgodwin
Copy link

artgodwin commented Jan 21, 2023

I also have some Lattice 20V8A-15LP I'd like to use. Datecode is L241D12
I have built the programmer with the pin mapping as shown for the adapter and can read the ID OK. It reports

PES info: 5V Lattice GAL20V8 VPP=14.50 Timing: prog=10 erase=25

However, if I set Vpp above about 13V the GAL is apparently destroyed and the PES can no longer be read.

If I attempt to program at 13V the programming works partially : on my first attempt it reported 2000 or so fuse errors. Erasing apparently works ok. However, repeating the programming operation without erasing programmed a lot more fuses. Repeating several times (about 10) got down to a few tens of errors. The last couple of errors took many attempts, perhaps 20 or 30 but eventually worked. Shortly thereafter a repeated verify failed one fuse again but with a few more repetitions it programmed completely and has so far rretained the programming (next day). I haven't tried to verify the functionality yet.

Is this characteristic of any known problems ? Perhaps faulty GALs, or unstable Vpp ? I will try to examine the programming cycle to see if I can find anything going wrong, and perhaps experiment with longer programming pulses. I've had these devices in stock for a long time and have enough to experiment with; it's unlikely they are counterfeit as they date from before that was common but they could be a poor batch, discarded because of low yield.

Edit :

Just found a comment elsewhere about the poor 5V supply from a genuine Uno (though I assume this is for the DCV jack, not the USB source). I will check this is OK. I do have the 10k pullup on SDOUT but pin 1 is connected direct to ground as per the 22V10 schematic. I will insert 4.7K.

My board is handbuilt, not using a pcb. So there may be (more) errors. I have left the 10uF off as I have 200uF only just the other side of the switch, but I do have a 100n ceramic across pins 1 and 24. I will move this to pins 12 and 24.

Thanks for this useful design. It's quick and cheap to make (I did it all from spare parts in an evening) and should permit me to use about 80 20V8s I have to hand. I wish I could find a more modern way of creating the small pieces of logic needed for address decoding etc. that PALS/GALS are perfect for. But all I can find is huge FPGAs in packages that require a PCB to mount!

@artgodwin
Copy link

artgodwin commented Jan 21, 2023

Screenshot_2023-01-21_22-39-00

This is the 5V supply (gren trace) as the switch is turned on (yellow trace), powering the 3608. So I need more capacitance !

@Fisiekk
Copy link
Author

Fisiekk commented Jan 21, 2023

Its always decoupling xD

Btw I forgot about this project, still need to etch pcb for it

@artgodwin
Copy link

artgodwin commented Jan 21, 2023

Screenshot_2023-01-21_23-38-04

This is the 12V supply though - it's noisy when it's pumping up to 12V but doesn't spike the 5V, probably because the slope is quite slow.

@ole00
Copy link
Owner

ole00 commented Jan 22, 2023

Thanks for the report.

It's interesting what you wrote about re-writing the fuses, but it makes perfect sense that re-writing (with the same bit design) without erase will fix these errors eventually. Flipping the fuse bit (internally inside GAL) requires certain amount of current/voltage and if there is instability then the next bit to flip (especially if there are 2 bits to flip consequently) might not get enough current/voltage to flip the bit properly. Next attempt to write (again speaking of internal logic of the GAL) possibly recognises the bit 1 is already flipped so no current/voltage is applied (and it stays in favourable state to program the next bit, which previously failed flipping), therefore the bit 2 has good conditions to be flipped successfully.

PES info and reported 14.5V: The VPP value, timing value and erase values are decoded from the PES (chip electronic signature) bytes retrieved from the GAL chip in the Arduino sketch (with the exception of Atmel GALs). The decoding might be wrong. It might be worth trying the programming with VPP set to 12V as that's the VPP I normally use with Lattice GALS without issues. If there are still the same writing issues with VPP 12V as with VPP 13V, the afterburner could be modified to do auto-rewrite (multiple times) if it detects writing errors.

Regarding the scope trace 1 (power dip) - I did not know about that, good that you pointed it out. I scoped 5V rail on my board (scoped on Arduino 5V pin header, powered only via USB) in the same situation and indeed my 5V rail dropped the same way. I tried it with and without GAL chip, both produced the same dip. Because your main decoupling capacitor is before the switch (and fully charged when the switch-on happens, therefore not contributing to the 5V rail dip) I guess the culprit might be the MT3608 module. Arduino does not seem to be reset when that 5V dip happens. I don't think this should contribute to the writing failures you mentioned though (you might try scoping the 5V rail during writing the GAL fuses, whether there are similar dips on 5V rail). Still worth investigating whether this could be fixed.

Useful design: the main credit goes to Bruce Abbott and Manfred Winterhoff for doing the GAL research and publishing their result and their code.

@ole00
Copy link
Owner

ole00 commented Jan 22, 2023

Just tested and scoped the MT368 module on its own and it is the reason why the 5V rail drops when the switch is turned on. No wonder, it has a big inductor.

@artgodwin
Copy link

Useful design: the main credit goes to Bruce Abbott and Manfred Winterhoff for doing the GAL research and publishing their result and their code.

Yes, I don't underestimate the amount of work there. But those designs have quite a few components and the parallel port dependency makes them awkward. Building onto an arduino and keeping it as simple as possible makes it far more attractive as a quick hack - if it gets much more complex you might as well buy a TL866 and use some of the open source replacement firmware.

For that reason I'd discourage the programmable Vpp. Yes, it would be great .. But unless it's implemented with PWM or some other such cheap solution its going to add a bunch of less common parts and lose the biggest advantage. Even the multiple pinning I suggest elsewhere would be a bad idea if it added more than a few resistors and transistors.

I was also surprised that the 5V switch created such a large drop whilst enabling Vpp didn't. Note that the boost converter isn't enabled at that point - so I guess it has to be the capacitors. That's why I put the 200uF upwind of the switch - I didn't want them having to be charged too.

Interesting that you have found 12V enough. I note that the voltage requested is already 2V less than apparently wanted by the chip's algorithm. I'd speculate that the older chips need higher voltage and are also perhaps more sensitive to overvoltage.

@ole00
Copy link
Owner

ole00 commented Jan 22, 2023

Complexity of Afterburner and additional features: I completely agree.

The idea of programmable VPP though would still use MT3608 module, but this time it would be used to supply like 18V which would feed LM317T variable voltage regulator. The output voltage of that regulator (VPP for GAL) would be controlled by digital POT , something like MCP40D18T. It sounds simple, but still requires to source less common parts (at least the programmable POT may not be in everyone's drawer). Anyway, I'm not going to add that feature in the near future.

200uF CAP before the switch - thanks for that. I'll test that and modify the design if it reduces the dip at least above 4V.

12V as VPP: this article (https://k1.spdns.de/Develop/Projects/GalAsm/info/galer/proggal.html) distinguishes 2 different voltage values of VPP for reading and writing. According to that article GAL reading (like PES reading) requires always 12V, but writing requires higher VPP ranging from 14V to 15.75V. Afterburner can do only one VPP during the single read/program session, so it is actually quite fortunate that many of the supported GAL types can be programmed by Afterburner using only single VPP for both reading and writing. Of course you encountered writing issue on your 20V8A, so this might be the odd case (or rather the normal case?), where the programmable VPP could be beneficial.

@artgodwin
Copy link

artgodwin commented Jan 23, 2023

The 2nd trace above is WITH 200uf - it's far from enough to stop the 5V rail froim being sucked down. Admittedly this is the Uno with an inline FET in 5V - you did say the cheap clones had a better 5V rail. But I've now added 1000uF along with some fast ceramics and it still drops by 1V. I should probably move this to the discussion section, it's well off topic for 20V8s now. I couldn't believe the 10uF ceramic caps on the 3608 board were pulling such a spike so I looked a bit further .. it turns out that even though the device should be disabled by the Vpp enable control, it actually spikes to 12V when the power comes on, settling back to the expected 5V in 200ms or so. Not sure if that's the boost converter or just the C-L-C network.

The idea of using the digital pot is looking more attractive. I wonder if it could be arranged so that a quick-and-dirty programmer could be built with a manual pot instead (though it would prevent that soft start. Or perhaps there's an alternative to the 3608 (though, again, I do like the use of a cheap off-the-shelf ebay module).

@artgodwin
Copy link

Screenshot_2023-01-23_01-38-34
Screenshot_2023-01-23_01-37-42

Blue is unswitched 5V, green is switched 5V (and trigger), yelow is 3608 output. The traces are the same thing, just zoomed to show both the length of the high voltage pulse and the detail of the 5V disturbance. I did also check that the enable pin stayed low during the switch-on

@ole00
Copy link
Owner

ole00 commented Jan 23, 2023

Sadly, mt3608 datasheet states: " The MT3608 has internal soft start to limit the amount of input current at startup and to also limit the amount of overshoot on the output.". I guess that does not work out very well for both of the parameters (current limit and overshoot).

@artgodwin
Copy link

It does seem less than perfect :)

@ole00
Copy link
Owner

ole00 commented Jan 25, 2023

I tried 220uF (electrolytic) before the switch and it did not eliminate the big dip. It does help to smooth the voltage. Here is my result.
aft_caps

@ole00
Copy link
Owner

ole00 commented Mar 28, 2023

@artgodwin I re-read your report about your Lattice 20V8A. I checked GALep's definition for that specific GAL. The VPP they use is 12V. So either the PES data as read from the GAL are incorrect (you reported Afterburner prints 14.5V, so in PES it was 16.5V) or they have to be interpreted differently for each vendor perhaps. It may also be, that the voltage really needs to be above 13V as you tried, but it needs to be ramped up slowly not to destroy the chip (GALmate uses that techinque for ST chips). Also, on your scope trace you can see that the VPP during ramp-up has high spikes reaching possibly 14V which may be the cause of the damage. Unfortunately that's a downside of using a switching boost convertor. On the new Afterburner design (programmble VPP) I resolved it by progressively ramping up, decreasing the voltage steps as the VPP reaches the desired voltage. Also, the new design adds 3 decoupling CAP on the VPP: 10uF, 100nf and 2nF which help to reduce the VPP spikes during VPP ramp-up (values higher than that seem to be cunter-productive, they increase the VPP overshoot). The 5V rail dip, although not nice, should not damage the GAL, most likely it causes Arduino to reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants