VIC-2000 Expander. Modern Power Using Retro Parts!

Modding and Technical Issues

Moderator: Moderators

User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

The next few panels of breadboard will be occupied by the Dual Video Buffer Switcher...

Image
The Dual Video Buffer Switcher (VBS)

All my images are larger than the forum screen - just right click and view for full size.

The VBS is a bit more chip intensive, but again just a simple switcher.
Here, I will require 16 buffers (74HC245), and 4 SRAMs (512K).
SRAMs are paralleled, to make 512Kx16 from a set of 512Kx8 SRAMs.

The basic operation is simple, opposing sets of buffers access the SRAMs as per FLIP.A/B.
The GPU and Sync Generator share access to the SRAM, each being swapped when required.
This is called a "Double Buffer", and equates to extreme speed and flicker free animations.

How a double buffer works is that the VIC-20 can draw one screen while the other is being displayed.
By using the help of the GPU, the VIC can render up the next frame, and then just FLIP it out.
A graphics intensive game might require 50 large sprites. No problem for my VIC!

Signals VDAT.A and VDAT.B head right into the Video Data Switcher.
These signals contain the 12 bits of active pixel data ready for display.
The Sync Generator is pumping out these bits based on timing created by the VIC-20.

GPU.DAT and GPU.ADR allow read and writing of the non displayed buffer (Back Buffer).
The VIC will usually request pixels to be hurled here by the GPU from the large 4MB Media memory.
The Sprite Generator is part of the GPU, and will be aware of Sprite size as well as Alpha Color.

I will have to lay down at least one half of this circuit as soon as the VDS is tested.
Using only one buffer will be fine for testing, as I only need to see a static image.

As you can see, I already have 8 different busses in this system, and this is only the simple part.
That's 124 IO pins already, which is why this not exactly an FPGA friendly project.
Well, I could get into 8 layer PCB design and an expensive ball gate array, but that ain't retro!
I find it ironic that a retro project would cost a LOT more to do with modern components.
Performance of this system will run circles around the one I did with the FPGA recently.

On a side note, the input buffers on this project are 74HCT245s (from VIC to breadboard).
In my other system, I used 74LVC245 buffers to translate from 5v TTL to 3.3v CMOS.
Here, the HCT variant does that job by lowering the input requirement of standard 5v CMOS.
Just wanted to point out, that level translation is different on both of my projects.

Now where did leave that 1000 foot box of wire?

Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Now that I am starting on the real VIC-2000 prototype as per my design goals, I figured it was time to press Reset and begin document everything from the start. All the work I have done with my other 6502 projects as well as the FPGA project posted elsewhere here has been experimental, leading up to this point in time. I now feel I know enough about the 6502, the VIC, and the limits of my breadboard.

As of now, The VIC-2000 Project shall commence.
I have cleaned off both boards, and started placing chips based on my schematics.
Normally I don't bother with schematics, but for this project I will.

So to really start at square-one, here are some details on my V2K breadboard and how the VIC interfaces.
I am using 48 individual breadboards all wired together for this project. So with the bus bars, I have about 50,000 ties points to work with! Yeah, it seems like a lot, but I actually think I may need more room by the time I am complete. Due to the massive size of all boards tied together, I have broken them up as 2 equal panels of 24 boards each. If all goes well, I will have one panel for the Video Section, and the other for the Sound Section.

I buy my breadboards from Twin Industries because they make great quality boards. The China cheapo boards are garbage.
Each board has top and bottom power rails, and an underside sticky tape.

Image
Breadboards to make up one panel.

To make each panel solid and somewhat static proof, I cut some 1/4" aluminum plate and then made backing bars that can be drilled or machined to support various connectors such as VGA, Audio, Joysticks, Power, etc. The backing bars are drilled and tapped to be fastened to the top end of the plates. Did I mention that I work in a machine shop?

Image
Making solid bases to affix the multiple breadboards.

After peeling off the tape protector on the underside of each breadboard, I carefully placed them onto the aluminum plate one at a time, locking them together with the dove-tail locking tabs included on the outer edges of all boards. Here is the first panel ready.

Image
One completed panel of 24 breadboards.

Although I don't go overkill on decoupling capacitors when bread-boarding, I do put them on all power rails. Because a breadboard is really one large array of capacitors created by long metal strips, this is usually fine. For micro-controllers or fast counters, I also add caps at the chip power supply pins as well. The caps I use on power rails are the typical .1uF ceramic type, and cost only pennies per unit.

Image
Capacitors will be installed on all of the breadboard power rails.

After the decoupling capacitors were placed on the power rails, I then connected all power rails together using appropriately colored red and green wires, keeping them as short as possible. In an attempt to minimize a demon known as "ground loop" or "ground bounce", I can power rail connecting wires both horizontal and vertical. This giant board is still a hotbed for ground bounce, but I can fight this enemy because I know it will be hiding in the shadows awaiting my arrival.

Image
Capacitors and power rail connecting wires installed.

I built a second identical panel of 24 breadboards, and then machined out the backing bars to support some of the connectors I may want to use. The Video Board (left) has a VGA connector, DC jack, power switch, and one free hole. The Audio Board (right) now has a stereo audio jack, power jack, and 2 commodore type joystick ports. As you can see, there isn't much room left for the VIC-20 with both boards on the table. I intend to build a special workbench later just for this project.

Image
Lofty goals shall require the mother of all breadboards!

I couldn't resist this photo. Prime real-estate ready to be developed...

Image
Most likely, I will add a third board before this is over.

Here is a close shot of one of the joystick connectors. The hole is milled out to fit the body of the connector, and then machined to allow the business end to stick out the rear of the backing bar. I added the 74HC245 buffer already just because I knew I would eventually need it to send the joystick values to the memory mapped bus. The reason I have external joystick ports is so the VIC can have 2 joysticks, and because I plan on adapting a modern optical mouse to the VIC-20 joystick port to make using the IDE / Assembler more comfortable.

Image
One of the two Commodore type joystick port connectors.

I might have already posted this, but since I am already yammering on, I will just continue. I am adapting the VIC-20 expansion port to my breadboard using the standard edge card that all cartridges use. Since these are hard to find new, I dug around in my vast collection of 1970's computer bits to find this board, which matched the profile of the VIC-20 game cart board shown below the larger card.

Image
Found a matching edge card after an hour of digging.

The donor card needed some reworking to be used in the VIC expansion port since it was too wide, and already had traces. I used a dremel to cut the board to the correct width, and then shaved away all traces right at the entry point into the connecting edge. The tape over the connecting pins allows me to add solder only in the place I want it. This masking process is the same technique used to keep solder off traces when a real PCB heads through the molten solder bath.

Image
The resized board getting some solder on the top inner edges.

I added a bundle of wiring to all of the important VIC-20 expansion port signals. Wires are color coded into various functions such as Data, Address, Block, and Control signals. The wires are about 18 inches long, but previous testing has shown that the VIC has no issue with this. That's one of the nice things about a "slow" 1MHz signal, it is almost impossible to break. On the breadboard, this will not be the case, since most of my logic will be running at 25MHz.

Image
Wiring added to adapt all important signals to the breadboard.

The new Expansion Port breakout system fits perfectly into the VIC-20 port. It's not the prettiest looking hack, but this breadboard project is only stage one of this project. Once working, the breadboard system will be duplicated onto a permanent hand wired board.

Image
Board to VIC... can you hear me now?

I left enough wire so that I could adjust the VIC a little when I am entering code. Since I plan on doing all coding directly on the VIC, it needs to be in a place on the desk that is comfortable to work with. The connection at the breadboard is just a 40 pin DIP socket that the wires are soldered to. I made a pin-out diagram for it, and it lives like any other IC on the board.

Image
To the breadboard, the VIC is just another 40 pin IC.

Having worked up some schematics already, I am now going to turn them into real hardware one bit at a time. I will build only as much as required so that I can test each subsystem before moving ahead. It is way too easy to make progress on the hardware without documenting anything, and then get lost in what was done. This time I am going to plan on paper, make a schematic, then add hardware a bit at a time. I do have to build a second unit some day.

So here is the first part of the schematic to make real, the Video DAC and Synchronizer...

Image
This circuit is responsible for driving the VGA monitor.

The Video DAC and Synchronizer is a very basic circuit that drives all of the signals require to generate a color VGA image. Before reaching the 15 pin VGA connector, all signals are synchronized along with the master 25MHz clock. This is very important because a modern VGA monitor can actually see half a nanosecond of jitter, which will translate into a distorted image on screen.

The Horizontal Synce (HS) and Vertical Sync (VS) signals are just digital signals. Both are active low for a 640 x 480 VGA standard mode. Sync signals are generated by a VIC-20 programmable Sync Memory, which will be explained soon.

The color data is actually a set of 3 analog signals that range in value from 0 volts (black) to .7 volts (full color). How do you go about generating an analog signal from a digital system? Simple... use something called a Resistor DAC. If I apply 5 volts to all 4 of the parallel resistors, the output value will be very close to the requires .7 volts. Part of that equation is the internal 75 ohm pull down termination of the VGA itself. By altering the number of resistors with 5 volts or 0 volts, I can now sent a range of 16 analog values to the color channel for the VGA monitor.

Since each color channel has 4 bits, and since there are 3 individual channels, this gives VIC-2000 the ability to display 4096 (2^12) colors simultaneously on the screen. Back in the Day, the Amiga could kind of do this, but the truth is... my VIC thought "HAM Mode" was a cheap trick, and intends to show the world how 4096 colors should look!

There are a lot of signals to be connected for each of the 74HC164 4 bit counters that do the synchronization, but these will be coming in the next build session. For now, here is the schematic shown above turned into real hardware...

Image
This is a 3 x 4 Resistor DAC and Sync Synchronizer.

Using colored wires for various functions makes breadboard debugging much easier. I also bundle up wires, and bend them all into shape so they don't end up looking like a cat barfed up a ball of tinfoil on my board. Bundling wires works well of you consider cross-talk between different signals that may interfere with each other. For instance, I would not wrap up a 16MHz Sprite Generator Clock along with one of the VGA Color signals, or things would surely fail, or at least look bad.

Ok, so what's the deal with these bling resistors? They are blue and have too many bands!...

Image
High tolerance resistors are best for making DACs.

The extra band means that these resistors are high tolerance (very accurate). These resistors happen to be 1% precision, which means that a color scale of shades will make a smooth transition on the monitor. Normal resistors can be out as far as 5 or 10 percent, so this would be noticeable on the color output. The good news is that these 1% precision resistors are common values, and inexpensive.

I actually compared this $2.00 resistor DAC directly against a true 24 bit VGA DAC IC that cost over $25.00, and the difference was almost undetectable. The only time the real digital DAC did better was when I went into more color bits (7 or 8 per channel). A resistor DAC is very capable of doing a fine digital to analog conversion.

Ok, that's it for now. I hope everyone here likes an overload of photos, because I am using this thread to document this project so that I can later redo it onto a permanent board. Most likely, this will span a few hundred photos and become a 2-3 year long ordeal. There will probably be a few smoked chips along the way, and I will certainly post those photos for entertainment value as well!

Thanks for keeping this site alive, it has been a great resource for me, and will continue to be as I trudge along on VIC-2000.

Cheers!
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

I just realized that the DAC schematic I posted was an older version that does not match the photo. Since that design, I have changed to an R2R DAC, which is a slightly different and more accurate way to change binary values into an analog signal.

Here is the updated version, also showing some of the control signals...

Image
The new tipple 4 Bit R2R Digital to Analog Converter.

Looks like I have some free time coning this weekend, so hopefully I can get more of the hardware down on the breadboard. The programmable Sync Generator along with the 32K Expansion Memory will be the primary goal so that I can make a final decision on the screen resolution. I still have high hopes for being able to pull off 640 x 480 using a 25MHz Pixel Clock. That speed will be pushing the breadboard design very close to the edge... hopefully not right off the edge.

Later,
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

To my surprise, manufacturers of ICs did not consider bread-boarding hackers to be their topmost priority when designing the packages! Some of my ICs live close together in rows, but some of them require one lost hole between them due to the package overhanging the outermost pins.

Since board space is at a premium, it can be very annoying when you have to waste 9 holes per row because the last 10 pin chip won't fit by one single pin. Add to that, the fact that some genius way back in the day decided that a standard breadboard should have 63 pins rather than 64, and you have a situation that requires some serious hacking.

Image
I needed a row of 6 buffers, but that ain't gonna happen!

Remember that old jingle... "Shave and a haircut... two bits"?
Well, in this case, the shave will be 8 bits!

Image
A Dremel and some sanding / grinding discs.

A Dremel is a must have tool for any hacking lab. For me, it rates only next to the soldering iron and 6502 cheat-sheet.
I decided to not get defeated by my lack of breadboard holes, and make those damn chips fit.
Using the sanding disc, I shave off a bit of the package overhang on each side of the chip.

One note of caution : Grinding ICs makes fine dust. Not sure what is is made of, and don't care.
You should use a high end dust respirator mask to avoid inhaling any of the dust when grinding.
Or just do what I do... hold your frickin' breath dude!

Image
Just a little off the top, please!

After the shave, I managed to get all six 74HC245 buffers onto a single row.
There was even 2 holes left over, which will leave space for vertical wire bundles.

Image
One row can now switch 48 bits. Perfect for my latest project.

The only thing to watch out for is the exposed tab on each leg as you remove the case edge.
The IC legs are T-shaped in the package, so grinding the end exposes the metal.
This is no issue at all if you make sure to leave a small gap like this...

Image
Leaving adequate space between each package.

Without the gap, there is a chance of conductivity between ICs pressed too close together.
Other than that, this system has done me well since I started doing it in 1984!

Ok, now back to the project. I just wanted to detail everything that happens along the way.
If I spill a beer on the breadboard, I will show that too!

I am now connecting some of the Sync Generator circuitry so the VIC can test 640 x 480 mode.

Later,
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Had a productive afternoon in the VIC-20 ManCave today.
The 32K of expansion memory to be used for the Operating System is wired and tested.
I have 4 banks of 8K mapped to Blocks 1,2,3, and 5 as RAM, with a ROM (lock) option.

One of my project rules is to only use the Expansion Port, and to not modify the VIC-20 in any way.
So, I placed the 4 buffers (74HCT245) required to allow the VIC (TTL) to talk to V2K (CMOS).
The buffers will also save the VIC from any accidental smoke testing done at the breadboard level.

Image
The VIC-20 Expansion Port Buffers.

Only the buffer to the Data Bus is bidirectional, the other 3 are tied in one direction.
Once the buffers were connected to the VIC port lines, the VIC-20 was connected to the board.

Image
Plugging the VIC-20 into the board for testing.

As expected, the VIC-20 booted and reported back in unexpanded mode.
This proves that the direction control on the buffers was correct.
If direction was reversed, the VIC would fail to boot due to endless bus collisions.

Gotta love that NTSC and its inevitable color bleed!

Image
The unexpanded VIC-20 standard boot screen.

I was now ready to lay down the 32K Expansion Memory based on the updated schematic.
For inspiration, I put up some words of wisdom from a childhood hero of mine.

Image
The Captain always seemed to know best!

What scares me about that photo in the ad is the way the kid is holding the cassette tape.
Don't put your fingers on the tape, dude! And get that glass of Fanta away from the computer!

Image

The 32K SRAM I am using is a 28 pin DIP with an access time of 15 nanoseconds.
Memory with speeds as low as 70ns have also been tested to work fine in this circuit.
The quad AND gate is used for the block decoding and enable circuit.

Image
Adding the 32K SRAM and quad AND gate.

Although this section of the schematic is incomplete, it does show the 32K SRAM circuit.
The buffers pass the address and data line to the SRAM, and the AND gate decodes the blocks.
The 74HC157 alows switching between the VIC and the other circuit that will boot load the 32K.
The Boot Loader is required so that the OS gets loaded on power up into Block 5.

Also shown on the right is the Source Code Memory (512K). This will be connected later.
The Source Code Memory contains the actual text code of the 6502 program to be compiled.
Although the compiled program can only be as large as 64K, the Source Text may be much larger.
Having 512K of source code means rich commenting and color formatting will be possible.
More on that later.

Image
The Operating System and Source Code Memory circuit.

I always make a mess when initially wiring up a circuit.
It's easier to test this way, and then plan how long each wire needs to be.
The 75HC157 Boot Switcher is wired to channel B so the VIC has the bus.

Image
Wiring up the 32K OS Memory circuit.

With the wiring complete, I hit the VIC-20 power switch.
Looks like my revised Operating System Memory circuit is good to go...

Image
Oh yeah, can you feel the power?!

In the final design, a timer will hold the VIC in reset as the 32K is filled with the User Console Program.
Once loaded, the VIC will be unreset. A secondary timer holds the SRAM in read only for 1 more second.
This RAM Lock system keeps the VIC from trashing the RAM as it powers up and does a RAM test.

The reason I just don't leave the 32K as ROM is because I am a big fan of self modifying code.
For me, self modifying code is a great optimizing tool that often saves many cycles, especially in loops.
Since the VIC-20 is going to be in charge of many new systems, code speed is going to be important.

Ok, the hour is getting late, and I still have to clean up my wiring mess or I will not be able to sleep.
I may have some more time in here tomorrow, and will try to get the Boot Loader working.

Radical Brad... beaming out!
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

The wiring on the board has been cleaned up, so my work for tonight is done.
Memory has been tested using my basic R/W program, and all is good.

What a difference a little wire cleaning can make...

Image
The Operating System Memory and Boot Loader Switch.

It's always nice to end the night with a completed milestone.
The next one will be Boot Loading of the user Console.
I estimate that to be about 4 hours of work.

Cheers,
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

It doesn't take long to make a complete mess of the wiring!
I found a way to eliminate the 74HC157 and replace it with 6 resistors and a diode.
Since the Boot Loader only runs once on startup, a little 100 ohm brute force is ok.

Image
Once again, the spaghetti monster returns.

I didn't get the Source Code Memory up and running this afternoon, but did make progress.
Boot Loading is now working well, so I tried a pile of various game ROM images.
... yeah, got sidetracked on Shamus and PacMan!

Here is the revised schematic, showing the OS Memory and Boot Loader...

Image
32K Operating System Memory and Boot Loader.

I also realized that my User Console was actually designed for my other project "VGER-20".
It does run here, but the IO mapping is all wrong. VGER used only IO2 to command the GPU.
In this hardware, I use both IO2 and IO3 for different functions.
I will chip away at redoing the code over the week so I can do more testing next weekend.

User Console served up to the 32K OS memory by the Boot Loader...

Image
The User Console from a previous project running on this hardware.

The block of characters near the bottom of the screen is a dump of my 88 character Command Buffer.
The Command Buffer is my own keyboard buffer design that is read when the user presses Enter.

The other 2 random characters are the response codes to a typed command.
it's all just a bunch of debugging stuff I have running for now.

Once I fix the IO mapping, I will be able to read and write to the 512K Source Code Memory.
I also have a decent amount of work done on my proposed File System.

One small piece at a time, this project is coming along.
Too bad the grind of daily life has to get in the way!
I would rather create VIC-20 hardware for a living.

Cheers,
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Holy sheet!
I need a larger workspace in Altium. Using the OrCAD-E sheet size (largest template), I am already running short on space, and this is only the Video Buffer section of the board, which accounts for maybe 25% of what will be the entire design.

Image

The Sprite Generator and Sound System will probably use up at most of the ICs on the board, which I would estimate at a total of 300 or so.

Hope to get more hardware done this weekend. Next to place will be the Source Code Memory and IO.
At that point, I will be able to display 6502 Assembly Source Code in my Use Console window.

Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Creating schematics is mostly a new adventure for me, but I must say that Altium is a dream to work with compared to the other tools I have used. Since my workplace is in a college, I have access to many cool machines and software, which is why I decided to give Altium a try. When I was working with (against?) Eagle CAD, it took me much longer to make a schematic than to actually wire, test, and debug, which is why I have never really bothered to make schematics for most things. I should have access to Altium for the remainder of the year, so I will keep on creating schematics, as they do help when I need to come back and make changes to the board.

Here is what I hope will be the final revision of the Sync Generator and Video Data Switch section.
This is the section of the board I waiting in my next free afternoon queue.

Image
VIC-2000 Sync Generator and Video Data Switch schematic. Right click for giant view.

There are a lot of connections in this section of the schematic, but its operation remains very simple.
Some 74HC590 counters drive a 640x480 video frame through a large switch out to the VGA DACs.
VGA Sync Signals are driven out through a dedicated memory called the Sync memory.

The VIC-20 has the task of first programming the Sync Memory to the desired VGA standard.
Once programmed, VIC switches the 590 counters on, and the VGA monitor begins to display.
The VIC / GPU can now access one of the Video Buffers while the other is being displayed.
Vic can "Flip" the buffers with one another, and will do so during the video blanking interval.

I decided to segment my schematic and run out named signals. Here is what they all do...

VID.DAT.A and VID.DAT.B are 12 bit input data busses from either Video Buffer.

VID.ADR.LO and VID.ADR.HI is a 19 bit output address that drives the Video Buffer Memory.
Both VIC.DAT and VID.ADR are switched again at the VIdeo Buffer stage.

VID.FLIP.A and VID.FLIP.B are complimentary signals that control the system wide Flip state.
These signals originate here, using the complimentary outputs from a 74HC74 Dual FlipFlop.

CLK.12.5 is a 12.5 MHz clock derived from the master 25MHz Pixel Clock.
I am not sure if I will need this clock yet, but it was "free" since I had on FlipFlop unused.

All signals starting with IO. are memory mapped to IO2, and controlled by the VIC-20.

IO.PAGE.FLIP is driven by the VIC-20 when a Buffer Flip is required.

IO.SYNC.RUN and IO.SYNC.PRG control the state of the Sync Generator.
In Run Mode, the 590 counters are in control. in Program Mode, the VIC can write to Sync memory.

IO.SYNC.ADR.LO and IO.SYNC.ADR.LO and IO.SYNC.DAT allow the VIC to address Sync Memory.
Sync memory is only programmed on startup, or when changing video modes, so speed is not important.
Because speed is no concern, it was no problem to latch address and data into 3 bytes.
The VIC can still write the entire Sync memory in a few milliseconds.

VIC.DAT is a direct connection to the VIC-20 Data Bus at the 74HCT245 buffer output.
This system wide databus will be accessible to any subsystem that the VIC needs to read or write to.

There are also some "internal signals" named, which are only used in the Sync Generator...

H.SYNC and V.SYNC and A.LINE control the monitor output signals directly.

X.RST and Y.RST and Y.CLK and X.RST Control the timers pushing the Sync Memory.

The strange looking overlapped Address and Bus connections are made for a reason.
In the Sync Generator, the address is split as 6X Bits, and 10Y Bits.
In the Video Frame Generator, the address is split as 10X and 9Y Bits.
Programming of the Sync Generator splits the address into 8 Bits for the VIC-20.

This schematic is untested, so I may need to make some changes if it doesn't work as planned.
The big question will be the increased clock speed from 20MHz to 25MHz.
It seems like a small change, but I know this is getting into "breadboard unfriendly" land.

I could probably push it with 74AC logic, but my original rules do no allow hard to find parts.
74AC logic also digs another rabbit hole I would prefer not to fall down.

Next report will be the above schematic turned into real hardware.

Later.
Radical Brad
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Kakemoms »

Wow.. do you ever sleep? :mrgreen:

I really like the IC grinding to get them closer on the breakout board. Never thought about doing that! :wink:
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

I had a few hours of restful sleep a few weeks ago!

Actually, I don't own a TV, don't read news, and don't enjoy non-technical socialization, so I seem to gain at least an hour per day of extra time that many don't have. Ever since I "unplugged", I seem to enjoy life so much more. I do wish I had more time to really put the pedal to the metal on this project though. So far it has been done in small 30 minute bursts and the odd Sunday afternoon.

I might think the same regarding your projects, especially your SuperCPU which is just amazing. It's kind of fun to see both of our projects coming along, as they actually have similar goals to enhance the VIC to insane levels of performance. Your enhancement goes inside the VIC, and mine connects outside.

You have me interested in Lattice again as well. I have always been a Xilinx fanboy, but that Mach does look nice. i will have to really take a deep look at it and compare it against my current favorite, the Spartan-6. But that's for another day... I need to book an hour of sleep in sometime this week!

Cheers,
Brad
Kakemoms wrote:Wow.. do you ever sleep? :mrgreen:
I really like the IC grinding to get them closer on the breakout board. Never thought about doing that! :wink:
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Here is my work for the weekend (if time permits)...

Image
Sync Generator and Video Data Switcher Complete.
http://lucidscience.com/temp/v2k/V2K.SCH.FEB.02.jpg

I cleaned up a few mistakes in the two subsystems and placed them side by side.
Color coding of signals was also done since things are starting to look a bit more complex.

This is the schematic I will be following when I place these components on the board.
I know this system will work, but it has never been tested at 25 MHz.
In a previous project (Vulcan-74), I had a similar circuit running fine at 20MHz.

I always get a chuckle when I read posts that state "you can't run a breadboard over 1MHz".
Can't remember the last time I breadboarded anything under 20MHz!
My record is a 100MHz dead-bugged FPGA with 50 IO lines broken out to a breadboard.

Hope my luck keeps holding up!

Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Since this project is no longer in "beta test" mode, I am forcing myself to cleanup the wiring on each completed segment before moving on to the next. The Operating System Loader and Expansion Port Buffer section is now complete...

Image
This section loads the OS, and offers 2 other Boot modes.

I added 3 push button switches that allow the VIC to reboot in one of three modes...

1) Unexpanded Stock VIC-20 Mode (Blue LED)
2) 32K Expanded Basic VIC-20 Mode (Green LED)
3) VIC-2000 Power System Mode (Red LED)

This way, I can still use the VIC to load, save, and code programs in stock or expanded mode.
My final hardware design will also have a quick connect Expansion Port saver.

Here is a closeup photo of this small competed section of the board...

Image
The first completed section of the VIC-2000 breadboard.

The large IC is an Atmega-324 pretending to be an 8K ROM.
All the AVR can do is send data to the bus when VIC asks for it (like any 8K ROM).
I decided to make this "fake ROM" so I could flash it easily with tools I already own.

On a side note, it is fast enough to replace the Kernal and Basic ROM directly inside the VIC!

The 3 push buttons simply alter the state of the SRAM WE line on power up.
If WE is free to the VIC, then the VIC boots in 32K expanded mode.
if WE is locked, then VIC boot up in plan old unexpanded mode.
If WE is held for 1 second after VIC reset, then my V2K OS boots from Block-5.

So far everything is working perfectly...

https://youtu.be/HRGwUktun28

I will now be working on the VGA Sync Generator, which will need some testing before final wiring.
If all goes well, my VIC-20 will be drawing up a 640x480 VGA screen with 4096 colors very soon!

Keep on kickin' it old-school!
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Working from the top of the board down now on the VGA Section, I have placed the 13 new ICs that will allow the VIC to program the Sync memory and get the VGA monitor to lock onto a 640x480 VGA frame. I am following the VGA spec right to the last nanosecond, so as long as timing holds between the counters and the output, everything should work perfectly.

Those odd looking multiple address bus taps shown in the larger schematic posted earlier allow the Sync memory and Video Memory to run at different speeds (bit sizes), yet share the same set of counters (74HC163). This makes sense if you consider the timing I am using...

Code: Select all

//////////////////////////////////
////////// 640 X 480 PIXEL TIMING
//////////////////////////////////

// [25 MHZ BASE MHZ PIXEL TIMING]
// HBP : 048 FROM 000 TO 047
// HPX : 640 FROM 048 TO 687
// HFP : 016 FROM 688 TO 703
// HSP : 096 FROM 704 TO 799 (-)
// TOT : 800(1024) : X10

// [480 LINE TIMING]
// VBP : 031 FROM 000 TO 030
// VPX : 480 FROM 031 TO 510
// VFP : 011 FROM 511 TO 521
// VSP : 002 FROM 522 TO 523 (-)
// TOT : 524-2-11 = 511(512) : Y9


//////////////////////////////////
////////// 640 X 480 SYNC TIMING
//////////////////////////////////

// [25/16 = 1.5625 MHZ SYNC TIMING]
// USE BITS 4-9 TO DIVIDE BY 16
// HBP : 003 FROM 000 TO 002
// HPX : 040 FROM 003 TO 042
// HFP : 001 FROM 043 TO 043
// HSP : 006 FROM 044 TO 050 (-)
// TOT : 050(64) : X6

// [480 LINE TIMING]
// VBP : 031 FROM 000 TO 030
// VPX : 480 FROM 031 TO 510
// VFP : 011 FROM 511 TO 521
// VSP : 002 FROM 522 TO 523 (-)
// TOT : 524(1024) : Y10
You can see that an entire VGA frame (not just active pixels) requires 800 horizontal clocks multiplied by 524 lines, which would equal a total RAM size of 419,200 to store the entire frame. This might seem like no problem since I am using a 512K SRAM, but things break down when you consider how the the Horizontal (X) and vertical (Y) counters must divide evenly into bits.

Dividing X and Y into bits requires 10 bits for X (800 = 1024), and 10 bits for Y (524 = 1024). That makes 20 total bits, which would require more than 512K. To get around this, I divide the Sync Memory Horizontal by 16, since the VGA spec divides perfectly by 16. This now means that the VIC-20 only has to fill 26,200 bytes to make a frame (50 x 524).

The actual Video Memory cannot divide since my goal is a full 640 x 480 signal, but if you look at the spec, I only need to draw 524 lines, so even though the X and Y bit division is 10 Bits by 10 Bits, the blanking interval begins at line 511, so the total SRAM required for a frame is only 408,000 bytes (800 x 510), and that does fit into a single 512K SRAM. To get 16 bits of data memory, I actually parallel up two 512K SRAMs per buffer, but the addressing is still only 10 bits by 9 bits.

A nice solution!

Here are the latest additions to the board...

Image
ICs to make the the 640x480 VGA Sync Generator.

Getting this tested is going to require a lot of wiring, and some robust 6502 assembly code running on the VIC.
Perhaps next weekend will allow some hacking time.

Later!
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

What can be done in 30 minutes of free time?.... not much!

I did manage to wire up the Sync Memory Counters to the Master Clock.
What's the Frequency, Kenneth?

Image
74HC590 counters in cascaded pairs.

The counters are setup as an X Counter and a Y Counter.
It takes 2 cascaded counters to make more than 8 bits.

Here is a shot of the Master Clock along with Bit 00 of the first counter...

Image
Master Clock and Bit 00 Frequencies.

As expected, the 25 MHz Master Clock gets divided by two.
Don't mind the ugly waveforms, I didn't bother to tune the probes!

Here is what I get at Bits 12 and 15 on the second counter...

Image
25 MHZ Divided by 8192 and 65536

Frequencies looking good, with the expected divisions of 8192 and 65536.
That's all for now. I have to go fix my broken website again.
Oh fun.

Radical Brad
Post Reply