GAL Programming

2,065 views
Skip to first unread message

Steve Crompton

unread,
Sep 22, 2018, 3:04:28 PM9/22/18
to RC2014-Z80
Hi Folks

Any of you clever people here able to point me in the right direction on programming a 16L8 PAL. I will need a programmer of some description and presumably some software to create the file for the programmer.

Any pointers/tips appreciated here - never used GAL's so  steep learning curve for me here I guess

Thanks

Randy Mongenel

unread,
Sep 22, 2018, 3:16:01 PM9/22/18
to rc201...@googlegroups.com
Supposedly, this device can handle 16V8 PAL/GAL chips:
I own one, but I don't have any PAL chips I can test on it. It works great for flash chips, though, and it's cheap enough.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/f455c5cc-e25c-455f-9524-53c9c4b381cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Randy Mongenel

unread,
Sep 22, 2018, 3:28:32 PM9/22/18
to rc201...@googlegroups.com
I should also mention that the 16V8 is a replacement for the 16L8, 16H8, etc etc.

Phillip Stevens

unread,
Sep 23, 2018, 12:08:18 AM9/23/18
to RC2014-Z80
I use the TL866 for programming GALs for YAZ180.

It works perfectly for Lattice GAL16V8 devices, but I could not make it work with Atmel devices. The Atmel devices are not in the supported device list, and perhaps I was doing something wrong, but that is what I found.

The Atmel WinCUPL generator is also sensitive to which device Mode is selected, with respect to Simple, Complex or Registered. If the wrong or Auto Mode is selected, i didn't get good results. I had to chose the device Mode when building the `.JED` file.

Also, as noted, deselect encrypted writing. That doesn't seem to produce correct results, either.

Otherwise :+1: for the TL866.

Phillip


Randy Mongenel wrote:

Nigel Kendrick

unread,
Sep 23, 2018, 3:45:36 AM9/23/18
to RC2014-Z80
I've used the TL866 (I and II) for Lattice 16V8, 20V8 and 22V10 and I note they support the Atmel ATF16V8 ONLY(not tried them yet); apparently the other Atmel GALs use different programming algorithms that aren't supported.

There's this if you're up to a bit of work: http://www.bhabbott.net.nz/atfblast.html

Agreed: > Also, as noted, deselect encrypted writing. That doesn't seem to produce correct results, either.

No PALs are supported by the TL programmers (which is a shame as I have a few)

I recently purchased 10 x Lattice 22V10 GALs from chips-fans on Ebay and 9/10 failed to program/verify (got a refund, eventually). I now have 10 on the way from UTSource. What suppliers are you folk using?

Nigel

Steve Crompton

unread,
Sep 23, 2018, 4:39:01 AM9/23/18
to RC2014-Z80
Perfect so the 16L8 PAL can be replaced with a Lattice 16V8 GAL and the TL866 programmer will program it, I have my equations (see attached) so given I will be using the Lattice parts, what software should I use to generate the necessary file for the TL866 programmer?
pal equations.PNG

Phillip Stevens

unread,
Sep 23, 2018, 6:10:25 AM9/23/18
to RC2014-Z80
Steve Crompton wrote:
Perfect so the 16L8 PAL can be replaced with a Lattice 16V8 GAL and the TL866 programmer will program it, I have my equations (see attached) so given I will be using the Lattice parts, what software should I use to generate the necessary file for the TL866 programmer?

When I started with GAL I determined to write my equations using the Atmel WinCUPL tool.
The advantage of CUPL is that it is remarkably like C language, and therefore it is quite simple to write equations.

Essentially, you set up the input and output pins as high or low active, even assigning them to create (partial) memory ranges, then your logic can be straightforward. i.e. When this AND that are happening  where this and that are active low, so they are actually ORed, you don't have to think about the logic inversion.

So in example below, defining the memory mapping can be done using address ranges, once the inputs are defined as part of an address bus.
Personally, I think that's pretty useful, and makes maintenance very easy.


MEMORY_PLD_2018.png


The problem with WinCUPL is that it is an old program and is a little buggy running on Win10 and needs to run in a WinXP compatibility mode.
But it is free and, since the TL866 programmer also has a windows GUI tool, the total GAL workflow is straight forward.

Phillip
doc0737.pdf

Duncan Reed

unread,
Sep 24, 2018, 4:31:28 AM9/24/18
to RC2014-Z80
Another option is the TOP2013, I have have programmed GAL 16v8 with that without issue. Software is a bit clunky to get installed and used but it works. I went done the TOP route as I heard the latest TL866 struggled with 21v.

But the best (in my opnion) is the Batronix but the version that programmes GALs is £400, ( I have the cheaper one that only does ROMs as well as the TOP, much better software than the TOP2013, always use the batronix if I can)

Regards,
Duncan

Samster

unread,
Sep 25, 2018, 1:59:44 PM9/25/18
to RC2014-Z80
I also have the cheaper Batronix programmer, and agree it's a very good device, but sadly lacking the GAL features.

Instead of buying yet another programmer I modified the http://www.bhabbott.net.nz/atfblast.html source code to use Raspberry Pi GPIO instead of a PC LPT port.
It worked with an ATF16V8 which accepts the 3.3V as an inputs. I've used a 74LVC245 to level shift SDOUT down to 3.3v to avoid damaging the RPI GPIO, although overkill. Two resistors would be sufficient, however the SDOUT voltage measures 4.3V instead of 5V which I was not expecting so want to figure out why before I choose resistor values.

My aim is to make a passive hat on OSHPark for the RPI to program ATF16V8 for single chip relocatable decode logic (after reading Steve Cousins' IO space documentation thread). Then I want to expand the design with level shifters for the ATF22V10C. I haven't yet decided how to manage the 12V line automatically. But, in combination with wincupl, I'm hoping this might open up the devices to people who don't want to keep buying programmers.

I'm also trying to back-port the simple logic I used in my I2C module, but finding the flip/flop routing frustrating in the ATF16V8/22V10C compared to ATF150x. It doesn't seem possible to use combinatorial logic to drive the d-type clock so I have to implement registers from and/or gates.

Duncan Reed

unread,
Sep 25, 2018, 2:05:08 PM9/25/18
to 'TonyD' via RC2014-Z80
I must admit I am fed up with buying programmers. I have 6 at the last count, an Atmel, Xlinix, Propellor, Intel, Batronix and TOP2013.

One to do everything would be great. And while I am wishing, a decent GUI, with a backup command line and works on all major O.S platforms (either directly or via vnc etc.

Do all that and you win a medal!

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/fXdYQJvxnuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Alexandre Souza

unread,
Sep 25, 2018, 2:13:56 PM9/25/18
to rc201...@googlegroups.com
It is called Beeprog (don't buy the beeprog 2, buy the beeprog or beeprog plus)
It is expensive. But it does EVERYTHING

If you're on a budget and can use a machine with windows XP and a parallel port, old Hi-Lo programmers are GREAT (anything from All-03 to All-100) and cheap on ebay. Take care with all-03, it uses an ISA board. I have an ALL-11 myself.

2018-09-25 15:05 GMT-03:00 Duncan Reed <dun...@elminster.com>:
I must admit I am fed up with buying programmers. I have 6 at the last count, an Atmel, Xlinix, Propellor, Intel, Batronix and TOP2013.

One to do everything would be great. And while I am wishing, a decent GUI, with a backup command line and works on all major O.S platforms (either directly or via vnc etc.

Do all that and you win a medal!
On 25 Sep 2018, at 18:59, Samster <randomiz...@gmail.com> wrote:

I also have the cheaper Batronix programmer, and agree it's a very good device, but sadly lacking the GAL features.

Instead of buying yet another programmer I modified the http://www.bhabbott.net.nz/atfblast.html source code to use Raspberry Pi GPIO instead of a PC LPT port.
It worked with an ATF16V8 which accepts the 3.3V as an inputs. I've used a 74LVC245 to level shift SDOUT down to 3.3v to avoid damaging the RPI GPIO, although overkill. Two resistors would be sufficient, however the SDOUT voltage measures 4.3V instead of 5V which I was not expecting so want to figure out why before I choose resistor values.

My aim is to make a passive hat on OSHPark for the RPI to program ATF16V8 for single chip relocatable decode logic (after reading Steve Cousins' IO space documentation thread). Then I want to expand the design with level shifters for the ATF22V10C. I haven't yet decided how to manage the 12V line automatically. But, in combination with wincupl, I'm hoping this might open up the devices to people who don't want to keep buying programmers.

I'm also trying to back-port the simple logic I used in my I2C module, but finding the flip/flop routing frustrating in the ATF16V8/22V10C compared to ATF150x. It doesn't seem possible to use combinatorial logic to drive the d-type clock so I have to implement registers from and/or gates.

On Monday, 24 September 2018 09:31:28 UTC+1, Duncan Reed wrote:
Another option is the TOP2013, I have have programmed GAL 16v8 with that without issue. Software is a bit clunky to get installed and used but it works. I went done the TOP route as I heard the latest TL866 struggled with 21v.

But the best (in my opnion) is the Batronix but the version that programmes GALs is £400, ( I have the cheaper one that only does ROMs as well as the TOP, much better software than the TOP2013, always use the batronix if I can)

Regards,
Duncan


--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/fXdYQJvxnuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/c29f3865-abf5-4fc7-9563-d02e56873f79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Duncan Reed

unread,
Sep 25, 2018, 2:21:00 PM9/25/18
to 'TonyD' via RC2014-Z80
Not my idea of a perfect product, it uses windows. Yuck. Although unfortunately most of the programmers seem to use windows (3 of 6 of mine are windows only). I have to have a windows VM just for the purpose of running programmers, it is annoying. A few run on Linux. It seems to be the last hold out of windows that programmers and test gear (oscilloscope, PSUS etc.) only seem to have windows software. 

To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Michael Cullen

unread,
Sep 25, 2018, 2:24:58 PM9/25/18
to rc201...@googlegroups.com
Yeah though if you already have a bitstream I find openocd really handy - I use it a lot with my ST programmer (STM32 mostly - including gcc) and occasionally with my Altera programmer when I already have the bitstream and just want to flash it without bothering with the (actually Linux compatible but old) altera utility

Turns out there’s a Linux tool for the TL866 as well so that’s one more I don’t necessarily need windows for!

Michael

On Tue, 25 Sep 2018 at 19:21, Duncan Reed <dun...@elminster.com> wrote:
Not my idea of a perfect product, it uses windows. Yuck. Although unfortunately most of the programmers seem to use windows (3 of 6 of mine are windows only). I have to have a windows VM just for the purpose of running programmers, it is annoying. A few run on Linux. It seems to be the last hold out of windows that programmers and test gear (oscilloscope, PSUS etc.) only seem to have windows software. 

On 25 Sep 2018, at 19:13, Alexandre Souza <alexandre...@gmail.com> wrote:

It is called Beeprog (don't buy the beeprog 2, buy the beeprog or beeprog plus)
It is expensive. But it does EVERYTHING

If you're on a budget and can use a machine with windows XP and a parallel port, old Hi-Lo programmers are GREAT (anything from All-03 to All-100) and cheap on ebay. Take care with all-03, it uses an ISA board. I have an ALL-11 myself.
2018-09-25 15:05 GMT-03:00 Duncan Reed <dun...@elminster.com>:
I must admit I am fed up with buying programmers. I have 6 at the last count, an Atmel, Xlinix, Propellor, Intel, Batronix and TOP2013.

One to do everything would be great. And while I am wishing, a decent GUI, with a backup command line and works on all major O.S platforms (either directly or via vnc etc.

Do all that and you win a medal!
On 25 Sep 2018, at 18:59, Samster <randomiz...@gmail.com> wrote:

I also have the cheaper Batronix programmer, and agree it's a very good device, but sadly lacking the GAL features.

Instead of buying yet another programmer I modified the http://www.bhabbott.net.nz/atfblast.html source code to use Raspberry Pi GPIO instead of a PC LPT port.
It worked with an ATF16V8 which accepts the 3.3V as an inputs. I've used a 74LVC245 to level shift SDOUT down to 3.3v to avoid damaging the RPI GPIO, although overkill. Two resistors would be sufficient, however the SDOUT voltage measures 4.3V instead of 5V which I was not expecting so want to figure out why before I choose resistor values.

My aim is to make a passive hat on OSHPark for the RPI to program ATF16V8 for single chip relocatable decode logic (after reading Steve Cousins' IO space documentation thread). Then I want to expand the design with level shifters for the ATF22V10C. I haven't yet decided how to manage the 12V line automatically. But, in combination with wincupl, I'm hoping this might open up the devices to people who don't want to keep buying programmers.

I'm also trying to back-port the simple logic I used in my I2C module, but finding the flip/flop routing frustrating in the ATF16V8/22V10C compared to ATF150x. It doesn't seem possible to use combinatorial logic to drive the d-type clock so I have to implement registers from and/or gates.

On Monday, 24 September 2018 09:31:28 UTC+1, Duncan Reed wrote:
Another option is the TOP2013, I have have programmed GAL 16v8 with that without issue. Software is a bit clunky to get installed and used but it works. I went done the TOP route as I heard the latest TL866 struggled with 21v.

But the best (in my opnion) is the Batronix but the version that programmes GALs is £400, ( I have the cheaper one that only does ROMs as well as the TOP, much better software than the TOP2013, always use the batronix if I can)

Regards,
Duncan


--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/fXdYQJvxnuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/fXdYQJvxnuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Alexandre Souza

unread,
Sep 25, 2018, 2:29:10 PM9/25/18
to rc201...@googlegroups.com
Well, professional device programmers depends on professional equipment and systems. So if you want to do something right, you need a stable, standarized and accredited environment to run. I hope someday Linux achieves this status.
(and this is my professional opinion on this subject, feel free to agree to it or not)

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

Michael Cullen

unread,
Sep 25, 2018, 2:32:05 PM9/25/18
to rc201...@googlegroups.com
Xilinx and Altera(now intel) have Linux versions of their tools that are basically identical to the windows versions. 

To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/c29f3865-abf5-4fc7-9563-d02e56873f79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/fXdYQJvxnuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Duncan Reed

unread,
Sep 25, 2018, 4:31:46 PM9/25/18
to 'TonyD' via RC2014-Z80
I am not sure that is a valid argument. The programmer software of the cheaper programmers (and some of the expensive ones) is pretty dire, buggy and hard to install. And half the time you wonder if the software that came with it is the real software or someone has slipped malware in. Besides I am a Mac user so even with Linux I use a VM. I remember the TOP2013 software was pretty tricky getting it working on Windows 10, and isnt a patch on Batronix, but I guess you get what you pay for,

To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Alexandre Souza

unread,
Sep 25, 2018, 5:27:32 PM9/25/18
to rc201...@googlegroups.com
I though we're talking "Professional" device programmers. As you said, you get what you pay for


--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

Bill Shen

unread,
Sep 25, 2018, 6:58:22 PM9/25/18
to RC2014-Z80
I use a cheap ($4) Altera USB blaster clone to program the Altera CPLD & FPGA.  I also have a $5 serial EEPROM programmer.  I prefer ROM-less computer or at least one with flash that can be programmed in-situ.
  Bill

Peter Willard

unread,
Sep 26, 2018, 6:28:18 AM9/26/18
to RC2014-Z80
Bill, can you gl into some detail about how you use a ByteBlaster clone to program stuff?

Do you mean like using it for devices like the ATMEL Gals that TL866 won't program?

Bill Shen

unread,
Sep 26, 2018, 7:52:37 AM9/26/18
to RC2014-Z80
The Altera *blaster series of programmers are based on JTAG scan chain.  They are specifically designed  for Altera programmable logic, but probably can be modified to run other JTAG scan chain based products.  However, I don't believe the simple PLD like 16L8, 22V10 can be programmed via JTAG scan chain.
  Bill

Steve Crompton

unread,
Sep 26, 2018, 11:10:49 AM9/26/18
to RC2014-Z80
What is the difference between the A B C and D variants of the 16V8 ?

Steve Crompton

unread,
Sep 26, 2018, 11:25:10 AM9/26/18
to RC2014-Z80
I have downloaded Wincupl from the microchip website - can I use this version of wincupl with other vendors parts ie lattice without problems - ie is the jed file created the same for an atmel 16v8 as the lattice equivalent part - is it JUST the programming algorith that changes from vendor to vendor or is the orga

Nigel Kendrick

unread,
Sep 26, 2018, 12:40:45 PM9/26/18
to RC2014-Z80
Yep. I use it with Lattice parts.

Steve Crompton

unread,
Sep 26, 2018, 2:04:48 PM9/26/18
to RC2014-Z80
Ok WinCUPL downloaded from Microchip website ONLY shows Atmel part numbers

Where can I download the most recent version which lists Lattice parts?


On Saturday, 22 September 2018 20:04:28 UTC+1, Steve Crompton wrote:

Nigel Kendrick

unread,
Sep 26, 2018, 2:24:59 PM9/26/18
to RC2014-Z80
Skip the template helper (I can't remember whether I turned it off or it disappeared on its own) and dive into creating your own headers in the source file - for example these were used for Lattice parts:

Name       bin2x7seg;
Partno     XXXXX;
Date       15-Feb-2018;
Revision   01;
Designer   N. Kendrick;
Company    Techmarque;
Assembly   XXXXX;
Location   XXXXX;
Device     g16v8a;

Name     z80-glue;
PartNo   Z80C;
Date     26-Aug-2018;
Revision 04;
Designer Nigel Kendrick;
Company  Techmarque;
Assembly Z80 Computer;
Location TBD;
Device   g22v10;

Name     z80-glue;
PartNo   Z80C;
Date     26-Aug-2018;
Revision 03;
Designer Nigel Kendrick;
Company  Techmarque;
Assembly Z80 Computer;
Location TBD;
Device   g20v8a;

Nigel Kendrick

unread,
Sep 26, 2018, 2:39:24 PM9/26/18
to RC2014-Z80
PS: For guidance on device modes (eg: g16v8a) see the equivalent Atmel/Microchip data sheet - eg: Page 9: http://ww1.microchip.com/downloads/en/DeviceDoc/doc0453.pdf and use for the Lattice parts.

Nigel

Samster

unread,
Sep 26, 2018, 5:45:07 PM9/26/18
to RC2014-Z80
I believe the difference between the B and C is that the latter has a power-down mode to reduce energy consumption. Not sure about the A/D parts yet.
Reply all
Reply to author
Forward
0 new messages