Experiment: Time to EPROM Erasure by UV Lamp & Sun?

I’ve always been fascinated by the beauty of EPROM chips with their erasure windows giving you a clear look inside the package. Because of my fascination, I ended up buying quite a few chips, an UV eraser that needed some repairing and a programmer. I think it’s clear that from having these items, one of the questions I could provide an answer to was the often asked “how long does it really take to erase an EPROM?”

The Science of Erasure

I’ll probably start off by saying that I’m no expert when it comes to the device physics of EPROMs, but in a nutshell, an EPROM works by being first programmed which causes charge to accumulate in a region separated from the bulk of the material by an oxide insulator forming the programmed state. To erase the EPROM requires external UV light of 400nm or shorter wavelength to ionize the oxide allowing the stored charge to dissipate, reverting the cell to an unprogrammed state. The process causes damage over repeated cycles.

Programming generally aims to store sufficient charge in each cell to be detectable, plus a small margin to ensure data retention in case of extremely slow leakage and/or different voltage/temperature operational conditions.

amddeveras erasure-strategy

If we look at two examples of erasure procedures from datasheets (AMD AM27C040 on the left, ST M27C64A on the right), we can see that the dose needed to erase the unit is often claimed to be 15W.sec/cm² or 30W.sec/cm². The time is claimed to be 15-20 minutes or 30-35 minutes under a lamp of 12000μW/cm² power rating.

To most people, this looks like gobbledygook. You don’t go into a shop and ask for a lamp with a 12000μW/cm² power rating, for one, and why so complicated? Why not 12mW/cm² (which is equivalent, with a lot less zeros)? Why not 30J/cm² (which is equivalent to 30W.sec/cm²)? Maybe the reasoning has been lost on me because I wasn’t a technician in the late 70’s … I wasn’t even born, but it just seems peculiar and oddly specific.

Instead, lets work the problem the reverse way. Lets first work out what the power rating of a regular G5 4W eraser tube would be. Thanks to Philips, their datasheet gives us virtually everything we need to know.

Tube Output -> 0.9W UV-C
Tube Length -> 13.59cm (including caps)
Tube Diameter -> 1.6cm

Tube Surface Area
π * 1.6 * 13.59 = 68.31079065965646417713171772603 cm²

Output Flux
0.9 / 68.31 = 0.01317507807052113706696057643812 W/cm²
            = 13.175 mW/cm²

Aha! As it turns out, we’ve been sitting on a lamp with a power rating of 13175μW/cm² all along. Actually, probably slightly higher since the length includes the opaque caps where no radiation is emitted, so the total radiated power is concentrated into a slightly shorter length. Knowing this, you could just take the suggested times and use it with your 4W eraser as the power is pretty much “close enough”.

But if we want to do the math …

15W.sec/cm²
= 15 / 0.013175078
= 1138.5131 s
= 18 minutes 58 seconds

30W.sec/cm²
= (above result) * 2
= 37 minutes 57 seconds

It corresponds fairly well to the suggested time frames, although with a few minutes of difference. In actuality, depending on the conditions of the EPROMs, time to erasure can probably be even shorter. The reason is that the specification sheets are often more conservative than necessary, to ensure that every part is erased sufficiently, and probably incorporates a margin. You could probably save some damage to the chips by shortening the erasure time, at the risk of “incomplete” erasure if you don’t expose them long enough.

Erasure Experiment Preparation

In order to prepare for the experiment, a single candidate of each type of EPROM (eight in total) was selected and programmed with the TL866CS programmer with all cells set to 0x00 (programmed state). The cells were verified, the window was cleaned with isopropyl alcohol, and then the chips were individually exposed to their method of erasure. The TL866CS was used to read-out and save the contents of the ROM after a period of erasure, and the erasure was repeated until the chip was erased completely (all cells 0xFF) or the test was aborted.

All chips, with the exception of the M27C64A managed to take a program the first time. Unfortunately, the M27C64A appeared to be defective with an inability to check its ID or verify after programming on the TL866CS.

traumatized-m27c64a

The M27C64A datasheet was consulted in regards to programming.

error-in-strategy-550

Iprestot appears that the MiniPro programmer was using the right strategy, although with a slightly higher Vcc for verify. However, I’m not certain that the pulse delay feature is set correctly, as the claimed algorithm has 100uS pulses applied until the data verifies correctly. I suppose a longer delay shouldn’t harm anything though.

Desperate to get the chip to operate, and curious as to how it got sold to me as “working” when it was so obviously problematic, I decided to tinker with the settings.

jacking-up-program-volts

I changed the program volts to 16V, which resulted in the lower byte programming successfully. This gave me some hope, but was a gross overvoltage. I pushed it another notch.

programs-okay-at-maxvolts-fakechip

At the maximum voltage of 21V, the chip programmed successfully and survived without permanent and instant damage.

chip-id-also-gets-programmed

It seems that the Chip ID has changed to reflect the data on the chip as well – indicating that the chip probably doesn’t have ID circuitry or if it did, it’s not functioning correctly. This may be a counterfeit remarked chip of the wrong type, or a damaged chip of some sort. Regardless, it was used in testing in this state.

Practical Erasure under 4W Tube

The first step was to determine how long it would take to erase the EPROMs under the 4W UV tube. Each chip was separately exposed in 30 second blocks by using a remote switch, and then the data was read out until the chip was completely blank or I had reached the limit of my patience (15 minutes). Each of the dumped ROM files were processed to determine the number of set bits (erased bits) using a simple C program leveraging the inbuilt popcount function of GCC (see Appendix A).

While in the post about the eraser itself, I looked at a single EPROM and made an animated GIF of it, I didn’t go to that length for these chips. Part of the reason was that many of the chips had so many cells in them that it wouldn’t be feasible to make web-resolution GIFs available (they’d be huge), and because by-and-large, the erasure trends weren’t significantly different. Instead, I’ve provided an image of the ‘roughly’ half-way erased point so that the patterns can be seen using the same conversion methodology.

The time based results were as follows:

4w-eraser-vs-eproms-profile

The erasure of chips can be seen to follow an initial phase of (generally) no damage. This may indicate the charge leakage has occurred, but insufficient to change the status of the bit. This indicates the amount of excess charge stored during the programming phase, and thus the EPROMs resistance to “bit rot” assuming equally leaky insulating layers.

After the charge has depleted sufficiently, a rapid rise to nearly completely erased follows. This means that the “bulk” population of cells has identical qualities (i.e. charge retained, insulating oxide leakiness, exposure to UV).

This is followed by a (potentially) long period where a remaining minority of cells are slowly erased. This may be because of physical obscuring by dirt, scratches on the window, or due to cell structure/manufacturing defects.

The amount of margin does appear to vary with the type of EPROM, but all types were erased (with the exception of the big M27C2001) in 720s or less, which is significantly below the datasheet recommended doses. This is probably because the datasheet recommends extra erasure to ensure full charge depletion to improve the margin between 0 and 1 for reliability reasons and to ensure validity of data under all specified Vcc and temperature conditions. I would recommend exposing for longer than the time required to show all erasure.

m27c64a-30sThe traumatized M27C64A (left) showed the smallest amount of margin, erasing almost immediately on exposure to the UV-C light. The erasure pattern shows some vertical bands, but is mostly scattered throughout.

m2716-90sThe next most sensitive was the M2716 (right). It seems these are older technology, lower density chips, and their sensitivity could be related to the larger per-cell area meaning more UV energy per cell and faster erasure (assuming the accumulated charge and charge level requirements keep the same). This one showed significant vertical bands of unerased areas, possibly alluding to structural differences or exposure differences to UV which can come about due to lens shape and mounting alignment of the chip.

The third most sensitive chip was the M27C4001, a relatively large capacity chip. It had vertical patterns as well, although it also had one stripe which as a bit “out of pattern”. The earlier cells seemed to erase better than the later cells.

m27c4001-120s

The remaining chips were mostly clustered together for erasure times. The M27C2001 (Small) and M27C801 had almost identical profiles when it came to the rapid-rise portion of the graph.

m27c2001small-210s

The M27C2001 (Small) had the most prominent vertical lines, where cells inbetween were mostly erased but those cells were more “programmed” or difficult to erase by comparison.

m27c801-210s

The M27C801 proved even more odd with both vertical bands (strong), horizontal bands (moderate) and an area in the top left corner where it was consistently more difficult to erase. This may reflect the fact the M27C801 is a very large device, and the portions of circuitry that make up the chip may have been imaged on separately, or made up of several “slices” with slight differences in alignment or design. Or maybe it reflects its prior usage and abuse in programming or erasure.

am27c040-240s

The next chip in sequence is the AM27C040 which didn’t rise as quickly (suggesting there was some variance in dose requirement in cells). It seems to have some vertical band repetition, but with semi-random noise in the distribution of erasure patterns.

m27c512-270sh

The M27C512 showed some areas of easy erasure (horizontal bands) interspersed with bands of difficult erasure (vertical bands).

m27c2001big-270s

The M27C2001 (Big) seemed to show some interesting vertical bands (thin) and some sort of “patches” of easy to erase (near top and bottom corner). It kinda looks like a greyscale bad-photocopy when zoomed out.

In all, the EPROM erasure process exposes the cells don’t all erase at the same rate for various reasons, and depending on how the cells are plotted (stride length across, order), can reveal odd periodicity patterns which probably reflect the physical structure of the memory array. A bit of technical art, I suppose.

Practical Erasure under the Sun?

As EPROM erasure can occur with the presence of 400nm and shorter wavelengths, a widely available source of such light is natural sunlight. Indeed, people have reported erasing EPROMs under sunlight, and datasheets warn against exposure to any external artificial fluorescent light or sunlight because of the possibility of slow erasure. I wanted to know just how long it would take to erase using the sun, so the first thing I did was to try and estimate this based on data that is available.

If you use IEC60904-3 Ed.2 (2008), the reference solar spectral irradiance data is generated by NREL SMARTS. Table 1 gives the cumulative integrated irradiance from shorter wavelengths to longer wavelengths, normalized to 1000W/m² or “approximately” noon-time irradiation. At 400nm, the cumulative integrated irradiance is 45.97W/m². This can be converted to 4.597mW/cm².

Depending on your atmospheric conditions, weather, latitude and obstructions, the amount of “peak sun hours” you get in a day can vary, as can the UV content. In my case, I would estimate about 3 PSH per day because of obstructions, so the total dose is about 13.791mJ/cm²/day. This means that in one second under the 4W eraser tube, we get the same amount of usable UV as you would expect for a day under sunlight. To erase a 15W.sec/cm² EPROM would take 1087 days (2.978 years) or twice as long for a 30W.sec/cm².

This would be an impractical method of quickly erasing EPROMs, however, people online have reported erasure as quickly as in days to a week. This might be because the UV content in sunlight is really hard to estimate reliably based on models, but more likely, that the EPROMs may be affected by wavelengths slightly above the 400nm cut-off as well. Whatever the case is, I really wanted to see just how long it would take by experimental means.

I chose the M27C64A (a potentially dud, but easy to erase chip) and the M27C801 (a large, averagely difficult to erase chip) to see just how long it would take. These chips had all cells programmed (0x00), windows cleaned with isopropyl alcohol, and sat in a breadboard outside in the backyard in a horizontal position. Every day (or few days in the later cases), the chips were returned inside briefly to be read-out until the chips showed full erasure (all cells 0xFF).

sunlight-vs-eproms-profile

As it turns out, this was a major reason why this post took so long to put online. The M27C801 only finally had all cells erased after 107 days, whereas the “easy” chip managed to clear-out after just 6 days. It seems that sunlight is stronger than the SMARTS based prediction indicated, especially noting that during the test period, we had some severe rain storms and it was winter in Sydney. Of course, it’s worth noting that EEPROMs which just return erased condition may not be entirely reliably erased especially if the Vcc varies or the read-out conditions change (I’ve had dissimilar readouts one after another for some borderline cells), so additional irradiation is needed to ensure full erasure (just as in when using the tube-based eraser). With the chips, it seemed the erasure followed a similar trend with the UV tube, with the majority of cells erasing in a smallish window of time, but with remaining “tough” cells taking significantly longer to clear.

m27c64a-d3The M27C64A (day 3, left) showed a mostly even erasure profile with a few vertical bands noted. This probably reflects the structure of the chip internally and is similar to the tube based erasure results.

The M27C801 (day 32, below) showed some differences compared to the tube based erasure, with the four vertical bands being much lighter, and the presence of new dark horizontal bands. This probably reflects some shadowing due to the large die and correspondingly sized window.

m27c801-d32

I have a feeling that the M27C801 may have erased faster if the placement was more optimized. Because it was laying horizontally on the ground, and its window clearance to the size of the chip was relatively small, the angle of the sun may have caused portions of the chip to be shadowed for a good portion of the day, meaning that the dose received in those cells is only a small fraction of that received by the other cells (exaggerated in the drawing below).

erasure-by-sun-tilt

Tilting your chip towards the sun, so that the radiation goes through the window perpendicularly during noon-time may optimize the exposure of the cells and result in faster erasure.

Conclusion

It was determined that the “so called” 12000μW/cm² lamp is basically the low-pressure mercury UV germicidal tube that is employed by many erasers. By working out the flux from a 4W G5 tube, it was found that the emission was close to (slightly above) the level required by datasheets, so their claimed times should be applicable to these erasers.

The actual time to report erasure was generally <=720s for EPROMs which were good. One unit failed to erase completely after 900s, however, may be restored after even further exposure and may have been an outlier (due to settled dirt inside the chamber potentially).

Sun based erasure was investigated with SMARTS which predicted 3-year+ times to erasure. In practical cases, it appeared that 4-months was enough for the average case EPROM, with the weak one erasing within a week. Sunlight erasure can be practical depending on the EPROM, although tilting the alignment of the EPROM towards the sun will probably improve erasure speed by avoiding shadowing.

To ensure reliability, erasure beyond the point where a device returns 0xFF may be necessary – the amount is probably up for discussion, but at least now I know the minimum amount of time exposure necessary to expect a clean EPROM, and thus, might be able to avoid excessive damage to chips when it comes to write-erase cycling them.

Appendix: Counting Set Bits

This is a short program intended for compilation with GCC to count the number of set bits in the input (stdio) and print the result to stdout.

#include <stdio.h>
int main (void) {
  int cchar;
  int accumulated=0;
  for(cchar=getchar();cchar!=EOF;cchar=getchar())
  accumulated += __builtin_popcount(cchar);
  printf("%d",accumulated);
  return(0);
}

About lui_gough

I’m a bit of a nut for electronics, computing, photography, radio, satellite and other technical hobbies. Click for more about me!

This entry was posted in Computing, Electronics and tagged , , , , , . Bookmark the permalink.

3 Responses to Experiment: Time to EPROM Erasure by UV Lamp & Sun?

  1. Mark says:

    Try googling around for some of the history of population count instructions in computer hardware (particularly early “supercomputers”). Hint: they are a favorite of all the Three Letter Agencies…

    • lui_gough says:

      That gave me a chuckle … but yes, they seemed to like it for cryptanalysis and statistical analysis reasons. Having dedicated hardware abilities for very rapid/efficient processing. Luckily I’m not particularly worried about efficiency – it’s a very useful instruction (or compiler built in library function), especially when you’re just not bothered with writing a few lines of shifts and masks to do it crudely, or think even harder to optimize it.

      This reference seems to be the go when it comes to bit twiddling:
      http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetNaive

      – Gough

  2. freddyzdead says:

    I’m giving my age away here, but I left the naked eproms from my Microbee computer in the sun for a year to see what would happen. I made copies of them first, of course, and the copies were running in the computer. After all that time, I swapped them back, and everything still worked. They were 2732 types, as I recall. And yet, the UV eraser would erase them in about 15 minutes.

    I haven’t come across mention of Microbee anywhere in the blog; look it up, nice little Z-80 computer, made in Sydney. Mine had 64k of static RAM (6116), unheard of at the time.

Error: Comment is Missing!