FPGA replacement for VIC I chip?

Modding and Technical Issues

Moderator: Moderators

User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: FPGA replacement for VIC I chip?

Post by eslapion »

Identifying resistors and capacitors in there:
Image
Full size here: http://oms.wmhost.com/misc/sid_filter.gif

And should you find something like this well it appears to be a FET OP-AMP:
Image

There must be a number of these in the 6560/61 design as well.
Last edited by eslapion on Thu May 12, 2016 3:17 pm, edited 1 time in total.
Be normal.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

Thanks for those images and links. What I'm noticing in the next part of the die shot are some very large polysilicon areas through which roughly normal width diffusion lines are passing. Similar areas in the pictures that you have shown are identified as resistors in those pictures. The examples I am looking at in the 6561 die shot do not weave around in the serpentine way though but rather pass straight through the large polysilicon areas.

Normally when a polysilicon area covers a diffusion line, it is identified as a transistor. If these are transistors though, then they are much longer, i.e. the diffusion passes through a much longer area of polysilicon. A lot of these large polysilicon areas are connected directly to VDD. I am wondering whether the length of the polysilicon that it passes through equates to the resistance.

Edit: To quote the classic Mead/Conway VLSI design book, "A fully turned on transistor has approximately one thousand times the resistance of the diffused and polysilicon layers" (page 51). They go on to say that this equates to 10000 ohms per square area. Apparently it doesn't matter what the size of the square is. But let's say you had a long transistor drain to source path that is 10 "squares" long. Well that would apparently be 100000 ohms (roughly; its not accurate).
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: FPGA replacement for VIC I chip?

Post by eslapion »

I'd be tempted to think of 2 possibilities:

1. It may be necessary for high value resistors to have longer traces and serpentine may be a solution to have these occupy a smaller footprint.

2. Small transistors tend only to operate correctly in saturation mode and that's good for digital signaling; however there are op-amps in there which need to be good at replicating analog signals and they have to be larger.

In the above image, there are two small serpentine which are designated as resistors.

The one very long serpentine seems to be referred to as "voltage controlled resistor"

There are also serpentines in the areas designated as op-amps but they seem covered with a different type of layer.
Be normal.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

I haven't yet worked out any of the circuit, but this is a first look at where the colour lines go after leaving the previous die shot image:
beyond_shift_reg_17.jpg
This image shows 15 lines coming up from the bottom of the screen. These all lead to different pass transistors that control access to the same metal line that has nine metal to diffusion contacts along it (there is a 16th pass transistor, but this doesn't connect to a line that comes up from the bottom of the screen but rather connects to one of the metal lines, the first of the narrow ones from the bottom). At the top of the image, it shows four metal lines, which will become important in a future post. 14 of these 15 lines leading up from the bottom relate to the colour lines that we saw in the previous die shot image, i.e. the two lines for each colour that were heading upwards (2 x 7). That is the interesting part actually. For every colour (remember there are seven), there are two lines coming up from the bottom, and for each colour, it selects two of the four metal lines at the top of the image. The two lines that are selected will be different for each colour. It might be too early for me to say, but it sounds a lot like what Bob Yannes was saying.

It might not be completely clear in the image, but there is a very large polysilicon area in the middle of the image that spans nearly the whole width of the image. It is connected to VDD. There are 16 diffusion lines crossing over this polysilicon area (each ending at a pass transistor, the 16 mentioned already). It is the pass transistors already mentioned that control whether what is on those diffusions lines passes through to the metal line with the nine metal to diffusion contacts on it.

The length of the diffusion lines passing over the polysilicon areas will relate to a certain amount of resistance.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

lance.ewing wrote:They go on to say that this equates to 10000 ohms per square area. Apparently it doesn't matter what the size of the square is.
To make things a bit clearer, I've created a version of the image in the previous post that is illustrating the concept of the resistance being by square area. I've done this by laying out little white squares along the lengths of each of the resistors.
beyond_shift_reg_18.jpg
Those four metal lines at the top (mentioned in the previous post) must be the four lines that have the SIN, /SIN, COS, and /COS as previously discussed, and as mentioned in the seemingly related Commodore patent. If we were to label them from left to right as 1, 2, 3 and 4, then I believe that these are the angles for those:

1 = 180 (Yellow)
2 = 0 (Blue)
3 = 270 (approx a Cyan colour, but not exactly the VIC cyan)
4 = 90 (approx a Red colour, but not exactly the VIC red)

I'm only just learning this as I'm going along, but I assume that the Blue would be the SIN one? The Yellow the /SIN? The Red the COS? The Cyan the /COS? Correct me if you think that's wrong.

As already mentioned in the last post, each colour is selected from two of the four metal lines. The two metal lines selected will be the two closest to the desired colour when viewed on the UV colour wheel (see Pepto's image here to get an idea: http://www.pepto.de/projects/colorvic/uv-scope.gif). For example, Orange is half way between 90 and 180 (i.e. ~135), and so the two "waveform" metal lines from the top that the Orange control lines coming in from the bottom of the image are selecting are in fact those two metal lines, i.e. the ones I've labelled 1 and 4

As can be seen for the above diagram, the resistors are of varying lengths, and this will mean varying resistance. The amplitudes of the two waveforms are apparently controlled by this and work together to determine the phase shift. To quote what Bob Yannes said:

"An analog summer was used to create the phase-shifts in the Chroma signal by adding together the appropriate two waveforms at the appropriate amplitudes. The Color Palette data went to a look-up table that specified the amplitude of the waves by selecting different resistors in the gain path of the summer. The end result was that we could create any hue we wanted by looking at the NTSC color wheel to determine the phase-shift and then picking the appropriate resistor values to produce that phase-shift."

This seems very much like what we're seeing in the 6561 die shot, except that it's obviously PAL we're looking at.

Placing those white boxes was a temporary thing to get a rough idea. What I want to do now is measure the relative resistance more accurately, by working out as close as I can get how many times longer each resistor is than its width. The ratio between the numbers determined for the two resistors used for each colour should in theory allow the phase shift to be worked out. Might take a bit of math though.

A few interesting things to note: Although the VIC-I Yellow and Blue colours are in theory at 180 and 0, the die shot shows that they still select two of the waveforms, and that they are still mixing those together. But the difference in the resistor lengths is quite large, so that although Yellow is selecting both the 180 and 90 waveform lines, it is very strongly weighted towards the Yellow (the resistor used with the 90 line is 25 squares long, whereas the resistor used with the 180 line is just over 4 squares long). I guess what this might mean is that in theory Yellow is ever so slightly off the 180 line. Something similar must be true of Blue.

In the case of Orange, the number of squares of length of the two resistors is roughly the same, which is what we'd expect, since it is halfway between the two angles. Strangely though, Purple and Green do not appear to be weighted evenly between their two waveforms.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: FPGA replacement for VIC I chip?

Post by eslapion »

lance.ewing wrote:They go on to say that this equates to 10000 ohms per square area. Apparently it doesn't matter what the size of the square is.
Makes perfect sense to me: if a surface area of a conductive material is larger, you have more pathway to conduct so you have to compensate by making it longer to re-increase resistance.

The consequence is: if the thickness of the material remains constant, the resistance is going to be the same no matter what the size of the square may be. If you increase or reduce the size of the pathway, you are effectively increasing or reducing the length of the conductive material accordingly when scaling the square.
To make things a bit clearer, I've created a version of the image in the previous post that is illustrating the concept of the resistance being by square area. I've done this by laying out little white squares along the lengths of each of the resistors.
And you can see the 2nd tiled pathway to the right has been intentionally stretched a bit longer.
If we were to label them from left to right as 1, 2, 3 and 4, then I believe that these are the angles for those:

1 = 180 (Yellow)
2 = 0 (Blue)
3 = 270 (approx a Cyan colour, but not exactly the VIC cyan)
4 = 90 (approx a Red colour, but not exactly the VIC red)

I'm only just learning this as I'm going along, but I assume that the Blue would be the SIN one? The Yellow the /SIN? The Red the COS? The Cyan the /COS? Correct me if you think that's wrong.
I think you're right on!

This is just a 90 degrees shifted version of creating colors using HSV in Photoshop. In Photoshop, 0 degrees is red.
The amplitudes of the two waveforms are apparently controlled by this and work together to determine the phase shift. To quote what Bob Yannes said:

"An analog summer was used to create the phase-shifts in the Chroma signal by adding together the appropriate two waveforms at the appropriate amplitudes. The Color Palette data went to a look-up table that specified the amplitude of the waves by selecting different resistors in the gain path of the summer. The end result was that we could create any hue we wanted by looking at the NTSC color wheel to determine the phase-shift and then picking the appropriate resistor values to produce that phase-shift."

This seems very much like what we're seeing in the 6561 die shot, except that it's obviously PAL we're looking at.
This implies you never need to sum more than 2 of them to get the color you want.
Placing those white boxes was a temporary thing to get a rough idea. What I want to do now is measure the relative resistance more accurately, by working out as close as I can get how many times longer each resistor is than its width. The ratio between the numbers determined for the two resistors used for each colour should in theory allow the phase shift to be worked out. Might take a bit of math though.
I don't think you have to go that far. I think it's worth it to compare the lengths of resistors relative to one another and that will give you how much of SIN and how much of COS, etc... is in a color. However, given what I said above, the length to width ratio appears completely irrelevant. I really think what matters is the length of one vs the length of the other.
A few interesting things to note: Although the VIC-I Yellow and Blue colours are in theory at 180 and 0, the die shot shows that they still select two of the waveforms, and that they are still mixing those together. But the difference in the resistor lengths is quite large, so that although Yellow is selecting both the 180 and 90 waveform lines, it is very strongly weighted towards the Yellow (the resistor used with the 90 line is 25 squares long, whereas the resistor used with the 180 line is just over 4 squares long). I guess what this might mean is that in theory Yellow is ever so slightly off the 180 line. Something similar must be true of Blue.
Excessively pure colors don't display well in both NTSC and PAL. When creating colors in Photoshop using the HSV system, colors with high luminance can easily trigger an excessive saturation warning (the little '!' symbol ) which indicates the color chosen cannot be displayed accurately.

Both blue and yellow on the VIC-20 palette have a high luminance value and so certainly require a bit of balancing to remain within acceptable video displayable colors.

NTSC and PAL color gamuts are far more restrictive than free analog RGB.
In the case of Orange, the number of squares of length of the two resistors is roughly the same, which is what we'd expect, since it is halfway between the two angles. Strangely though, Purple and Green do not appear to be weighted evenly between their two waveforms.
Same as above.

This was posted by "Firestorm" on Atariage forums in oct. 2014
Image
This wheel shows all the colors you can SIGNAL.

But below is shown the limits of what can actually be DISPLAYED
Image

It's very likely the FCC in the US and whatever communication comission in Europe would have prohibited the sales of the VIC-20 and C64 if these machines were to send signals to television sets beyond their acceptable limits.

Note blue and yellow have much more stringent limits than red and cyan.
Last edited by eslapion on Fri May 20, 2016 9:28 am, edited 1 time in total.
Be normal.
groepaz
Vic 20 Scientist
Posts: 1187
Joined: Wed Aug 25, 2010 5:30 pm

Re: FPGA replacement for VIC I chip?

Post by groepaz »

It's very likely the FCC in the US and whatever communication comission in Europe would have prohibited the sales of the VIC-20 and C64 if these machines were to send signals to television sets beyond their acceptable limits.
not quite - if you violate those specs you either dont get an image (because bursts are not detected) or nothing happens at all (out of gamut colors simply dont show).
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

The eagle eyed amongst you will have noticed that there are 16 resistors that I had marked with squares, and that there are 16 pass transistors, i.e. one below each resistor. But there are only seven colours, two pass transistors for each, making 14 resistors used for that purpose. So we need to answer the question as to what the other two resistors are for. Well a bit of analysis suggests that it might be related to the colour burst, at least that is what I'm currently wondering. The "colour" created by those two resistors appears to be very similar to the Orange colour. The control line that connects to the two pass transistors does not come from the normal path through the shift register, NOR decoder, etc. It comes from elsewhere on the chip. The colour burst is the only thing that I can think of that would need to create a certain phase shift on the chroma output that is not related to the pixel data.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: FPGA replacement for VIC I chip?

Post by eslapion »

Almost one week and we still don't have the next chapter to this extremely thrilling saga.

8)
Be normal.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

I've been exploring in three different directions since the last image. We obviously have the sine & cosine wave generation in the above direction. I've also been looking at what happens after the two waveforms are combined. And then there are those seven colour control lines (and the black, b/w and shade lines) heading downward that we're assuming are related to the luminance.

I should pick one, complete it and present. Friday nights are usually a good time to find a spare few hours, so hopefully there will be something later this evening.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

If we look immediately above the previous image we were looking at, we see the following:
beyond_shift_reg_19.jpg
We can see the four metal lines at the bottom that carry the /SIN, SIN, /COS and COS wave forms. All four of these metal lines turn and head upwards in parallel. The first of these to hit a metal to diffusion contact is the /COS (or COS' ) line. The rest of the image from that point upward is what I believe must be the two integrators that convert the square wave to the equivalent sinusoidal wave. In this case it is the inverse cosine wave that is being created.

In the top left corner we see a diffusion line coming in with a label of FC2. This is a label that Segher Boessenkool added to his 6561 image here:

http://segher.ircgeeks.net/vic/

I've simply tracked his label through a number of logic gates to get to this point. The F probably means either Frequency or Phase, and I think he would have meant the C to mean colour. So this is presumably phase 2 of the colour clock. I'm going to make an assumption that it is the colour burst frequency, i.e. the frequency of the PAL sub-carrier, which is 4.43361875 MHz. This is obviously also the same frequency of the 6561 master oscillator clock input on pins 39 and 38. If you take a close look at the Commodore patent that covers the generation of a SIN, /SIN, COS and /COS wave from a digital pulse generator, you'll notice that it starts off with a colour frequency that is 4 times the colour burst frequency. I haven't yet seen any evidence of this in the 6561, in fact I'm fairly sure at the moment that that line that I've labelled as FC2 is already the 4.43361875 MHz clock and that there aren't any divide by two shift registers in there like there are in the patent (although perhaps the NTSC 6560 chip has these given its input clock is 4 times the NTSC sub-carrier frequency).

So returning to the image above, my current guess is that the top part is the integrator that converts the square shape of the FC2 clock in to the triangular wave, and that the middle part of the image is the integrator that converts the triangular wave in to the sinusoidal wave. A basic integrator (according to wikipedia) should have an opamp, a capacitor, and a resistor.

This is where I might need some help and suggestions. I can see a number of resistors in there. For example, starting at the FC2 label in the top left corner, there is a resistor almost immediately. This is recognisable by the diffusion line crossing over a polysilicon area that is wired directly up to VDD. The diffusion line then encounters a buried contact. There is a thin polysilicon line going down from there, but if we continue further to the right, the diffusion line then encounters a very long resistor that takes us all the way to the right hand side of the image.

I can also see some transistors, both depletion mode and enhancement mode. Immediately below the first shorter resistor that we identified above, there is a depletion mode transistor. If we look slightly to the right of that depletion mode transistor, there is an enhancement mode transistor (this is the one whose gate is connected to the thin polysilicon line that comes down from the buried contact already mentioned).

What I'm uncertain about is where the capacitor is. I'm also uncertain what the exact boundaries of the op amp are. My guess (based on the fact that it doesn't look like a resistor or a transistor) is that the capacitor is the large polysilicon area to the left of the enhancement mode transistor that I just mentioned.

Above this image, the same integrator pattern is (roughly) repeated again for the other three waveforms. I think if we work out the circuit of this first one, we'll then be able to work out the other three.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

While we're thinking about those integrators, I'm going to start looking along another direction, which is to the left of the image I was discussing last weekend. If you will recall, the colour control lines where used to select two of the waveforms at particular amplitudes determined by resistors. This is what produced the phase shift required for the colour. That "mixed" waveform representing the phase shift is on the metal line at the top right of the following image:
beyond_shift_reg_20.jpg
It would be a good time to quote Bob Yannes again at this point:

"An analog summer was used to create the phase-shifts in the Chroma signal by adding together the appropiate two waveforms at the appropiate amplitudes.r[/i]."

The bit that we were looking at last weekend was the adding together of the appropriate two waveforms at the appropriate amplitudes. This is only part of the summer. Let's have a look at what an analog summer is:

http://www.allaboutcircuits.com/textboo ... -circuits/

Ignore the bits about averaging on that web page. What we're interested in is the bit that starts talking about summers. If you scroll down on that page a bit, you'll see diagrams and a discussion of both a non-inverting summer and an inverting summer. I'm not yet sure which one we're dealing with, but my gut feel at the moment is that the above image contains the op-amp part of the summer. Last weekend we were looking only at the resistors at the start of the summer.

What I find very interesting (and I think it can help towards solving the mystery of the integrators used in the sinusoidal wave generation) is the similarity between the layout of what is shown in the above image and what was shown in the previous integrator image. The main difference is that the above is laid out vertically, whereas the examples in the previous image were laid out horizontally.

Let's rotate one of them and put them side by side for comparison:
beyond_shift_reg_21.jpg
Very similar, aren't they?
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

Pages 47-49 of the C64 PLA Dissected document appear to be relevant here in determining how the capacitor works. It shows three different capacitors, all three of which have a similar overlap pattern that I'm seeing in the images we've been looking at above, so I'm confident now that it is a capacitor that we're seeing. Hopefully I can use the C64 PLA Dissected doc to help work out the schematic.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: FPGA replacement for VIC I chip?

Post by eslapion »

lance.ewing wrote:Pages 47-49 of the C64 PLA Dissected document appear to be relevant here in determining how the capacitor works. It shows three different capacitors, all three of which have a similar overlap pattern that I'm seeing in the images we've been looking at above, so I'm confident now that it is a capacitor that we're seeing. Hopefully I can use the C64 PLA Dissected doc to help work out the schematic.
PLA dissected is a nice document but it is about a strictly digital IC.

Somehow, I suspected the information about the various revisions of SID would be more useful to you. It is clearly a mixture of analog and digital circuitry and it is completely mapped on all layers.

There is now a project for a kit of the MOS 6502 in a discreet components format. IMHO, this indicates all parts of that circuit are now documented. I thought of doing the same for the SID.

Perhaps your work will allow to do the same for the 6561.
Be normal.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: FPGA replacement for VIC I chip?

Post by lance.ewing »

eslapion wrote:PLA dissected is a nice document but it is about a strictly digital IC.
I think those pages have pointed me in the right direction though. On page 47, it talks about RC low-pass filters, and through reading up on those, I've realised that the integrators I've been looking at in the images above may not have op-amps in them at all. They could be simple RC integrators like those described on the following pages:

http://www.learnabout-electronics.org/a ... ters85.php
http://www.daenotes.com/electronics/dig ... er-circuit
http://evalidate.freehostia.com/RLC/rcI ... heory.html

Edit: The bit I am puzzled about is the inverter. There is clearly an inverter near the start. The depletion mode transistor looks pretty standard, but the enhancement mode transistor is very wide. If we look back at the complete part for what I think must be the /COS generation, I've been assuming that there are two integrators connected in sequence, one that would presumably create the triangular wave from the digital square wave input, and the other that would convert that in to something approximating a sinusoidal wave. But for each of those integrators, all I can spot is the following components: one short resistor, one long resistor, a capacitor, and an inverter (made up of a depletion mode transistor and very wide enhancement mode transistor). I think I need to figure out how to simulate this and see what happens.
Post Reply