The Dos and Don'ts of using an EPROM as PLA in a C64.

Disk drives, Monitors, SuperCPU etc.
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

Recently, on the VIC-20 Denial forum, I had a very interesting exchange with a friendly chap from down under aka Australia about using a low cost PROM IC as a substitute for the Programmable Logic Array (PLA for short) in a C64 as the genuine item often fails because, honestly, it's rather low tech, heats a lot, consumes a lot of power. Some of them were even made with flawed chemicals.

Of course, I offer PLAnkton, which is the total peace of mind solution but some prefer to have something they can say they saved money on by doing themselves. However, few have the necessary instruments to be really sure they put in place solution that will fix problems instead of causing more.

As such, I have studied with my newer oscilloscope, a TDS3014B I bought only a month before going to the World of Commodore in December 2017, what comes out of a variety of 64k x 8 bit (E)PROMs and the results are quite interesting.

I will be posting them here.

The glitch tester circuit
Before I start with the oscilloscope results, I would to return on something I mentioned back in 2015. I suggested a little circuit with very simple and inexpensive components to check in a PLA generates unwanted spurious signals. This circuit is designed to be connected to the cartridge port but all the involved energy source and signals can also be found at the PLA (U17) or the socket of that chip. Therefore it is possible to create 2 different implementations of that circuit.
Tester circuit I initially posted on REMOVED in 2015 and popularized at the WoC 2017.
Tester circuit I initially posted on REMOVED in 2015 and popularized at the WoC 2017.
PLA_tester_LS279.gif (20.73 KiB) Viewed 9224 times
If you prefer to have this checker circuit attached at the PLA instead of the cartridge port. !ROMH and !ROML can be found at pins 10 and 11 of U17. Ground is at pin 14 and +5Vdc is at pin 28.

A more sensitive version of this circuit can be made by using a 74HC279 instead of the suggested 74LS279 but the HC version may be more difficult to get as these are out of production. They may be found on eBay and Alibaba but you should avoid getting it from any Chinese seller as you may end up getting a fake circuit.

Theory of operation
A normal C64 will check for the presence of a cartridge at power-up but once it has determined there isn't any, it will no longer try to access the areas which may be mapped to !ROMH and !ROML if you leave the C64 idling with only the cursor flashing and no software running. After the initial check, !ROMH and !ROML should remain completely inactive if the PLA is glitch free.

Using the tester
To use this circuit you must make sure you use the original C64 kernal (no JiffyDOS or things like that) and that no cartridge is attached to your cartridge port.

When the C64 is first turned on, it will check for the presence of a cartridge and this will trigger the red LED to turn on. Press the button to turn it off and see what happens. If your PLA is not generating glitches, the LED will stay off indefinitely. If there are glitches, they will trigger the LED back on.

Normally, !ROMH and !ROML will always stay above 3V after the initial check and the set/reset latch will stay inactive. The 74LS279 will detect any glitch which brings the voltage below the threshold voltage for TTL logic circuits, about 1.5V. If you used the 74HC279 then the threshold voltage is about 2.5V and the circuit will detect any glitch which brings the voltage below the threshold voltage for 5V CMOS logic circuits.


Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

In the 8 bit digital world, getting access to a ROM, EPROM or RAM memory chip is usually done by a transition from high to low (logic 1 to logic 0) on one form or another of !OE (output enable where the ! means 'active low') or !CS (chip select where the ! means 'active low'). As long as the studied signal is higher than the threshold voltage, no activation or selection is considered. The threshold voltage for TTL-LS logic circuitry, Commodore' NMOS technology chips and CMOS chips with TTL compatible inputs is generally considered between 1.3 and 1.5 volts.

This means if a signal is attached to the !OE or !CS of a PROM and it varies between 4.9 and 2.0 volts, you may find there's a lot of weird stuff going around but this signal is always considered a logic 1 or 'high' so there is no undesirable glitch in the digital TTL world - said PROM will not be mistakenly activated. These variations may just be the result of other chips of varying power load being switched on and off. This is not so unusual to see big variations like that in a VIC-20, PET, C64 or the board of the 1541 disk drive.

If you were to use an oscilloscope and check !ROMH (channel 1) and !ROML (channel 2) for voltage variations this is what you would see if you had an old 82S100 type of PLA.

Device under test:
82S100 dated 31st week of 1982
82S100 dated 31st week of 1982
Captured !ROMH and !ROML
ROMH and ROML outputs from 82S100
ROMH and ROML outputs from 82S100
TEK00000.gif (10.02 KiB) Viewed 9223 times
If you look at channel 2, you can see significant variations as there is a small dipping of the signal down to 3.57V and this type of capture being a average of 512 triggers implies this glitch is repetitive. Remember this is from a genuine early C64 PLA. However, considering the threshold voltage is actually 1.5V or less, this glitch is totally inconsequential. It will never cause problems.
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

If you had a later C64 which uses an early version of Commodore's own in-house PLA (internally referred to as the 7700) instead of a programmable IC made by a 3rd party and were to perform the same examination, this is what you would see on your oscilloscope.

Device under test:
MOS 906114-01 dated 39th week of 1983
MOS 906114-01 dated 39th week of 1983
Captured !ROMH and !ROML:
ROMH and ROML outputs from 7700
ROMH and ROML outputs from 7700
TEK00001.gif (10.23 KiB) Viewed 9222 times
As you can see, the variations on !ROML now go even lower with glitches bringing the signal down to 3.21V. At that point, as long as everything connected to the system uses TTL level compliant chips, there is no problem. However, if some uninformed soul were to use 74HC logic chips or any other type of CMOS technology with a higher threshold voltage then you may begin to see problems.

Since the first version of the C64 Reloaded board mistakenly used 74HC logic chips then this PLA should be considered incompatible with it even if it is a genuine Commodore PLA. Please keep in mind this type of PLA was the type found in the vast majority of C64 sold in 1983 and 1984, when sales were at the highest.

Some uninformed soul claimed good PLA replacements (or any logic ICs in a C64) MUST absolutely signal a logic 1 or 'high' close to 5V. You can clearly see this is definitely not the case.
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

Now, we all know the vast majority of (E)PROM based PLA substitutes cause problems. Some people tried to resolve the issue by using an extra delay on the !CASRAM output. While most (E)PROM solution act as faster than original PLAs and this can cause problems with !CASRAM, the real issue is ALL 8 outputs can be affected by repetitive or non-repetitive glitches as these chips are not designed to have changes on their inputs in the middle of what is considered an access cycle.

Real logic chips have no such thing as access cycles and changes on the inputs are reflected almost immediately on the outputs. This is called combinational logic. All 28 pin PLAs used on all 8 bit computers and disk drives made by Commodore uses this type of logic. The 64 pin PLA found in the C64c with boards 250469 uses both combinational logic and more sophisticated registered logic.

If you were to use the AT27C512R-45PU as a means of replacing your C64, as suggested by Tynemouth Software ( and http://blog.tynemouthsoftware.co.uk/201 ... ement.html ) this is what will come out of your cartridge port's !ROMH and !ROML lines. Also recommended by this gentlemen:

Device under test:
Atmel AT27C512R-45PU dated 18th week of 2014
Atmel AT27C512R-45PU dated 18th week of 2014
The poor contrast of the etching makes it hard to read.

Captured !ROMH and !ROML:
ROMH and ROML outputs from AT27C512-45PU
ROMH and ROML outputs from AT27C512-45PU
This time the dipping on !ROML goes so low that this will accidentally trigger any type of logic or memory chips attached to this signal, CMOS or TTL. The glitch on !ROMH is not as bad, going down to 2.85V but this is definitely enough to cause problems with many CMOS chips as it is getting quite close to the official threshold of 2.5V. The numbers indicate this is clearly a CMOS component as the highest voltage is above 5V, add some because of the signal ringing and you get around 5.2V but it's all meaningless because of the massive signal noise going all the way below both CMOS and TTL threshold voltages - a total piece of crap.

However, the technically minded can notice these glitches are incredibly brief with the signal going below the TTL threshold level for only around 10 nanosecond. If you consider a threshold level of 2.5V for CMOS then it would be around 20 nanosecond. This means filtering to keep the signal above a safe level of 3V while retaining adequate speed to perform the duties of a C64 PLA is certainly possible. Hey... Ray Carlsen did it.

It still means the 2 guys above recommending the usage of this chip as is in a C64 are nincompoops!

Sidenote: This is exactly the same chip I have used at the WoC in 2017 to make my Super Zaxxon cartridge go haywire.

I also happened to have a 70ns version of that chip and I suspected the problem may be attenuated with a slower version but it's still quite bad.
ROMH and ROML outputs from AT27C512-70PU
ROMH and ROML outputs from AT27C512-70PU
The glitch on !ROML is above 1.3V but at 1.47V will still cause unwanted triggers on many TTL or TTL compatible chips and it will definitely trigger all CMOS chips.

Because of the texture on the top of the Atmel PROMs, I feel it is difficult to read exactly what's engraved on them so I took a new photo with HDR.

(apparently Melon64 will not have more than 3 attachements in a single post...)
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

HDR photo of the -45PU and -70PU
HDR photo of the -45PU and -70PU
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

Back in 2008, I noticed this problem but I also found ONE PROM IC which was completely unaffected. The issue is not really that it doesn't generate glitches - it does - but they are never significant enough to cause an unwanted triggering of any of all 8 outputs. They will always stay on the desired side of the threshold level. In fact, even for CMOS levels.

This is what you get on your cartridge port's !ROMH and !ROML if you use a genuine ST M27C512-90B6 as a replacement for your C64 PLA:

Device under test:
M27C512-90B6 dated 22nd week of 2008
M27C512-90B6 dated 22nd week of 2008
FYI, I paid around 1$US for it back in 2008.
ROMH and ROML outputs from M27C512-90B6
ROMH and ROML outputs from M27C512-90B6
TEK00002.gif (10.57 KiB) Viewed 9363 times
Well, there is rock solid and then there is ROCK SOLID... this chip generates less glitches than any and all other PLAs, genuine or substitute. I really want that in my C64! To top this, as measured by Thomas Giesel back in 2012 (http://www.zimmers.net/anonftp/pub/cbm/ ... sected.pdf see page 19 ) this chips consumes only 4mA of power compared to the 86mA to 102mA a genuine Commodore PLA will require to function and dissipate as heat.

Anyone who claims this PLA replacement solution has problems is just plain full of shit. We all know who did that for years... All this to protect their own PLA replacement which is incompatible with FastLoad.

There is no better PLA than this. Even PLAnkton requires 22mA. It consumes less power than all other solutions and it generates less signal noise than all other solutions. A single drawback; it's faster than a genuine Commodore PLA so a small !CASRAM delay is required for compatibility with boards 326298 and 250407. Just use the same resistor and capacitor added to boards 250425 and 250466 (C204 and R42).

Studying the numbers on the scope capture indicates this is clearly a CMOS based component as it will signal a logic 1 up to 5V.
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by eslapion »

Finally, how does my flagship product, PLAnkton, measure up to this ?

For one thing, PLAnkton consumes more power. It seems to be an inevitable drawback of programmable logic ICs, they are wasteful on power. Just like the old 82S100 consumed way more power than a group of 74LS or 74HC/HCT chips to do the same job, the XC9536XL consumes 22mA while the ST PROM does the same job with only 4mA.

The XC9536XL is, on the other hand, an incredibly fast chip (rated 5-10ns), which is totally irrelevant in the case of the C64 PLA. in fact, it's a nuisance and I had to enable the low power mode as well and the slew rate limiter to bring the behavior closer to that of a genuine Commodore PLA. Finally, this chip is really designed to operate at 3.0-3.6V but this would have it output signals which are too low compared to a genuine Commodore PLA and I really set the 82S100 as a reference in terms of both speed and voltage signaling instead of the 7700 because it requires no extra resistor/capacitor on !CASRAM and is compatible even with the accidental 74HC some weaker minds might have elected to use on cartridges or internal enhancements to the C64.

The 82S100 will never signal a logic 1 below 3.57V and neither must PLAnkton. This requires, considering noise and internal voltage drop, to have the CPLD of PLAnkton powered around 3.75V which is beyond the recommended level of 3.6V. The adaptation stress here is on my product, not on the client's C64. As well, the XC9536XL is 5V input tolerant so signals from TTL, HC or HCT circuits are all accepted with no risk of damage.

The XC9536XL performs the logic operations flawlessly, even better than all genuine Commodore PLAs and just like them it has a bit of hysteresis on all inputs, making it compatible with analog signals with no clear transitions between logic states. This makes it compatible with FastLoad or any other carts using a similar trick for delay or conversion to 1 bit logic. Unlike all Commodore PLAs, it has no static hazards so all transitions of the outputs are clean with no discernable bouncing. In this regard it is better than the original but in the 1980s, it didn't matter at all because the stuff you connected to your C64 was too slow to be affected anyways. This is no longer true with carts like the family of 1541 Ultimate or the chameleon cart.
PLAnkton experimenter 2, PCB 1.07, CPLD dated 33rd week of 2014.
PLAnkton experimenter 2, PCB 1.07, CPLD dated 33rd week of 2014.
This specific unit was built in July 2015 and was the subject of many tortuous experiments. It survived and performs exactly like any units I would sell brand new today and has exactly the same electrical characteristics. The warranty is expired... doesn't matter much, I can make more anytime I want...
ROMH and ROML outputs from PLAnkton EX2
ROMH and ROML outputs from PLAnkton EX2
TEK00001.gif (11.63 KiB) Viewed 9362 times
I guess this is as good as it gets... The signals' average voltage is obviously lower than those of genuine Commodore PLAs but the lowest you get on a logic 1 is 3.48V which is well above the 74HC safety zone. This works with everything.

Too bad it's more expensive than the M27C512-90B6 and consumes more power. This is the best I can give you now that ST has removed its little jewel from the market.

Shht...shht...shht... recently passed the 2100 units sold mark...

Experimenter 1 has been destroyed by having the CPLD run at 4.3V for too long...
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
banman
Member
Member
Posts: 419
Joined: Sat Jun 15, 2019 12:21 am
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by banman »

Hi eslapion,


A very comprehensive study of an PROM/EPROM based PLA substitute.

By the way I have constructed your test PLA test circuit.


I have subsequently discovered using your device a Knockoff (fake) ST M27C512-90B6 branded OTP PROM that passes these test conditions. :o
banman
Member
Member
Posts: 419
Joined: Sat Jun 15, 2019 12:21 am
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by banman »

Here are some links to videos I made testing various PLA's including the Knockoff (fake) ST M27C512-90B6 on numerous C64 board revisions.





******************C64 Board Assy No. 250425

Winbond W27C512 EPROM PLA


Commodore Factory PLA


Testing The Ultimate PLA


Testing Knockoff ST M27C512 90b EPROM PLA




****************** Board Assy No. KU 14194HB Board #1

Winbond W27C512 EPROM PLA


Commodore Factory PLA


Testing The Ultimate PLA


Testing Knockoff ST M27C512 90b EPROM PLA






****************** Board Assy No. KU 14194HB Board #2


Commodore Factory PLA


Testing The Ultimate PLA


Testing Knockoff ST M27C512 90b EPROM PLA








****************** Board Assy No. 250407 REV A Testing



Winbond W27C512 EPROM PLA



Testing the Commodore Factory PLA & Testing Knockoff ST M27C512 90b EPROM PLA








****************** Board Assy No. 250407 REV B Testing


Commodore Factory PLA



Testing Winbond W27C512 EPROM PLA

Testing Winbond W27C512 EPROM PLA with PACMAN cartridge
banman
Member
Member
Posts: 419
Joined: Sat Jun 15, 2019 12:21 am
Contact:

Re: The Dos and Don'ts of using an EPROM as PLA in a C64.

Post by banman »

Hi eslapion,


Here are some images of the knockoff (fake) ST M27C512-90B6 manufactured in KOREA.


IMG_20190518_102626.JPG
IMG_20190518_102555 (1).JPG

This is the person I bought the products from.

I know the images on the sellers website does not reflect the chips that we have been discussing at length.


https://www.aliexpress.com/item/3296631 ... 4c4dsT4vru

Check the buyers comments I will be there talking about how I used it for a C64 PLA. Note that it is in fact a OTP not electrically erasable PROM. That will be check that you've arrived at the right place.
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 4 guests