LatticeGal16V8Adapter

Usage
Please read about the general hwtool parameters in the hwtool software description. The adapter supports 3 different modes: read, write and erase. When you start the hwtool software it writes a message on how to connect the hardware, when to insert the device and when to apply the programming voltage. The connections can be made with equipment used for prototyping or testing of circuits, therefore connect gal GND (pin10) to parport pin 18 (GND), gal pin 1, 13-17 via 4k7 to GND, gal pin 18, 3-7 (RA0-RA5) via 4k7 to data pins 1-6, gal pin 8(SCLK), 9(SDIN), 11(STB), 19(PV) via 4k7 to pin 1 (STROBE), pin 14 (AUTOFEED), pin 16 (INIT) and pin 17 (SELECT). Connect gal pin 12 (serial data out) to parport pin 10 (ACKN), gal pin 20 to 5V (Vcc), gal pin 2 to 12.75V (Vpp).

Provisory connection of gal chip to the parallel port
Provisory "programmer" using test board equipment


If you want to programm more than one device, it could be usefull to build a small adapter board to do the programming. (Done the board layout but had no time to build it).

Read access: If the adaptermode is set to read then the adapter will try to initialise the chip, read the PES (programmer electronic signature) and the fusemaps.
hwtool org.halfdog.hwtool.adapters.LatticeGal16V8Adapter AdapterMode=read ParPort=/dev/pport0 File=gal16v8_fusemap.xml
If the device wasn't connected correctly or is from another manufecturer then the programmer can't read the device signature correctly and refuses programming:
Jun 28, 2005 4:00:47 PM org.halfdog.hwtool.HWTool receiveAdapterEvent
SEVERE: Unknown gal device type 0xff
If you want to force the programming you can add the IgnoreErrors=true parameter. You will still see the error message but the programmer won't stop operation unless the error is really fatal.
The readout of readprotected devices won't result in errors but the data returned from the device doesn't reflect the device's internal data (in most cases all bits 0 or 1 is returned).

Write access: If the adaptermode is set to read then the adapter will try to initialise the chip, read the PES (programmer electronic signature) and then write the fusemap.
hwtool org.halfdog.hwtool.adapters.LatticeGal16V8Adapter AdapterMode=write ParPort=/dev/pport0 File=gal16v8_fusemap.xml
The device has to be erased before, the programmer won't check if the device contains any old data.

Erase access: If the adaptermode is set to erase then the adapter will try to initialise the chip and erase all data on it.
hwtool org.halfdog.hwtool.adapters.LatticeGal16V8Adapter AdapterMode=erase ParPort=/dev/pport0 ErasePulseLength=100000 File=test.xml
The user may specify the erase pulse length in microseconds (us). If the user doesn't set the value then the recommended value from the PES is used.
If an additional File argument is specified, then the adapter will read the complete fusemap after erasing and stores it into the xml-file. Hence the file should contain only 1's if the erase procedure succeeded.
At the moment the erase doesn't work as expected, the reason isn't completely clear. It could be that my Gal devices are not eraseable or some error or misinterpretation of the description how to erase.
Fusemap XML-Files
The fusemaps are stored in XML-files with simple internal structure (check the XML-File howto for the xml basics). The xml-file should contain following areas, the area sizes are given in bits:

FieldDatasize
fusemap256x8
synfuse1x1
ac0fuse1x1
ac1fuses1x8
ptdfuses8x8
xorfuses1x8
signature8x8

If one of the areas is missing or the size of the area is smaller than the maximal allowed size (e.g. only 128 byte of fusemap data) then only the available data is written, the remaining fuses are left unprogrammed. More information on the different areas can be found in the gal device datasheet from the manufacturer of the part.

Contact: e-mail: me (%) halfdog.net
Last updated: 12.07.2005