afterburner/README.md

281 lines
14 KiB
Markdown
Raw Normal View History

2019-03-16 10:45:18 +00:00
# afterburner
GAL chip programmer for Arduino
2023-04-07 17:30:35 +00:00
![Board image](https://github.com/ole00/afterburner/raw/master/img/afterburner_new_design.jpg "afterburner")
2019-03-16 11:49:41 +00:00
This is a GAL IC programmer software that allows to program GAL IC chips
from various manfucaturers. It is based on work of several other people:
Bruce Abbott:
https://web.archive.org/web/20220121030038/http://www.bhabbott.net.nz/atfblast.html
2019-03-16 11:49:41 +00:00
Manfred Winterhoff:
http://www.armory.com/%7Erstevew/Public/Pgmrs/GAL/_ClikMe1st.htm
Yorck Thiele:
https://www.ythiee.com/2021/06/06/galmate-hardware/
2019-03-16 11:49:41 +00:00
who did the most of the hard work of deciphering and publishing the programming
protocol of these chips. Some of their early programs were Windows based and relied on
presence of parallel port (LPT). Afterburner was written for Linux OS
(also works on Win32/64, Mac OSX64), and requires serial connection to
2020-05-25 10:12:56 +00:00
Arduio UNO, which does the programming of the GAL chip.
2019-03-16 11:49:41 +00:00
Supported GAL chips:
2023-04-07 17:30:35 +00:00
* Atmel ATF16V8B, ATF16V8BQL, ATF16V8C, ATF22V10B, ATF22V10CQZ
2019-03-16 11:49:41 +00:00
* Lattice GAL16V8A, GAL16V8B, GAL16V8D
* Lattice GAL22V10B
* National GAL16V8
2023-04-07 17:30:35 +00:00
* Lattice GAL20V8B (no adapter needed)
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
**This is a new Afterburner design with variable programming voltage control and with single ZIF socket for 20 and 24 pin GAL chips.**
The PC software is backward compatible with the older Afterburner desgin/boards.
You can still access the older/simpler ![design here](https://github.com/ole00/afterburner/tree/version_4_legacy "Afterburner legacy")
2023-03-25 21:44:51 +00:00
2023-04-07 17:30:35 +00:00
The new design features:
* variable programming voltage control via digital potentiometer
* single 24 pin ZIF socket for 16V8, 20V8 and 22V10 GALs. The adapter for GAL20V8 is no longer needed.
* simpler connection to MT3608 module (no need to modify the module)
* both Through Hole and SMT footprints present on a single PCB. This allows
to mix & match SMT and TH parts based on your skills and availability.
Drawbacks compared to the old Afterburner design:
* more parts required, most notably the digial pot MCP4131 and a shift register 74hc595
* a few more steps during ininital VPP calibration. But once the calibration is done it does not need to be changed for different GAL chips.
* the PCB design for etched board is no longer provided because of the higher complexity. Please use a PCB fabrication service or use the older Afterburner design (see above).
2019-03-16 11:49:41 +00:00
Setup:
2023-04-07 17:30:35 +00:00
---------------------
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* Upload the afterburner.ino sketch to your Arduino UNO. Use Arduino IDE to upload the sketch, both IDE version 1.8.X and 2.X should work.
* Build the Afterburner hardware. Buy the PCB from the an online PCB production service (use provided gerber archive in 'gerbers' directory). Then solder the components on the PCB - check the schematic.pdf and BOM.txt for parts list.
2019-03-16 11:49:41 +00:00
* Compile the afteburner.c to get afterburner executable. Run
2023-04-07 17:30:35 +00:00
./compile.sh to do that. Alternatively use the precompiled binaries in the 'releases' directory.
* Calibrate the variable voltage. This needs to be done only once, before you start using Afterburner for programming GAL chips.
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* **Calibration step 1)** Turn the small potentiometer (R8) on the Afterburner to the middle position. This pot acts as compensation resistor for the digital pot.
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* **Calibration step 2)** Set the progamming voltage (VPP) to 16.5V: Check the programming voltage (VPP) without the GAL chip being inserted / connected to Afterburner. Test the voltage on MT3608 module VOUT- and VOUT+ pins while running the following command:
2019-03-16 11:49:41 +00:00
<pre>
./afterburner s
</pre>
2023-04-07 17:30:35 +00:00
While the command is running turn the pot on the MT3608 module (not the Afterburner's pot) counter clockwise (5 to 20 full turns). The VPP voltage should be displayed on the console, but for the very first setup use a multimeter to verify the VPP voltage as well.
Re-run the command (if needed) to give you more time to set the 16.5V VPP.
* **Calibration step 3)** This step scans the available voltages and records the pot taps. Run the following command:
<pre>
./afterburner b
</pre>
You will see several messages on the console. Check the one with '*Index for VPP 900 is'. This is the lowest supported VPP of 9V and the index should ideally be between 15 and 35.
If you see a different index value (lower or higher) move the Afterburner's compensation pot (R8) either a bit lower or higher (depending on the VPP 900 index value) and go back to Calibration step 2). Repeat the Calibration steps 2) and 3) until you find the good value on VPP 900 index. If everyting goes OK the last VPP index (VPP 1650) should be 128.
* **Calibration step 4)** Measure the actual VPP to verify the value read by Arduino is correct. Run the following command while mesuring the VPP on your multimeter:
<pre>
./afterburner m
</pre>
Afterburner will set the VPP to several values (5V, 9V, 12V, 14V, 16V) and print the voltage readings as read by Arduinos's ADC. These values should match with readings from your multimeter (except for the 5V which is OK if it is a value from 4.2V - 5.0 V). Important are the values of the higher voltages. If they are off by more than +/-0.05V then you can set the calibration offset by runnig Calibration step 3) with an extra parameter '-co X':
<pre>
./afterburner b -co X
</pre>
Where X is a number form -20 (represening -0.2V offset) to value 25 (representing +0.25V offset). If your multimeter reads 12.1V and the reading on the text console shows 12.00V you need to set positive offset of +0.1V ('-co 10'). If your multimeter reads 11.85V and the reading on the text console shows 12.05V you need to set negative offset of -0.2V ('-co -20'). After setting the calibration offset, the readings on your multimeter should read the same values as the text on the console (+/- 0.05V). The calibration is then done. If (when specifying negative offset value) the calibration fails, turn the MT3608 Pot about 10-15 degrees counter-clockwise (to rise the VPP a tiny bit) and re-deo the Calibration step 4.
* Note that if you use your calibrated Afterburner board with a different Arduino (made by a different company or slightly different design), you may need to re-do the calibration.
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* With the GAL chip inserted and power button pressed (or in ON position) check the chip identification by runnig the following command:
2019-03-16 11:49:41 +00:00
<pre>
./afterburner i -t [GAL_type]
2019-03-16 11:49:41 +00:00
</pre>
If you get some meaningfull GAL chip identification like:
<pre>
PES info: Atmel ATF16V8B VPP=10.0 Timing: prog=10 erase=25
</pre>
2023-04-07 17:30:35 +00:00
then all should be well and you can try to erase the chip and then programm it to contain your .jed file.
2019-03-16 11:49:41 +00:00
If you get an unknown chip identification like:
<pre>
PES info: 3.3V Unknown GAL, try VPP=10..14 in 1V steps
</pre>
then look at the troubleshooting section
* Read the content fo your GAL chip. This only works if the contents
of the chip is not protected. Use the following command:
<pre>
./afterburner r -t [GAL_type]
</pre>
or to save the printed .jed fuse map to a file use:
<pre>
./afterburner r -t [GAL_type] > my_gal.jed
</pre>
* Erase the GAL chip. Before writing / programming the chip it must
2020-05-25 09:25:56 +00:00
be erased - even if it is a brand new chip that has not been used
2019-03-16 11:49:41 +00:00
before. Use the following command:
<pre>
./afterburner e -t [GAL type]
</pre>
* Program and verify the GAL chip via the following command:
<pre>
./afterburner wv -t [GAL type] -f my_new_gal.jed
</pre>
2023-04-07 17:30:35 +00:00
* If you are not sure which GAL type strings are accepted by Afterburner, simply set a wrong type and it will print the list of supported types:
<pre>
./afterburner wv -t WHICH
</pre>
2019-03-16 11:49:41 +00:00
How aferburner works:
---------------------
2023-04-07 17:30:35 +00:00
- PC code reads and parses .jed files, then uploades the data to Arduino via serial port. By default /dev/ttyUSB0 is used, but that can be changed to any other serial port device by passing the following option to afterburner:
2019-03-16 11:49:41 +00:00
<pre>
-d /my/serial/device
</pre>
2020-05-25 09:25:56 +00:00
- PC code of afterburner communicates with Arduino UNO's afterburner
2023-04-07 17:30:35 +00:00
sketch by a trivial text based protocol to run certain commands (like erase, read, write, upload data etc.). If you are curious, you can also connect directly to Arduino UNO via serial terminal and issue some basic commands manually.
2019-03-16 11:49:41 +00:00
2020-05-25 09:25:56 +00:00
- Arduino UNO's afterburner sketch does 2 things:
2023-04-07 17:30:35 +00:00
* parses commands and data sent from the PC afterburner app
* toggles the GPIO pins and drives programming of the GAL contents
2019-03-16 11:49:41 +00:00
2020-05-25 09:25:56 +00:00
- more information about GAL chips and their programming can be found here:
2019-03-16 11:49:41 +00:00
http://www.bhabbott.net.nz/atfblast.html
http://www.armory.com/%7Erstevew/Public/Pgmrs/GAL/_ClikMe1st.htm
PCB:
---------------
2023-04-07 17:30:35 +00:00
The new design no longer has an etched PCB design available. The most oconenient way to get the PCB is to order it online on jlcpcb.com, pcbway.com, allpcb.com or other online services. Use the zip archive stored in the gerbers directory and upload it to the manufacturer's site of your choice.
Upload the afterburner_fab_3_0.zip and set the following parameters (if required).
2023-04-07 17:30:35 +00:00
* Dimensions are 79x54 mm
* 2 layer board
* PCB Thickness: 1.6, or 1.2
* Copper Weight: 1
* The rest of the options can stay default or choose whatever you fancy (colors, finish etc.)
2023-04-07 17:30:35 +00:00
Soldering steps:
----------------
* check which type of components you have, you can mix and match SMT and through hole components as most of the footprints are doubled to accomodate different parts.
* **Important:** C5, C6 and C7 are VPP decoupling capacitors and must be rated to **at least 25V!** You can use 50V rated caps, but do not use 16V or lower ratings.
* Even thoug C5 (10uF, 25V) offers a SMT footprint, I used a through hole part because it reduces the VPP swings better than my SMT cap.
* start with the smallest parst, solder the resistors and small capacitors.
* solder the two ICS: U1 (digital pot) and U2 (shift register)
* solder the LED, the switch and the big capacitors
* **special step** solder a thin wire between the MT3608 module and the PCB hole marked as POT. See the image bellow.
* solder the MT3608 module - the POT connection wire must be already soldered!
* calibrate the board. See calibration steps in the Setup section.
* solder the ZIF socket
![POT wire image.](https://github.com/ole00/afterburner/raw/master/img/mt3608_wire.jpg "POT wire")
2019-03-16 11:49:41 +00:00
Troubleshooting:
----------------
- it does not work!
2023-04-07 17:30:35 +00:00
* double check the solder joints on the PCB, ensure they are soldered. Especially SMT soldering when done manually can accidentally miss some of the pads.
2019-03-16 11:49:41 +00:00
* ensure the GAL chip is inserted to the IC socket the right way (check
2023-04-07 17:30:35 +00:00
the pin 1 location). Note that the 16V8 GALs have to be inserted close to the ZIF lever - see the title image above.
2023-04-07 17:30:35 +00:00
* ensure the VPP is set correctly on the MT3608 module. Ensure you've gone through all the calibration steps (commands: 's' then 'b' and 'm') and calibration is correct. See the Setup section.
2019-03-16 11:49:41 +00:00
- afterburner reports it can not connect to /dev/ttyUSB0, permission denied
* ensure your user is member of the of the dialup group or alernatively run
afterburner as superuser (use: sudo ./afterburner ...)
2020-05-25 10:12:56 +00:00
* ensure no other programm on your PC uses that serial port. Close putty, minicom or other
terminals you may be running.
2019-03-16 11:49:41 +00:00
- afterburner fails to connect to /dev/ttyUSB0
* ensure your PC is actually connected to Arduino UNO, check a serial device
exists:
<pre>
ls -alF /dev/ttyUSB*
</pre>
2023-04-07 17:30:35 +00:00
- I want to program ATF16V8C, but it is not listed as supported by the PC app.
* use parameter '-t ATF16V8B'. Afterburner finds out it is a C version.
- I forgot to solder the POT wire to the MT3608 module. The MT3608 is already soldered and I can't reach underneath the module to solder the wire.
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* you can either desolder the module by using soldering wick (to remove all solder on the connection pins on the MT3608 module). Then use a low temperature melting solder (like Quick Chip or similar) on the connection joints to loosen up the module. Clean the residues of the low melting solder with soldering wick. Then solder the POT wire and solder the chip back on the PCB. The drawback of this method is that if you use excessive heat during desoldering you can damage the MT3608 module (I've done that). If the module is damaged, it will prouduce a magic smoke next time the board is turned on. If that happens, desolder the module, use a new module (don't forget to solder the POT wire) and solder it on the board.
2019-03-16 11:49:41 +00:00
2023-04-07 17:30:35 +00:00
* Another option is to connect the POT wire directly to the MT3608 IC's Feedback (FB) pin 3. This is quite delicate as the IC pins are quite small. Before before connecting the power, **ensure the pin 2 and pin 3 are not bridged!**
2019-03-16 11:49:41 +00:00
<pre>
| Blue Potentiometer |
|_________________________|
| ______________
| | |
| | SMT Capacit. |
| |______________|
|
| 3 2 1
2023-04-07 17:30:35 +00:00
|-> | | | MT3608 MODULE
2019-03-16 11:49:41 +00:00
| +-------+
| | |
| |4 5 |
| +-------+
2023-04-07 17:30:35 +00:00
| | | |
2019-03-16 11:49:41 +00:00
|
|<-- left long edge of the module
</pre>
2023-04-07 17:30:35 +00:00
* The small arrow (->) in the above diagram marks the pin where the wire has to be soldered.
2019-03-16 11:49:41 +00:00
- my MT3608 module does not seem to work - turning the pot does nothing
* The pot needs to be turned at least 10 revolutions counter-clockwise
2023-04-07 17:30:35 +00:00
to do anything useful. Keep turning.
2019-03-16 11:49:41 +00:00
- where to get the MT3608 module ?
* usual places: ebay, aliexpress
- how to run afterburner on Win32, Win64 or MacOSX ?
* the same way as on Linux: compile the source code
* OR use pre-compiled afterburner binaries located in 'releases' directory
* then run afterburner in terminal (use 'cmd' on WinXX) as described above
2023-04-07 17:30:35 +00:00
* ensure your serial device name is passed via '-d' option. For example -d COM5 on WinXX
- I have the older Afterburner PCB design, can I use the new PC software and Arduino sketch?
* Yes, both programs are compatible with the old Aftterburner boards (1.X and 2.X).
2019-03-16 11:49:41 +00:00
- what are the .jed files and how to produce them
* Use WinCUPL software from Atmel. Works under Wine as well.
2019-03-16 11:49:41 +00:00
2020-09-02 20:00:09 +00:00
https://www.microchip.com/design-centers/fpgas-and-plds/splds-cplds/pld-design-resources
* WinCUPL User's manual: http://ww1.microchip.com/downloads/en/DeviceDoc/doc0737.pdf
* Try GAL Asm to produce .jed files - see link bellow.
Other GAL related links:
------------------------
- GAL chip info: https://k1.spdns.de/Develop/Projects/GalAsm/info/galer/gal16_20v8.html
- GAL chip programming protocol info: https://k1.spdns.de/Develop/Projects/GalAsm/info/galer/proggal.html
- GALmate: another open source GAL programmer: https://www.ythiee.com/2021/06/06/galmate-hardware/
- JDEC file standard 3A: https://k1.spdns.de/Develop/Projects/GalAsm/info/JEDEC%20File%20Standard%203A.txt
- GAL Asm : https://github.com/dwery/galasm
2023-04-07 17:30:35 +00:00
- CUPL Reference: http://ee.sharif.edu/~logic_circuits_t/readings/CUPL_Reference.pdf