a hombrew computer using 328p and TIA chip (atari 2600 graphics/sound chip)? - Page 1
Forum section: electronics / projects

author: cheechinchongin420
author_rank: Newbie
timestamp: January 18, 2018, 08:58:44 pm
content: I am new but since my thread on atari age isnt really helping further my process, so I have a few questions:This is just a project of mine using an arduino nano as simple "computer" using the TIA from the atari VCS as its video and sound output. So since the tia data bus expect data at the cpu (6507) clock (at least when configured on the 2600 hardware) @ 1.19 MHz, and for the record my tia chip is "Now That's Some Color" compatible(NTSC), so the TIA clock is simply the ntsc color burst frequency (Clocked @ 3.579545Mhz), so for one 6502/7 cycle is 3 (color) clocks TIA, the cpu and tia are locked to a 1:3 "sync" to function in a 2600, you have a total of 228 ticks per frame of output on an ntsc TIA, iirc 76 cpu cycles for one frame (6502/7). Also you can gain more cpu cycles by reducing your effective frame size ("resolution").So to then a way that I figured to use your standard nano 328p "arduino" @ 16Mhz or 20Mhz, using a CY7C408A (128byte dual port buffer memory ) (https://scientific-solutions.com/surplus/parts/941528/cy7c408a.pdf), Could you feed the cpu clock which is generated by the tia for the 6502 (3.579545/3) to clock the output bus on the fifo buffer? So that the tia always sees data there as it would with a 6507 on the data bus.The inputs of the fifo are connected to a 'hc595 which the 328p controls by simply shifting data to the register, Can you use the serial overflow pin to clock the input by toggling its value high and low ?The tia addressing is done by the second '595, so then once you've written 128 ( well 64 bytes since its dual ported?) you just to shift the corresponding bytes to toggle the addresses for the tia in the order of data that you've sent (you would store what addresses for the tia each line{s} in ram in order of the data in the fifo, and also the tia address space is 64 bytes (6-bits) wide)? Since the tia runs slower and reads the fifo even slower; While your 328p runs @ 16 or 20mhz, would give plenty of time to do your computing and update the tia registers and "not" have to be cycle accurate since you know the TIA would always cycles the data from the buffer memory at 1.19 Mhz (you cannot overclock the tia since the clock is used also for the composite ntsc output)? Could you also just use HALT on the tia as an interrupt to sync the 328p since that tells (the 6502/7) that the TIA is at the beginning of the frame and is starting over? The same goes for the fifo AFE and HF bits to signal how much data is loaded in the fifo (you do have to make sure the fifo has the data properly written and doesn't run out)?So in a way you would be able you use properties of the chip in a way you can't on a 2600 due to its configuration being very limited (imho cheap). you could simply have a simple monitor or low level kernel (well bootloader) that would handle basic things;quoted from :http://www.classic-games.com/atari2600/specs.html,The Stella (TIA) chip:This chip makes all the video displays and sounds for the 2600 VCS.It also has 6 registers which are used as A/D converters and for the triggerbuttons on the joysticks. The chip also controls the RDY line of the CPUto initiate horizontal syncronization control. The chip is NOT a DMA chip.The CPU must write each line of data into the chip registers AS it drawsthe screen. This accounts for the low CPU availability. The Chip is addresedthrough 44 write only registers, and 13 read only registers mapped tothe low end of page 0. For those familiar with the Atari 800, this chipis about 1/2 of a TIA/Pokey in all respects. But, there is no ANTIC chip todrive it; the CPU must do all the work that the ANTIC does in the 800.So in order to produce a video display, a program must do the following (for a "stock" 2600):1. Start the vertical blanking interval2. Start the vertical sync interval immediatelythere is time for about 80 instructions after this (with my 328 @16Mhz, about 13.45 - 13.5 times faster than the 6507, ~4.5 faster than the TIA, so up to [scaled by clock only] ~500-1000 instructions? The 328 imho would probably use more cycles per instruction [vs. a 6502/7?] so that also has to be accounted for. )3. End vertical syncthe (game ) computations must be done now as there won't be time later. (Well Maybe?)4. End vertical blanking5. Set up each line of the video display as it is drawn (64 bytes worth of instructions [what to draw] would be stored in the buffer, You just have to sync your addressing to the TIA.)there is time for about 6 (scaled by soley clock Freq would be less than ~80) instructions to the video chip beforethe current line starts being displayed. Atari recommends changingthe display every other line to gain processing time.6. Loop back to step 1unquote.So could you store a list of tia registers to be updated in the 328's ram until you need to tell the tia what registers to change (the 328p would act more like the antic chip from the atari 8bit as you supply the "line" to be drawn to the fifo and store what registers to update in ram until you receive a RDY [TIA HALT] to signal the start of horizontal blank (when Halt is released the TIA is at line 1, "cycle" 1 and starts drawing for ~192 - 228 lines then you strobe wsync [halt) again. Registers on the tia are latched too.)You could simply store the data (your program) on sd card or serial eeprom , or somehow load over the nano's serial pins.Any pointers would be appreciated....TIA Tech breakdown (provides info down to the logic level in there) :http://www.atarihq.com/danb/tia.shtml2600 hardware break down:http://www.classic-games.com/atari2600/specs.htmlI've also attached the pcb layers of the pcb (Screenshots, I will have schematics but I'm busy with life duties so when I get enough free time.)PS: would the oscillator circuit work at that frequency of crystal? ( or the would the clock provided be stable?)

author: Unknown
author_rank: Unknown
timestamp: January 18, 2018, 09:33:03 pm
content: Quote from: cheechinchongin420 on January 18, 2018, 08:58:44 pmUse sentences & paragraphs.

author: amyk
author_rank: Super Contributor
timestamp: January 19, 2018, 03:10:19 am
content: Quote from: Tac Eht Xilef on January 18, 2018, 09:33:03 pmAlso question marks if you're actually asking a question. Otherwise it just looks like you dumped your brain in a post... so what do you want?

author: cheechinchongin420
author_rank: Newbie
timestamp: January 31, 2018, 12:43:58 am
content: Quote from: amyk on January 19, 2018, 03:10:19 am, it should be readable now....