Jump to content
IGNORED

Homemade atari super vcs {ntsc} 6502 questions


universal2600

Recommended Posts

Did you ever get your answer to TIA registers and drawing to the screen?

As far as I know, once you set a register value, be it playfield, player, background, or sound, it will continue down the whole screen unless you change values.

 

 

I liked when Ben Heck made a VCS with the 3 main chips and a million bus wires.

Didn't like that he skipped showing things like timing crystal, caps and resistors that are needed.

This is like that build, with newer (but still similar) tech!

  • Like 1
Link to comment
Share on other sites

Did you ever get your answer to TIA registers and drawing to the screen?As far as I know, once you set a register value, be it playfield, player, background, or sound, it will continue down the whole screen unless you change values.I liked when Ben Heck made a VCS with the 3 main chips and a million bus wires.Didn't like that he skipped showing things like timing crystal, caps and resistors that are needed.This is like that build, with newer (but still similar) tech!

Lol yeah that clears it up, well I don't consider myself a benheck but thanks, but I very well understand the lack of information, at least well documented sometimes, it can throw one's cheese off their cracker at times

Link to comment
Share on other sites

Update: well my ic sockets came in, and I've started to wire this up... I've got the 6502 and Tia data and address bus soldered

 

post-30967-0-70306400-1523307778_thumb.jpg

 

Still waiting on the hcu04, but how stable is the 3.57 MHZ clock, because I can simply use a non working (needs new chipset) 800xl board and can tap the clock from that, as long as a 6 - 12 inch jumper doesn't affect the clock signal.... whilst the other parts are on the snail mail "express"

Link to comment
Share on other sites

I've gotten the address and data bus completely wired, I will later use a7,a9,and a12-15 with a few 74hc138 so I can use up to 64k [im still waiting for my 32k sram] of ram and just treat the riot's ram as a sort of video cache and use ram for your program/kernel space,

 

post-30967-0-72139700-1523381370_thumb.jpg

 

Bottom side(riot bus):

post-30967-0-22279400-1523381424_thumb.jpg

Edited by universal2600
Link to comment
Share on other sites

Is this is to be backwards compatible with 2600?

 

If yes, A12 is used in Sara in-cart RAM and used in bankswirching.

 

The Flashback 2, Atari-on-a-chip, has A12 working correctly internally, but the "brought out" solder points to attach a real cartridge port have an A12 that doesn't change, so carts with Sara RAM and bankswitching using A12 do not run.

  • Like 1
Link to comment
Share on other sites

(i.e instead of cpu calculating the display every scan-line you simply write a few scan-lines of image data into the buffer before The TIA begins to draw, then just correctly address in the order of whats stored in the buffer and do program logic)

Since the [cy7c408a] is dual ported with asynchronous R/W, means you can just clock the output data [DO0-DO7] bus with the 1.19MHz clock from the TIA, iirc the TIA doesn't tend to like bus speeds higher than 1.19MHz?

 

The TIA actually runs @ 3.57MHz. It divides the clock by 3 for the CPU and RIOT.

 

Then this should allow one to overclock the 6502 with for simplicity of counting cycles a multiple of the [ntsc] color-burst [TIA] clock ( i.e being able to have 684 cpu cycles per scan-line {using a 6502 clocked @ 10.75MHz = ~3x the TIA clock } instead of just 76 cycles) in such cases also sacrificing [native 2600] compatibility for increased cpu speed and more time for crunching instructions.

 

The CPU controls the bus (at least in the VCS single bus design) so increasing its speed, will also increase the bus demands. This affects anyone who wants to talk to the CPU without a proper waiting mechanism.

 

At 10MHz you have a period of 100ns, so your peripherals (TIA, RIOT, controllers, RAM, ROM, etc) will have to be able to respond in between 50ns and 100ns (depending on what they are trying to do: reading or writing to the data bus). The maximum you can get out of a PIC18F4550 for instance is 12MIPs which translates to about 8.3ns period for a single instruction. With USB turned on, the ISR will bring the average available instruction cycle up considerably. It will be very difficult to decode the address bus, fetch the data and put it in the output.

 

I have a few questions, since iirc that the TIA registers are latched, if I simply set the playfied color, it will "paint" the frame with that color until it's changed? Or is it latched only for one scanline.

 

And can I just use wsync to strobe nmi instead of rdy, that way the CPU automatically knows the TIA is at the start of frame (or line) and just executes a drawing routine (display kernel),then once the display is drawn, it automatically goes back to the stack and simply resumes what it was executing.

 

Would using a cy7c408 as a makeshift buffer have any benefit on what can be done or would it be more of a bottleneck, since it's first in first out, once you write to it, you have to wait until the tia receives the data before you can rewrite more?, since data is clocked independently into and out the buffer, inputs are clocked by the CPU, which doesn't have to be 1.19MHZ since that's simply used to clock the output (so I don't have to go and recalculate timings due to higher CPU clocks). I have 2 spare tia one being used for this, the other in an Arduino (I might just use a pic and avr combo so I can have USB) "computer" ( I have a post with pcb layouts but I didn't get any response but still in the works) mainly for experimenting with the tia capabilities graphically and sound-wise (push the chip in different ways to see what happens...)

 

There are (at least) two problems with the CY7C408: 1) as a FIFO, you still have to rebuild the entire frame every time (i.e. the data must be popped out for the TIA); 2) 128bytes will not get you very far...

 

Cypress does have true dual port memories (with arbitration and all that good stuff), but they are expensive (for their size) and hard to come by.

 

A better option is probably a dual port VRAM, but you will still have to have some sort of controller between the TIA and the memory. Also, VRAM is usually dynamic, which means you will have to deal with refresh.

 

If you use a micro controller to babysit the TIA, you can probably use the internal memory anyway and implement what the VCS really lacks, which is a framebuffer.

 

Well an update, I got most of the parts, still waiting on 74hcu04, load caps, and the ic sockets, but I am going to use the pic18f4550 as a in system programmer/debugger, that way I can just write up to 256k of rom data....over usb , and a co processor with a pic32mx270 which is going to be clocked at the same speed as the cpu (1.19 to start with), since its 32bit, I should have plenty of cpu power even at 1.19MHz, and it has its own 256k of storage and 64k of ram, I think it should be enough to emulate the riot and be used as a co processor (probably will need a faster clock but only experimentation will tell)

 

Here's a pic of the board so far

attachicon.gifIMG_20180323_1505086_rewind.jpg

 

If you are not planning on using the pic32 at its full power, why not use a dsPIC33EV and not have to deal with the voltage level difference? I'm not sure how much you really gain by going 32bits @ 1.19MHz as much as I am not sure how much you compromise by going 16bits instead :)

 

Also, if you plan on emulating the RIOT, keep in mind that the bus needs to be serviced by half of the CPU cycle, the latest, as that is when the CPU expects the data to be stable in the data lines. If you are running at the same pace as the CPU, that is probably impossible to achieve.

 

Update: well my ic sockets came in, and I've started to wire this up... I've got the 6502 and Tia data and address bus soldered

 

attachicon.gifIMG_20180409_165959.jpg

 

Still waiting on the hcu04, but how stable is the 3.57 MHZ clock, because I can simply use a non working (needs new chipset) 800xl board and can tap the clock from that, as long as a 6 - 12 inch jumper doesn't affect the clock signal.... whilst the other parts are on the snail mail "express"

 

Crystals are very sensitive to load and parasitic capacitance, so having a long connection between the two is bound to cause you headache.

  • Like 1
Link to comment
Share on other sites

If you use a micro controller to babysit the TIA, you can probably use the internal memory anyway and implement what the VCS really lacks, which is a framebuffer.

 

 

 

If you are not planning on using the pic32 at its full power, why not use a dsPIC33EV and not have to deal with the voltage level difference? I'm not sure how much you really gain by going 32bits @ 1.19MHz as much as I am not sure how much you compromise by going 16bits instead :)

 

 

This is what I was planning on using the pic32 for, as sort of an antic co-cpu, to give the 6502 more flexibility, and since the pic can compute 32 bit numbers, then you could multiplex certain data values (8-bits is all the Tia wants) for example: you can treat and manipulate the 32bit word as 4 8-bit bytes, which you can manipulate with one instruction, so you could load up to 4 bytes, and manipulate them at the same time with one instruction, and split them back out,I guess like a sort of pseudo-pipeline, I'm probably going to clock the pic32 @ the Tia clock aswell or just screw it and use 40MHz like the 4550.... And the pic32mx270256 has on chip features for generating graphics and displays
  • Like 1
Link to comment
Share on other sites

Is this is to be backwards compatible with 2600?

 

If yes, A12 is used in Sara in-cart RAM and used in bankswirching.

 

The Flashback 2, Atari-on-a-chip, has A12 working correctly internally, but the "brought out" solder points to attach a real cartridge port have an A12 that doesn't change, so carts with Sara RAM and bankswitching using A12 do not run.

Yes I know, a7 is used to swap between Tia(low) and riot(high), with a9(low) used to select ram when riot is enabled, if a12 is high then you're reading rom, in this case i can use two 74hc138's and connect them so that the truth table still allows for compatibility, but now you have 16 outputs, 13 available for use, add some latches and and I can then bankswitch between the cartridge, rom, and ram, and Tia and riot, this is more of what the 2600 would be if it were spec closer to a computer (around the era)

Edited by universal2600
  • Like 1
Link to comment
Share on other sites

This is what I was planning on using the pic32 for, as sort of an antic co-cpu, to give the 6502 more flexibility, and since the pic can compute 32 bit numbers, then you could multiplex certain data values (8-bits is all the Tia wants) for example: you can treat and manipulate the 32bit word as 4 8-bit bytes, which you can manipulate with one instruction, so you could load up to 4 bytes, and manipulate them at the same time with one instruction, and split them back out,I guess like a sort of pseudo-pipeline, I'm probably going to clock the pic32 @ the Tia clock aswell or just screw it and use 40MHz like the 4550.... And the pic32mx270256 has on chip features for generating graphics and displays

 

OK, I see what you mean. It's a bit like running on a tight budget though. You have just about enough money to make ends meet, but once you get to it, there are always extra costs that throw things out of wrack. In this case, the extra cost starts with getting the signals from the bus (both address and data) into the registers. That costs a lot of cycles and you already fell behind even before you started with the actual work.

 

The PIC32 can really fly in comparison to the 6502, so you are probably better off letting the interrupts in the PIC carry about synchronization.

 

The next problem will be the noise that the PIC will introduce to the system by running fast. Using the internal clock will help, but not solve it entirely.

 

My suggestion is, get yourself a nice logical analyzer if you don't already own one. It will be your best friend when things that "should" work, don't. There are some decent 16 port ones on eBay for about $40 bucks.

  • Like 1
Link to comment
Share on other sites

OK, I see what you mean. It's a bit like running on a tight budget though. You have just about enough money to make ends meet, but once you get to it, there are always extra costs that throw things out of wrack. In this case, the extra cost starts with getting the signals from the bus (both address and data) into the registers. That costs a lot of cycles and you already fell behind even before you started with the actual work.

 

The PIC32 can really fly in comparison to the 6502, so you are probably better off letting the interrupts in the PIC carry about synchronization.

 

The next problem will be the noise that the PIC will introduce to the system by running fast. Using the internal clock will help, but not solve it entirely.

 

My suggestion is, get yourself a nice logical analyzer if you don't already own one. It will be your best friend when things that "should" work, don't. There are some decent 16 port ones on eBay for about $40 bucks.

I understand, so essentially I'd want the pic32 to act as a sort of dma video controller, what about using a IDT7130LA 1k dual port sram (2 chips for $10 shipped is affordable for me), in the same fashion as the fifo, but store data for the frame in this sram, and use the pic32 to address the output, program the pic32 to interpret something similar to the display list of the 8bit Atari?

 

And if the pic controls the bus, then you'd need a way to transfer bus control between the 6502 and pic32 in software(well there's probably a hardware solution too)so that you can still maintain 2600 compatibility, I could just use rdy and an interrupt and then use the pic to strobe the 6502 rdy, so the pic can use the bus, or what about bus stuffing? How much memory would it take to store the full frame in ram, on average, so that you can draw the frame once and change only things that need to be updated instead of having to compute the whole frame every time the something has to be changed

IDT7130LA.pdf

Link to comment
Share on other sites

I'm actually using the IDT7130LA and a pic for another atari 2600 related project, work in progress.
The thing about the IDT7130LA to remember is that you cannot write to an address while that specific address is being read.

(The write will be rejected, and a 'busy' pin asserted).
If you can organize your access to that chip with that in mind, it works well.


Edited by rbairos
  • Like 1
Link to comment
Share on other sites

OK, I see what you mean. It's a bit like running on a tight budget though. You have just about enough money to make ends meet, but once you get to it, there are always extra costs that throw things out of wrack. In this case, the extra cost starts with getting the signals from the bus (both address and data) into the registers. That costs a lot of cycles and you already fell behind even before you started with the actual work.

 

The PIC32 can really fly in comparison to the 6502, so you are probably better off letting the interrupts in the PIC carry about synchronization.

 

The next problem will be the noise that the PIC will introduce to the system by running fast. Using the internal clock will help, but not solve it entirely.

 

My suggestion is, get yourself a nice logical analyzer if you don't already own one. It will be your best friend when things that "should" work, don't. There are some decent 16 port ones on eBay for about $40 bucks.

I'm actually using the IDT7130LA and a pic for another atari 2600 related project, work in progress.

The thing about the IDT7130LA to remember is that you cannot write to an address while that specific address is being read.

(The write will be rejected, and a 'busy' pin asserted).

If you can organize your access to that chip with that in mind, it works well.

 

Thanks for the tip, and I did some reading and since I will have 32k of ram to start with, and for "most" situations, using 7 bits/per pixel, which for a full frame buffer takes up ~32k for 160 pixel line with 40 (how much ram for a 64 color?) color (iirc) palette, what about using a line buffer, instead of using 32k use 16k + 1k reserved for the video buffer, and the other 16k for program/data space and the 128 bytes in the riot as a sort of CPU cache? Then once the frame has been built, feed it into the dual port ram line by line, using the pic32 to address the bus (I could simply use two shift registers to address the Tia and ram from the pic32, I know it's possible, since there are synthesizer projects using the Tia doing this, but none iirc generate video), the dual port ram and pic32 would act more as a hardware buffer or display kernel, line and address data that's ready to be or has been written sits here, that can be reused or rewritten by simply using the pic32 to generate the display and the 6502 for sound, logic, and other housekeeping. Note that when using normal 2600 cartridges will not take advantage of the upgrades and would run stock, only when you have software that implements the upgrades would use it... Edited by universal2600
Link to comment
Share on other sites

Quick question will this circuit work using a 3.57 quartz?

Since I found some 3904's laying around...attachicon.gifpulse-generator-oscillator-32768khz-by-watch-crystal-transistor.jpg

Sorry for posting so much, somewhat ot but I've built another pcb, using two hc595 another spare tia and and arduino, to make a simple tia interface where I can write data to the chip, since I don't care about reading fire buttons or paddles, to experiment with the chip see what can be pushed out of it...., I used the circuit above for the quartz circuit, I have to wait until my new desktop motherboard gets in so I can use the arduino as a frequency counter to make sure the output is stable or even oscillating.... As I'm still waiting on the 32k sram and the hcu04 to arrive....and narrow dip sockets for the pic32

 

PS: the soldering is a lot cleaner than the camera shows.....left over flux, and I can't find my can of pcb cleaner

 

post-30967-0-47636800-1524180968_thumb.jpg

post-30967-0-20385500-1524181209_thumb.jpg

Link to comment
Share on other sites

Sorry for posting so much, somewhat ot but I've built another pcb, using two hc595 another spare tia and and arduino, to make a simple tia interface where I can write data to the chip, since I don't care about reading fire buttons or paddles, to experiment with the chip see what can be pushed out of it...., I used the circuit above for the quartz circuit, I have to wait until my new desktop motherboard gets in so I can use the arduino as a frequency counter to make sure the output is stable or even oscillating.... As I'm still waiting on the 32k sram and the hcu04 to arrive....and narrow dip sockets for the pic32

 

PS: the soldering is a lot cleaner than the camera shows.....left over flux, and I can't find my can of pcb cleaner

 

attachicon.gifIMG_20180419_192638.jpg

attachicon.gifIMG_20180419_192802.jpg

 

The Arduino will not be able to give you too many assurances that the oscillator is stable. If you don't have an oscilloscope, you should get at least one of these:

 

 

https://www.ebay.com/itm/New-USB-Logic-100MHz-16Ch-Logic-Analyzer-for-ARM-FPGA/222889798606?epid=694885287&hash=item33e5446bce:g:NnQAAOSwiYRar46w

 

I'm sure will be able to find one delivered from the US. There are smaller/cheaper models, just make sure it has trigger detection.

  • Like 1
Link to comment
Share on other sites

I'm not too worried about the flux (but I'm not sure what kind it is), but many of the solder connections don't look good to me. If I'm wrong, and they are okay, then life's good!

They are actually very bright, shiny and tinned with no shorts irl, the white balance on my camera makes the joints look dull and washed out, wire is 30awg so actual connections may be hard to see looking at it, and I use rosin flux, the stuff when on your hands takes 10 years to clean off....

Link to comment
Share on other sites

The Arduino will not be able to give you too many assurances that the oscillator is stable. If you don't have an oscilloscope, you should get at least one of these:

 

 

https://www.ebay.com/itm/New-USB-Logic-100MHz-16Ch-Logic-Analyzer-for-ARM-FPGA/222889798606?epid=694885287&hash=item33e5446bce:g:NnQAAOSwiYRar46w

 

I'm sure will be able to find one delivered from the US. There are smaller/cheaper models, just make sure it has trigger detection.

I can live with .02% or less error (@ 5mhz input) using an arduino, as long as the clock is below 3.58Mhz and above 3.56 MHz the tia should accept the clock, as far as how clean the output signal is...for that an oscilloscope is a must Edited by universal2600
Link to comment
Share on other sites

  • 2 weeks later...

Got the core system wired, with cartridge, just needs to have rest of the flux cleaned and pretty much all I need to wire is sound and the video cicuitry, I used an 74ls00(found in the place you didn't know you had it stored) to generate the clock, once I have the video output wired, it'll be the power test...., I may use the spare socket as an expansion header, for the pic32, 256k flash, and ram, with address decoding done on the expansion board (to bankswitch between ram, cartridge, tia and riot, without the board it is effectively a stock VCS )

 

post-30967-0-17491400-1525460885_thumb.jpg

 

post-30967-0-27247600-1525461499_thumb.jpg

 

post-30967-0-95340600-1525461547_thumb.jpg

 

 

post-30967-0-23956800-1525461903_thumb.jpg

 

And it fits in the original casing...BTW its unfinished ik that I'll have the move the cart port, I may just use the cartridge as an expansion port, simply have software on cart bank into the 256k, which can hold everything from an OS to kernels/subroutines for drawing, sound, 256k (rom space) on a 2600 AFAIK is an insane amount of memory.... from there you will be able to access everything

Link to comment
Share on other sites

well dropping the 32bit pic atm due to it not having a full 8bit port available or enough io.....instead i'll try using two atmega8515 clocked 6 times the tia speed (21.47727mhz) one to be used as a display processor, the other as a memory bank controller, use the 6502 to write specific values on the bus with a13-14 telling the atmega what to access, ram, flash, or core system, a15 would be used to enable the atmega display processor which sits idle until called for, which the 6502 will communicate through dual port ram, as with the chip having its own 32k ram for leg room.

Link to comment
Share on other sites

  • 2 weeks later...

update, so I also went ahead and made some pcb designs (unfinished but at least over 75% done), this board was made to fit inside a junior 2600 case , while it can fit in an original sixer, i'd need to make daughter boards for the cartridge and switches.

 

post-30967-0-83917600-1526954051_thumb.jpg

 

 

post-30967-0-11231900-1526954074_thumb.jpg

 

 

post-30967-0-28190400-1526954098_thumb.jpg

 

 

post-30967-0-18042900-1526954199_thumb.jpg

 

 

post-30967-0-45747100-1526954208_thumb.jpg

 

p.s i know there are a few connections wrong as express pcb will auto merge traces and vias, even when you move the components around.......ugh

Edited by universal2600
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...