Homebrew First-gen Console (AY-3-8500)

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

I decided to try making a video game system, and to do that I think a first generation video game system is perfect. Although it would be more fun to design my own Pong clone, I have decided to use a generic video-game-on-a-chip since they are widely available, cheap and simplifies most of the things, so I can focus more on learning the technical part.
I picked the General Instruments AY-3-8500 "Ball & Paddle" which has 4 pong variants, 2 light gun games and a number of settings. I used to have something like this as a kid, but it broke and was thrown away (I think my machine possibly used the AY-3-8610 "Superstar" but with the light gun games not connected).
The datasheet for the AY-3-8500 can be found in this GI catalog (page 4).

The Ball & Paddle seems to output composite video (luma I guess since it's black & white), but the datasheet only shows how to build an RF modulator, which I don't want to bother with, not how to output composite video safely to the TV. I found a schematic how to skip the RF modulator here. But with this guide, the video (which has separate channels for each sprite/background and one for sync) is just passed through an 1 kΩ variable resistor. Same goes for audio. Sync first goes through a 10 kΩ variable resistor then is merged into the video (before the 1 kΩ for video). But the example circuit in the datasheet, they use a bunch of extra components, a 4072 IC and some resistors for the video and sync. Also audio uses a 2N2222 transistor and some other components. But they are using an internal 8 Ω speaker (which I think is quite common on these Pong systems) while the guide outputs to an RCA connector meant for the TV. And for video they of course modulate to RF in the datasheet example.

My question is, could anyone help me figure out if it is safe to follow this guide, and how I fix it if it isn't? I don't really know what to look for in the datasheet, and it doesn't even seem to say what voltage the audio output from the chip is at (the chip runs on 6 V with circuit in the guide, but the datasheet doesn't seem to say). Even if it's safe, what if someone that doesn't know what he is doing (e.g. me) fiddles with those potentiometers? I don't want it to be possible to blow up any TVs or other A/V equipment.
I guess you can buffer the video output using a THS7314, THS7316 or THS7374 which are popular with RGB-mods and Superguns. That also seems to be what Raphnet is doing here, but I wonder if it is safe even if I don't do that?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Fri Jan 17, 2020 7:13 pm a generic video-game-on-a-chip since they are widely available, cheap
... they are?
[checks ebay] ... I guess they aren't too bad. I don't have enough nostalgia to personally value it at $20, but whatever.
The Ball & Paddle seems to output composite video (luma I guess since it's black & white)
Yes, but it specifically provides a bunch of individual digital outputs for each of the components of the signal. Since you're in Europe and presumably your TV has a SCART input, you could instead choose to map the 4 digital outputs ("Ball", "Right Player", "Left Player", "Score/Field") to some kind of RGBI output.

You'll just want something to reduce the output voltage from the buffer, and to provide impedance matching (for better image quality).

The simplest safe option would be:

Code: Select all

 BUFFERED SIGNAL ---+      +-------------+
                    R1     | -inside TV- |
                    +--- to TV ---+      |
                    R2     |      75Ω    |
               gnd--+--- to TV ---+      |
                           +-------------+
When there's just one digital signal, and it's 5V, and the TV input impedance is 75Ω, then R1 and R2 should be 268 and 104 ohms so that the voltage on the TV is at the valid max (0.7V) when the input is at its max (5V).

For audio, just refer to the previous conversation we had about converting PWM down to line level.

For sync, you instead want the peak output to be 0.3V instead of 0.7V. (R1=625, R2=85)

Because there are four video outputs, you'll have to combine at least two of them. All that matters is that when you connect multiple signals to one output channel, all of those resistors in parallel are the same 268Ω as above.

... Now, it's a little different specifically in the case of the AY-3-8500, because I think no two video outputs will be true at the same time ... maybe ... but it's still a fine place to start. At worst, thing's'll be too dark.
But with this guide, the video (which has separate channels for each sprite/background and one for sync) is just passed through an 1 kΩ variable resistor.
The datasheet for the AY-3-8500 does not give me much credence for the safety of this technique. Directly driving composite or component video requires being able to source ≈10mA (0.7Vp÷75Ω), and the datasheet implies no ability to source more than a couple hundred microamps.

What I'd do in this situation is enlist an external buffer, like a ... well, I'd probably misuse a 74'373 ... to make a copy of all the signals (the four video ones, plus sync, plus audio), and then mix them as appropriate for the TV.

But the 74'373 can't operate at higher than 5.5V, and it's not clear whether the AY-3-8500 will operate at 5V (or lower). You may have to use something that's tolerant of much higher voltages, such as the 4050.
I don't really know what to look for in the datasheet, and it doesn't even seem to say what voltage the audio output from the chip is at (the chip runs on 6 V with circuit in the guide, but the datasheet doesn't seem to say).
Page 6:
Outputs
Logic '0' [...] 1.0 Volt max when Iout=0.5mA
Logic '1' Vcc-2 Volt min [...] when Iout=0.1mA
I guess you can buffer the video output using a THS7314, THS7316 or THS7374 which are popular with RGB-mods and Superguns.
You definitely don't need anything so fancy. The output from the POAC is digital, so using a high-quality buffer is wasteful. (See the timing diagram on the lower half of page 7)

Unless you already have one on hand. Be careful to not draw too much current from the AY-3-8500.
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Fri Jan 17, 2020 8:34 pm
Pokun wrote: Fri Jan 17, 2020 7:13 pm a generic video-game-on-a-chip since they are widely available, cheap
... they are?
[checks ebay] ... I guess they aren't too bad. I don't have enough nostalgia to personally value it at $20, but whatever.
I think they are relatively cheap for my purpose. Probably cheaper (and faster) than building my own Pong machine from discrete components.
You could see the AY-3-8500 more like a game rather than an extremely limited audio/video processor (a game that requires a lot of work to hook it up to the TV!). The question is if it's cheaper to build one instead of getting a cheap Pong machine that's using the chip (and possibly mod it for AV and unlock games and settings not used). But part of my goal is the experience of building it to learn the ropes of building video game hardware.

it specifically provides a bunch of individual digital outputs for each of the components of the signal. Since you're in Europe and presumably your TV has a SCART input, you could instead choose to map the 4 digital outputs ("Ball", "Right Player", "Left Player", "Score/Field") to some kind of RGBI output.
Yes that seems to be the reason why the chip outputs each "sprite" on a different pin in the first place. So that they can be coloured independantely. There's even an example in the catalogue to have different shades on the paddles to make them easier to tell apart in the Squash game. I guess a simple way to colour them is to send the paddle video outputs through the B- and R-channels of RGB to make them blue and red for example, or send a sprite through both G and R to make it yellow etc. Who needs the colour processor chip (AY-3-8515).

You'll just want something to reduce the output voltage from the buffer, and to provide impedance matching (for better image quality).
Thank you! That's the kind of information I was looking for! Combining the info in this thread and the other one, it seems the formula to calculate the output voltage for audio, video and sync seems to be the same (since the same voltage divider circuit is used I guess). If I understand it correctly it should be like this:

Z / (R2 / ((R1+Z) / R2)) = Vpp / Vcc
Where Z is input inpedance of the output device, Vpp is the desirerd output voltage and Vcc is the voltage of the signal before the voltage divider.

In that case video output should be like this if 6 V is used for the machine:

Video (Vcc=6V, Vpp=0.7V, Z=75Ω)
75 / (R2 / ((R1+75) / R2)) = 0.7 / 6


Is this right? Seemingly not, because inserting your values for Vcc, R1 and R2 produces the wrong results. I got parallel resistor calculations covered, not as hard as this formula with two unknown variables.
I'm not sure what the internal speaker (8 Ω, 2 W) would need for an input voltage, but I guess I could just try the example circuit in the datasheet instead. It says that it should work for 6 or 7 V.
Most gaming systems using the chip seems to operate at 6 or 7 V (I've seen 7.5 as well), so I might as well go with 6 V.

The datasheet for the AY-3-8500 does not give me much credence for the safety of this technique. Directly driving composite or component video requires being able to source ≈10mA (0.7Vp÷75Ω), and the datasheet implies no ability to source more than a couple hundred microamps.

What I'd do in this situation is enlist an external buffer, like a ... well, I'd probably misuse a 74'373 ... to make a copy of all the signals (the four video ones, plus sync, plus audio), and then mix them as appropriate for the TV.

But the 74'373 can't operate at higher than 5.5V, and it's not clear whether the AY-3-8500 will operate at 5V (or lower). You may have to use something that's tolerant of much higher voltages, such as the 4050.
Ah that's what I suspected. This guide is no good then. A 4050-based buffer it is. Thanks!

Page 6:

Outputs
Logic '0' [...] 1.0 Volt max when Iout=0.5mA
Logic '1' Vcc-2 Volt min [...] when Iout=0.1mA
Does that mean that audio and video output are 1 V at logic 0 at maximum and Vcc-2 V at logic 1 at minimum? Is that why my formula didn't work?



BTW I saw that the Ball & Paddle chip, and several other such pong chips, have recently been decapped and documented. The Ball & Paddle has also been implemented in FPGA in MiSTER (makes my efforts to build one almost feel wasted :)). It seems they got hold of Nintendo's Color TV-Game 15 as well. I'm looking forward for it to be be decapped and getting an FPGA implementation as well.
The oldest part of video game history is finally getting being preserved!
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Sat Jan 18, 2020 6:57 pm I guess a simple way to colour them is to send the paddle video outputs through the B- and R-channels of RGB to make them blue and red for example, or send a sprite through both G and R to make it yellow etc. Who needs the colour processor chip (AY-3-8515).
<wishes we'd gotten some kind of component video in the US before 1995>
the formula to calculate the output voltage for audio, video and sync seems to be the same (since the same voltage divider circuit is used I guess). If I understand it correctly it should be like this:
Unfortunately, I used the obtuse symbol "//" to mean "is in parallel with", not "is divided by".

A//B = 1÷(1÷A+1÷B) = (A×B)÷(A+B)
not as hard as this formula with two unknown variables.
To be honest, I've just been setting up the equations and asking Maxima to solve it for me.

Pertinently: Given Vin=5V (or 6V, maybe), and Vout=0.7V, and R1//R2 = 75Ω (impedance matching), what are R1 and R2.
I'm not sure what the internal speaker (8 Ω, 2 W) would need for an input voltage, but I guess I could just try the example circuit in the datasheet instead. It says that it should work for 6 or 7 V.
Depends entirely on how loud you want it to be. As long as it's less than the speaker is rated for. 2W in an otherwise-quiet room is fairly loud.

Most speakers are electromagnets, and electromagnets generate magnetic force proportionate to the amount of current through them. More current=more deflection. More change in amount of deflection=louder. You don't really care about what the voltages involved are, other than as a tool to push current through it.

If you pick up a piezo beeper instead of a voice coil that changes things, although mostly conceptually.
Does that mean that audio and video output are 1 V at logic 0 at maximum
It means that, as long as the AY-3-8500 isn't trying to sink more than 500µA ("Iout = 0.5mA"), the output voltage will be not higher than 1.0V, and that as long as the AY-3-8500 isn't trying to source more than 100µA ("Iout = 0.1mA"), the output voltage will be not lower than Vcc-2V.
Ah that's what I suspected. This guide is no good then. A 4050-based buffer it is. Thanks!
.... Actually, I think I have to take that back; the plain 4050 isn't particularly good at sourcing current. (It's better than the AY-3-8500, but it's nowhere near the 10mA needed for baseband video.) Other parts (14050, 4503, 4041, 14503) seem like they can source enough more current.


I'd probably start off by seeing if the IC operated acceptably at 5V, and if it did I'd just use some 74xxx logic instead.

If the AY-3-8500 doesn't, I'd probably dispense with the impedance matching and go for a more minimal design like this:

Code: Select all

                      Vcc
                    |/
UNBUFFERED OUTPUT --|
                    |↘
                      +
                      R
                      |
                      +---- TV
                      |
                      D?
                      |
                     gnd---
"R" should just be chosen such that the voltage across the TV's inputs will be correct. ("correct" means "0.7V for maximum brightness")

TVs use more-or-less the same gamma as PCs, so if you come up with a color palette that you like (e.g. <160,0,0> → <63%,0,0> → <0.44V,0,0> → <5.9mA,0,0> → <484Ω?,0,0>)

(Assumptions: Vcc=6V; Ioh=0.1mA; Voh=4V=Vb; Vbe=0.7V;
Calculations: Ve=Vb-Vbe=3.3V; Ve÷Ie=3.3V÷5.9mA = 559Ω. 559Ω-75Ω=484Ω)

"D" is a safety factor. You could put a diode (or two) with a forward voltage comfortably above 0.7V there (e.g. two 1N914s, or an LED)... It's probably (edit: lost absolutely vital negation by means of braino) unnecessary, due to the low impedance of the 75Ω inputs on the TV...

Transistor is any NPN BJT with a gain (β or hFE) greater than 94 at Ic=10mA. 2N2222 isn't good enough. BC546 family is.

Finally, you could have signals drive multiple outputs, and multiple outputs drive one signal:

Code: Select all

         Vcc Vcc            Vcc
       |/      \|          |/
OUT1 --|        |-- OUT2 --|
       |↘      ↙|          |↘
         +    +               +
         R1   R2              R3
         |    |               |
         +----+-- TV Red      +--- TV Green
Just be careful about what happens if any of the outputs are high at the same time. A little high should be ok but clip. (1.5V?) A lot high (5V?) could break things irrevocably.
Last edited by lidnariq on Tue Jan 21, 2020 3:30 pm, edited 1 time in total.
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Sat Jan 18, 2020 8:21 pm Unfortunately, I used the obtuse symbol "//" to mean "is in parallel with", not "is divided by".
Oh I wasn't aware of such notation for parallel. That explains why it didn't work. In that case the formula should be like this:

Z//R2÷(R1+Z//R2) = 1÷(1÷Z+1÷R2)÷(R1+(1÷(1÷Z+1÷R2))) = Vpp÷Vcc

And the formula for the resistors in each output channel would be:

TV Speaker (Vcc=6V, Vpp=0.1V, Z=10kΩ)
10000//R2÷(R1+10000//R2) = 0.1÷6

Headphone Speaker (Vcc=6V, Vpp=0.2V, Z=16Ω)
16//R2÷(R1+16//R2) = 0.2÷6

Video (Vcc=6V, Vpp=0.7V, Z=75Ω)
75//R2÷(R1+75//R2) = 0.7÷6

Sync (Vcc=6V, Vpp=0.3V, Z=75Ω)
75//R2÷(R1+75//R2) = 0.3÷6

To be honest, I've just been setting up the equations and asking Maxima to solve it for me.
Thanks for the tip! Heavens bless technology for allowing me to continue being dumb!

Depends entirely on how loud you want it to be. As long as it's less than the speaker is rated for. 2W in an otherwise-quiet room is fairly loud.

Most speakers are electromagnets, and electromagnets generate magnetic force proportionate to the amount of current through them. More current=more deflection. More change in amount of deflection=louder. You don't really care about what the voltages involved are, other than as a tool to push current through it.

If you pick up a piezo beeper instead of a voice coil that changes things, although mostly conceptually.
I picked up a bag of cheap piezo "PC speakers" from China some years ago (because modern IBM-PC motherboards seldom comes with an internal speaker nowdays), and I thought I might use one of those for the Pong system. I also have a speaker I salvaged from an old broken telephone receiver I found in the trash. It says SD153B on it, not sure if it's a voice coil. I've used it with a PIC MCU before. I have no idea what power either speaker has. 2W is just what the Ball & Paddle datasheet example uses, and such a voice coil is quite easy to find if I'd need one.
Is there anything in particular to think about if I use a piezo though? I might experiment with it until I get a good volume. A potentiometer to control volume of it would be a good thing as well.

.... Actually, I think I have to take that back...
...
I'd probably start off by seeing if the IC operated acceptably at 5V, and if it did I'd just use some 74xxx logic instead.

If the AY-3-8500 doesn't, I'd probably dispense with the impedance matching and go for a more minimal design like this:
...
OK that's a few options. I guess I'll just start with the minimal design, with a BC546 family transistor etc, first to see that the chip works at all. I can try with 5V to see if it works, but I don't understand how the resistor formula changes if Vcc changes to 5V? "Ve÷Ie=3.3V÷5.9mA = 559Ω" looks like Ohm's law but does Ve and Ie change if Vcc changes? And where do Vb=4V and Ie=5.9mA come from?

Also I still seem to have the option to make a buffer with a 4503 or something.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Mon Jan 20, 2020 12:30 pm TV Speaker (Vcc=6V, Vpp=0.1V, Z=10kΩ)
You probably want Vpp higher than 0.1V for this.
I also have a speaker I salvaged from an old broken telephone receiver I found in the trash. It says SD153B on it, not sure if it's a voice coil.
Oddly enough, that specific string shows up if you search for it. Looks like it's a comparatively high impedance voice coil. And rather low power, only 50mW.
Is there anything in particular to think about if I use a piezo though?
Not really. Instead of electrically looking like an inductor and deflection being a function of the generated magnetic field, piezos look like capacitors and deflection is a function of the generated electric field. Either way, it's the change that produces sound.
but I don't understand how the resistor formula changes if Vcc changes to 5V? "Ve÷Ie=3.3V÷5.9mA = 559Ω" looks like Ohm's law but does Ve and Ie change if Vcc changes? And where do Vb=4V and Ie=5.9mA come from?
So the datasheet says that Voh≥Vcc-2V when Ioh=0.1mA. So I used Ioh=0.1mA and Voh=Vcc-2V=4V. In practice, a higher-gain transistor means that Ioh will decrease, which means that Voh will go up. Because the transistor is directly connected to the output of the AY-3-8500, Vb=Voh and Ib=Ioh. Vbe came from the datasheet for the transistor, but 0.7V is typical. Vbe=Vb-Ve by definition.

Ie = current through the TV. Hence RGB:<160,0,0> is 63% is 0.44V becoming 0.44V÷75Ω=5.9mA. Upper bound is 0.7V÷75Ω=9.33mA.
Also I still seem to have the option to make a buffer with a 4503 or something.
Yup.
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Mon Jan 20, 2020 1:56 pm
Pokun wrote: Mon Jan 20, 2020 12:30 pm TV Speaker (Vcc=6V, Vpp=0.1V, Z=10kΩ)
You probably want Vpp higher than 0.1V for this.
Sure but why is that so? Isn't 0.1 Vpp required for consumer line level audio?

Oddly enough, that specific string shows up if you search for it. Looks like it's a comparatively high impedance voice coil. And rather low power, only 50mW.
Ah yes that's the one! Funny! It seems to be common in telephones. It produces a kind of nicer sound than the piezos anyway.

Not really. Instead of electrically looking like an inductor and deflection being a function of the generated magnetic field, piezos look like capacitors and deflection is a function of the generated electric field. Either way, it's the change that produces sound.
OK so I'll just wire something up with a potentiometer and the speaker and see if there is any sound, or smoke.

So the datasheet says that Voh≥Vcc-2V when Ioh=0.1mA. So I used Ioh=0.1mA and Voh=Vcc-2V=4V. In practice, a higher-gain transistor means that Ioh will decrease, which means that Voh will go up. Because the transistor is directly connected to the output of the AY-3-8500, Vb=Voh and Ib=Ioh. Vbe came from the datasheet for the transistor, but 0.7V is typical. Vbe=Vb-Ve by definition.

Ie = current through the TV. Hence RGB:<160,0,0> is 63% is 0.44V becoming 0.44V÷75Ω=5.9mA. Upper bound is 0.7V÷75Ω=9.33mA.
I see, thanks!



Before I mess with colours I think I'll just try output composite via an RCA jack. I guess I just need to join the 4 luma outputs together, send them through the buffer/attenuation circuit, merge it with the buffered/attenuated sync and send it as is out the RCA jack. The guide also used diodes on the luma output pins but not on sync, not sure why.

Code: Select all

P1 Bat -|>|----+    __________________
P2 Bat -|>|----+   |                  |0.7Vpp      RCA jack
Ball ---|>|----+---|buffer/attenuation|---------+---O)------- GND
BG -----|>|----+   |__________________|         |
                    __________________ 0.3Vpp   |
Sync --------------|buffer/attenuation|---------+
                   |__________________|
This is proper B&W composite video right?



SCART is a bit more complicated than I thought, and I must study more on it. There is pin 8 which seems to select aspect ratio, but I'm not sure if I need to wire it or if I can just ground it. If I do need it, I might need 12V to set it to 4:3 (Pin 8: 0–2V=off, 5–8V=16:9, 9.5–12V=4:3). Actually SNES SCART cables do exactly this, and that's why it's dangerous to use the wrong region cable, because there will be 12V on the csync pin.
There is also the "blanking" pin 16 which is used to tell the TV if RGB or composite video is used. I read that some TVs do need it. It's just 1-3V (nominally 1V) though, and seemingly 75 Ω impedance, so I guess I can just make another voltage divider and get it down close to 1V but above 0V.
Last edited by Pokun on Fri Jan 24, 2020 4:55 am, edited 2 times in total.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Wed Jan 22, 2020 6:39 pm Sure but why is that so? Isn't 0.1 Vpp required for consumer line level audio?
No, it's 1Vpp, not one-tenth of that.

Doesn't matter much—you can just adjust it in the TV's volume control later—but you won't get a positive and real-valued mathematical solution if you try have the low-impedance (headphone) output be higher voltage than the high-impedance (amplifier) output.
The guide also used diodes on the luma output pins but not on sync, not sure why.
Because the four diodes are effectively a diode OR gate. Visually, you want to show if any of the inputs are high, and you don't really want the multiple outputs to compete with each other.

Meanwhile, composite video requires at least three different voltages to display something: Sync, Blanking, and Active. Hence having conceptually two separate stages of attenuation.
SCART is a bit more complicated than I thought, and I must study more on it. There is pin 8 which seems to select aspect ratio, but I'm not sure if I need to wire it or if I can just ground it. If I do need it, I might need 12V to set it to 4:3 (Pin 8: 0–2V=off, 5–8V=16:9, 9.5–12V=4:3).
I think you'll be fine signalling with 5-6V there. It's not like the AY-3-8500 generates square pixels such that you'll notice a difference.

(2MHz dot clock, and e.g. the score digits are 30 scanlines high, so at 4:3 that means the score digits are about 3 times (59/160) as tall as wide. At 16:9 they'll be close to 1:2 aspect instead. For contrast, the NTSC digits are 20 scanlines high, and so at 4:3 the digits are twice (81/176) as tall as wide.)
There is also the "blanking" pin 16 which is used to tell the TV if RGB or composite video is used. [...] seemingly 75 Ω impedance, so I guess I can just make another voltage divider and get it down close to 1V but above 0V.
The French SCART NES just has +5V---100Ω---pin 16 – see viewtopic.php?t=18861
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Wed Jan 22, 2020 8:10 pm
Pokun wrote: Wed Jan 22, 2020 6:39 pm Sure but why is that so? Isn't 0.1 Vpp required for consumer line level audio?
No, it's 1Vpp, not one-tenth of that.

Doesn't matter much—you can just adjust it in the TV's volume control later—but you won't get a positive and real-valued mathematical solution if you try have the low-impedance (headphone) output be higher voltage than the high-impedance (amplifier) output.
Oops sorry my mistake. It was indeed 1 Vpp.

the four diodes are effectively a diode OR gate. Visually, you want to show if any of the inputs are high, and you don't really want the multiple outputs to compete with each other.
I don't really understand. An OR gate would just prevent all of them being high at the same time. 3 or 2 of them can still be high at the same time.
But it sounds like diodes like this is what I want when joining several signals in this way.

Meanwhile, composite video requires at least three different voltages to display something: Sync, Blanking, and Active. Hence having conceptually two separate stages of attenuation
You mean like: blanking = black (0V), active = white (0.7V or anything within 0<V<=0.7)? Where are those separate stages of attenuation in my case?

I think you'll be fine signalling with 5-6V there. It's not like the AY-3-8500 generates square pixels such that you'll notice a difference.
I guess. I have to manually set to 4:3 mode sometimes on a wide-screen TV. And a normal TV probably just ignores this pin.

The French SCART NES just has +5V---100Ω---pin 16 – see viewtopic.php?t=18861
Yeah most SCART cables for systems just have +5V and a 180 Ω resistor here (inside the cable I guess). OK I'll try that.
I thought of using the 8-pin mini-DIN-SCART cable with Framemeister pinout like NESRGB, many other RGB mods and modern superguns use, since it doesn't have any components inside and is fairly standard by now. But it's still a custom cable so I might as well just use a common male-to-male SCART cable. But that also means I have to worry about every pin. Not sure what to do with unused pins like the data pins, if I have to tie them to ground, leave them unconnected or something.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Fri Jan 24, 2020 5:29 am I don't really understand. An OR gate would just prevent all of them being high at the same time. 3 or 2 of them can still be high at the same time.
... No, that's not what an OR gate does?
An OR gate is high if any of its inputs are high, and low only if all of its inputs are low.
You mean like: blanking = black (0V), active = white (0.7V or anything within 0<V<=0.7)?
Yeah. Sync = -0.3V, blanking=black=0V when not NTSC-M, active is anything between 0 to 0.7V.
Or add 0.3V to all of the above.
Where are those separate stages of attenuation in my case?
In the ASCII diagram you shared, you had two separate boxes marked "buffer/attenuation". Those two boxes.
I guess. I have to manually set to 4:3 mode sometimes on a wide-screen TV. And a normal TV probably just ignores this pin.
My understanding - as someone who never had access to sets with SCART ports - is that the middle level was defined in a backwards compatible way when widescreen TVs started being a thing, and old 4:3 sets just care about the signal as 12V logic. Whether 5/6V is read as logic high or logic low on those old sets is definitely not something I know.
Not sure what to do with unused pins like the data pins, if I have to tie them to ground, leave them unconnected or something.
Well, what does the SNES SCART cable do?
GamesX has a schematic of a dreamcast-to-SCART cable...
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Fri Jan 24, 2020 12:31 pm
Pokun wrote: Fri Jan 24, 2020 5:29 am I don't really understand. An OR gate would just prevent all of them being high at the same time. 3 or 2 of them can still be high at the same time.
... No, that's not what an OR gate does?
An OR gate is high if any of its inputs are high, and low only if all of its inputs are low.
Ah that's right! I see, so basically it merges many logic signals into one logic signal. Makes sense!

In the ASCII diagram you shared, you had two separate boxes marked "buffer/attenuation". Those two boxes.
OK now I understand!

My understanding - as someone who never had access to sets with SCART ports - is that the middle level was defined in a backwards compatible way when widescreen TVs started being a thing, and old 4:3 sets just care about the signal as 12V logic. Whether 5/6V is read as logic high or logic low on those old sets is definitely not something I know.
Yeah I see, I have trouble finding info about it too. Thanks anyway!

Well, what does the SNES SCART cable do?
Haven't found a pinout that tells what the SCART end does. I guess I can check my SNES RGB-cable with a multimeter.



Wait if I'm making a palette with resistors I can only control the white objects. What if I'd want a lush green backdrop? I guess I'd need some kind of logic that watches the luma signals and send them to their respective colour circuit whenever they are white, and send them to a lush green circuit otherwise.
I'm actually fine with black, but I'm still curious how it could be done.

Also what happens if I feed 625 line video to an NTSC TV? Is it cut off or will there be some more severe problem? The Ball & Paddle chip comes in a 625 and 525 line version. PAL TVs seems to be fine with 525 line video, although it's letterboxed. And since NTSC and PAL has a bit different horizontal refresh frequency, I guess the picture might be a bit right-shifted on NTSC. Something like that seems to happen on PAL TVs anyway with NTSC systems using an RGB cable on a TV that isn't NTSC-compatible other than supporting 60 Hz vertical refresh.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Mon Jan 27, 2020 5:33 pm Wait if I'm making a palette with resistors I can only control the white objects. What if I'd want a lush green backdrop? I guess I'd need some kind of logic that watches the luma signals and send them to their respective colour circuit whenever they are white, and send them to a lush green circuit otherwise.
You'll need a signal that will indicate the active portion of the signal. This unfortunately doesn't already exist on the output, so you'll need some kind of digital or analog modified copy of hsync/vsync.
I'm actually fine with black, but I'm still curious how it could be done.
The datasheet for the AY-3-8500 (Fig. 1, page 7) says that internally it divides each scanline into 128 pixels, with 73 inside the marked field, roughly this modeline:

Modeline "73xY" 2 73 89 101 128 Y Y Y Y (57% active, comparable to C64 and Apple 2's 60%)
Vertical timing depends on whether it's the 525-line version or 625-line version.
Modeline "Xx192" D X X X X 192 214 220 262
Modeline "Xx232" D X X X X 232 262 268 312

The "FPGA" solution would be to have a set of counters clocked by the same 2MHz pixel clock, and use a bunch of digital comparators to determine where the active portion is.

A more analog solution would be to separate VSYNC and HSYNC out of CSYNC, and use four retriggerable one-shots and an AND4 gate to generate the active area that way, e.g. a pair of 74'123s.
Also what happens if I feed 625 line video to an NTSC TV? Is it cut off or will there be some more severe problem?
On a HDTV? No idea. Modern HDTVs may accept 50Hz input ok. But over here they don't have SCART inputs... if you're lucky they might still have a VGA input and that might be willing to accept 576i or 480i timings.

Older SDTVs? They just won't draw anything useful. Almost always the video will roll (vsync loss). Shouldn't cause any harm.
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

lidnariq wrote: Mon Jan 27, 2020 6:15 pm
Pokun wrote: Mon Jan 27, 2020 5:33 pm Wait if I'm making a palette with resistors I can only control the white objects. What if I'd want a lush green backdrop? I guess I'd need some kind of logic that watches the luma signals and send them to their respective colour circuit whenever they are white, and send them to a lush green circuit otherwise.
You'll need a signal that will indicate the active portion of the signal. This unfortunately doesn't already exist on the output, so you'll need some kind of digital or analog modified copy of hsync/vsync.
OK that was a bit more complicated than I hoped. Thankfully I think black will look nice for now. Thanks for explaining it!

On a HDTV? No idea. Modern HDTVs may accept 50Hz input ok. But over here they don't have SCART inputs... if you're lucky they might still have a VGA input and that might be willing to accept 576i or 480i timings.

Older SDTVs? They just won't draw anything useful. Almost always the video will roll (vsync loss). Shouldn't cause any harm.
Oh right, I forgot NTSC SDTVs probably won't take 50 Hz vertical refresh. Rolling picture, that's the same thing that happens when I try to run NTSC stuff on an older PAL TV that doesn't support "PAL60".
Even if they don't take SCART aren't there SDTVs with some way to hook up raw 15 kHz RGBs though? I know there's the RGB21/JP21 in Asia at least. There are a lot of Americans seemingly using SCART in gaming communities, but I guess it might just be for a Framemeister or OSSC. I also saw there was a youtube video for RGB-modding a CRT TV, although modding a high-voltage device like that sounds scary to me.

But what I really meant to ask is what would happen if you beamed 625 lines on an NTSC TV? I would guess that the electron gun wouldn't get stuck or anything when it tries to draw 100 extra lines, but maybe the picture would be corrupted in some strange way (if we have a hypothetical NTSC SDTV that supports "NTSC50" but uses 525 lines)?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Homebrew First-gen Console (AY-3-8500)

Post by lidnariq »

Pokun wrote: Tue Jan 28, 2020 5:37 pm Even if they don't take SCART aren't there SDTVs with some way to hook up raw 15 kHz RGBs though?
Some upmarket (large) ones from the final five-ish years of CRT SDTVs (I dunno, manufactured 2000-2005 or so?) often have analog YPrPb inputs. But older and smaller sets often only have S-Video or composite or are RF only.

... I guess there was that thread from a decade ago where SatoshiMatrix picked up a 1984-era US TV set that supported digital RGBI and some kind of analog RGB, but doesn't appear to have sat down and got the RGB working.
But what I really meant to ask is what would happen if you beamed 625 lines on an NTSC TV?
I'm not certain what distinction you're making when you ask this time relative to the previous one? The electronics in the TV - at least all the ones I've played around with - just won't accept a vsync pulse that's that much too late. Hence rolling.

Clearly the AY-3-8515 expects that all US TVs can accept hsync rates that are 1.6% too fast, and my personal experience is that TVs will usually accept vsync rates that are within 10% of the correct rate. But even both together won't let you get further than 575 lines on a US CRT SDTV.

One thing's that not clear: just what clock rates can the AY-3-8500 deal with? The specification of 2MHz±1% is clearly for the TV, not the IC itself. Sufficiently silly clock choices (e.g. 3.84MHz into a 625-line AY-3-8500) might be accepted by some computer monitors (30kHz hsync, 95Hz vsync)
Pokun
Posts: 2670
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Homebrew First-gen Console (AY-3-8500)

Post by Pokun »

I see, the number of lines depends on vsync (and hsync) timing. I think I didn't understand at the time that framerate and number of lines are connected.


BTW this project is to be continued...
Post Reply