samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 10, 2020 4:58:28 GMT
Been reading a bit about AM demodulation. A rudimentary circuit look could look like this:
R-Y or B-Y pin
|
Transistor buffer (so the HuC6260 doesn't have to source current)
|
AC coupling capacitor (so that half of the carrier sine wave goes below 0V)
|
Diode (cuts off bottom half of said sine wave)
|
Low-pass filter (gets rid of carrier wave, leaves modulation wave)
The tricky part seems to be making a low-pass filter that will suppress the heck out of the 3.58MHz carrier wave but fully pass 1.79MHz, which is the theoretical maximum frequency of the modulation wave.
In AM radio, for example, things are much simpler because the modulation and carrier waves are separated by at least an order of magnitude, e.g. <20KHz for the modulation wave (the part you're listening to) and >200KHz for the carrier wave. Simple low-pass filters work fine here because you don't really have to worry about letting through some amount of 40KHz or whatever (and not because you couldn't hear it anyway, but because nothing is there).
For R-Y and B-Y, though, we would need a filter design with a really sharp cutoff curve. A simple resistor-capacitor filter just won't do it. I'll see what I can find. (EDIT: Nah, this whole approach is too low-fi. Real TVs use a more sophisticated form of demodulation called synchronous detection. Reading about it now.)
If we're lucky, this demodulation processing won't take so much time that there will be a need to add a delay to the Y line. We'd also be hoping that the phase shift between R-Y and B-Y would be too small to be noticeable.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 10, 2020 10:27:01 GMT
OK, progress! I finished building two parallel replicas of the onboard amp on one big project board and sent luma and chroma separately through each of them. In both cases, the pins of the HuC6260 were being tapped directly. I have a favor to ask. The handmade schematic of the Turbo Booster might be wrong. Luma was doing just fine in the amp until it went through the stage as described in that schematic. After that, the bottom clipped and things got weird. Chroma also seems healthier before it reaches this. I would be very grateful if someone could either confirm what's inside the Turbo Booster or CD-ROM dock, or investigate what's inside the PCE models that do composite video out unassisted. I decided not to use the 2SC945 clones from the shop as they were giving very high hfe ratings on my multimeter - much higher than the datasheet says they should. They might actually be clones of one of the high-beta versions. Instead, I used 2SC1815-Ys and a 2SA1015-Y for the PNP, which is the complementary part. They worked fine, as they should - the datasheet says they should be even better at high frequencies than the originals. I didn't use a C2785 for the last transistor, but that shouldn't matter. The parameters are almost the same as the 2SC945 anyway, as far as I can tell. I might need to install a potentiometer somewhere in there so that I can tune the signal to be exactly 1Vp-p (or 0.7Vp-p for chroma). Anyway, the edges looked really good on an oscilloscope. No distortion that I could recognize. I used a separate 7805 regulator, and it warmed right up. Not enough to need a heatsink, but enough to know it's supplying some real current. EDIT: I was watching this video and was impressed with how the guy just took the signal from resistor 127 on the TG16 board and it worked fine. It sounds like he took it from the side that would correspond to the EXT out pin. There is no AC coupling cap, as he mentions, but that's easily added. From the emitter of the third transistor, which is the last one in the on-board amp in the TG16 itself, there is a 100 ohm resistor to ground and a 20 ohm resistor to the EXT pin. Do these somehow factor together to make 75 ohms? I really don't know. It doesn't seem impossible; the output of the NES uses a 560 and a 68 ohm resistor in the same respective positions, which have a similar sort of ratio. If I can just slap an AC coupling cap after the 20 ohm resistor (after the third transistor) on the on-board amp, I'll be done. But what the heck is in the Turbo Booster and all the other systems?
|
|
sarge
Punkic Cyborg
Posts: 104
Fave PCE Shooter: Soldier Blade
Fave PCE Game Overall: Dracula X: Rondo of Blood
Fave PCE RPG: Dungeon Explorer II
|
Post by sarge on Jan 10, 2020 20:51:30 GMT
Have you tried out a different brand of CD-r? Some Duos are just picky about the colored Dye used in the discs regardless of having a new lens and or making lens adjustments. Meaning if the discs you have been using are light green bottom discs(usually cheaper verbatim or memorex discs), you might want to try some that are dark green/blueish instead. The darker colored brands would be taiyo yuden or Verbatim Data Life CD-Rs. I've tried out a few. Interestingly, some TY discs I have don't work as well (they're even the Japan-manufactured ones!), whereas some older Sony CD-Rs (circa 2004-ish) have worked the best so far. I've been wanting to try Verbatim Data Life or MAM-A discs for a while, but I don't really want to overpay for them, either, given how much I've already sunk into CD-Rs... although I have a heck of a stash for my Sega CD/Saturn/Dreamcast burning. I can definitely confirm that modern Memorex discs are awful with it, as well as with a few of my systems that are starting to have laser issues, like my Dreamcast. I've started using the TY discs for that system instead. My magic testing game for the Duo with discs is the 4-in-1 disc. If it catches that opening audio track with Bonk, that's a good sign. The Sony gets that probably 60-70% of the time. samiam : Yeah, I think I'm just nervous to use my system as the guinea pig. I've worked on systems before (full recap of a Genesis and some portable repairs), but it's the only Duo I have and a system I don't want to mess up. I wanted one for years until I finally bit the bullet and bought this one on eBay.
|
|
keithcourage
Punkic Cyborg
https://www.facebook.com/turbografxfan/
Posts: 232
|
Post by keithcourage on Jan 11, 2020 17:59:25 GMT
I've got some parts coming in the mail from China for me to experiment with another possible component video circuit. Will post an update here once I get stuff in the mail.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 12, 2020 1:41:44 GMT
No hints? Very curious to see if and how you're going to demodulate R-Y and B-Y.
My S-video mod has two forks at the moment:
1. A single transistor, potentiometer, and op-amp for Y and C each. This will produce true 75 ohm output, consume less power, and involve a small number of parts, but it will be more expensive.
2. The complete three-transistor amp from the TG16 schematics. This may or may not improve depending on what I can track down about systems with composite output support. This will not (currently) produce true 75 ohm output, and it certainly consumes more power and needs lots of parts. However, it will be cheaper.
If I can just figure out true 75 ohm output, the second option is ultimately going to be preferable for most people, I think.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 12, 2020 5:02:34 GMT
Finally, I think I get it. users.tpg.com.au/users/ldbutler/OutputLoadZ.htmI was fundamentally misunderstanding a few things before. For transmitting weak little video signals, the termination resistance (load resistance) is far more important than the source resistance. As long as the characteristic impedance of the cable is 75 ohms and the termination is 75 ohms, signal reflections shouldn't happen at all. Having the source resistance at 75 ohms only serves to absorb reflections after they happen, before they bounce back down the line again. If those reflection waves aren't there in the first place, everything is cool. (I think.) It's interesting that at PCE video frequencies, significant reflections shouldn't even begin to happen until the cable is longer than about 5m. That's because reflecting doesn't occur until the length of the cable exceeds 1/4 of your signal's wavelength. Most 240p systems use pixel clocks of around 7MHz or less most of the time; light in a vacuum would travel about 42.3 meters in one clock-tick at that rate, and we should apparently suppose an electrical signal will travel half of that. Take a quarter of that, and there you go, 5m. Things do get complicated by the fact that we're not talking about sine waves, at least for luma. When you have a square wave with fast rise and fall times, they say you shouldn't use 1/4 but rather 1/40. With low-res analogue video, though, those super-tiny edge reflections are probably not going to matter much. In other words, if you're fine with a 50cm cable, you can use whatever the hell you want and it won't matter. If you need something between 50cm and 5m, a crappy cable will introduce only the smallest of distortion. After 5m, though, you ought to suck it up and get some decent coax. For people who just have to have protection against that second reflection, this should work: Strictly speaking, the transistor itself factors in as well and that leftmost value shouldn't be exactly 75, but that's not such a big deal. What is a big deal is that if you ever accidentally touch the signal line to ground while the system is on with this, you'll basically be shorting the power rail to ground. So if you've got an S-Video cable that doesn't completely suck and you're willing to trade a redundant signal-integrity measure for a safety measure, you should use a different design that puts some resistance in the output line. That, or pay for the expensive op-amps so you can have both.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 14, 2020 7:19:58 GMT
I have not connected this to a TV for testing yet, but on an oscilloscope these designs are shown to get the signals to their proper amplitudes when connected to a 75-ohm load (represented here by the rightmost 75 ohm resistors). The big remaining issue is DC bias. TV inputs are supposed to be built to accept some bias, and they kind of have to be. The way that AC coupling usually works - with a capacitor in series that puts the signal's average at 0V - AC coupled video signals actually wander all over the place as the picture content changes. The inputs at the TV are supposed to restore the signal to a constant voltage by clamping it. I read in a datasheet that EIA standards call for receivers to accept blanking level at 0V ±1V. Since the signal itself is 1Vp-p, that makes sense. With the above circuitry, luma's blanking level comes out at about +450mV, so it should work as-is on virtually any TV. The problem is that chroma's DC bias comes out of this circuit at 2V. The distance between 0V and the signal's negative peak is about 1.6V. That's high enough that I wouldn't expect the same universal compatibility as luma. Since it's a sine wave, it might be expected to never wander at all. Some clamp designs might not be able to deal with that much bias, either. So why not just stick a capacitor in there? Because it won't work following a transistor's emitter like this unless we do some things that we just can't do. Read this to find out more. At this point, I'm REALLY curious to see NEC's official output circuitry as well as to check the result on an oscilloscope. I'd also like to see what kind of bias the North American NES's composite video output has, too, because it doesn't even have an AC coupling capacitor on it. The simple answer here is to use an op-amp. Those will let us attach an AC coupling capacitor on the output, and they'll let us use 75 ohm source resistance to boot. Now that we have a surefire method for getting the signals buffered and at proper amplitude, this should be easy. Unlike before, we can just use some purpose-built line drivers. The THS7316 actually has a clamping function built into it. So does the NJM2267. These are both cheap, common single-supply video op-amps that are designed only to amplify a video signal +6db and drive the output. They also have multiple inputs/outputs. If either one of these will work, we'll be set. But having said all of that, most TVs will probably be fine with this much bias on chroma. It's not that extreme.
|
|
sarge
Punkic Cyborg
Posts: 104
Fave PCE Shooter: Soldier Blade
Fave PCE Game Overall: Dracula X: Rondo of Blood
Fave PCE RPG: Dungeon Explorer II
|
Post by sarge on Jan 14, 2020 19:16:53 GMT
Very interesting stuff, samiam! I definitely want to see how this all shakes out in testing.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 15, 2020 5:32:55 GMT
OK, I was able to test this last night, and the results were encouraging!
As expected, luma was just fine. It looked sharp and proportional. On my scope, I saw that the whole signal was really more like 1040mVp-p, so I'll try to dial that in just a little (most important is that blanking and 100% white be 714mV apart.
Chroma was pretty screwed up. It worked to the extent that you could guess what most colors were supposed to be, and happily R-Y and B-Y seemed to be in balance. In other ways, though, it was obviously off, and weird splotchyness appeared depending on what was on screen. My money is on the problem being the DC bias. When I scoped the signal, it was unrecognizable, suggesting that the TV was reacting badly to what it was being fed.
Again, chroma looks just fine on the scope if you only run it into a 75 ohm resistor.
A different TV with different input circuitry might deal with the signal like we want, but we obviously need a different solution. It turns out I actually have a THS7314 amp sitting around, so I'll rig that up when I get the chance.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 16, 2020 23:07:51 GMT
Figured out how to get the DC bias out of chroma, and now it works!! And I still only used transistors and no op-amps! (from the 240p test suite) I'll post the circuit and an explanation later. It's very simple!
|
|
sarge
Punkic Cyborg
Posts: 104
Fave PCE Shooter: Soldier Blade
Fave PCE Game Overall: Dracula X: Rondo of Blood
Fave PCE RPG: Dungeon Explorer II
|
Post by sarge on Jan 17, 2020 0:21:44 GMT
Nice! Looks awesome!
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 17, 2020 6:33:43 GMT
OK, this is what got the color image to appear on my screen. The "400kHz" circuit is luma, and the "3.6MHz" circuit is chroma. Note that this does not account for all the resistors that you need to have in place before the first transistor in both amps. You'll have to follow the TG16 schematic to see what goes there. Let me explain a couple of things about how chroma is getting through, and how the mod could change or possibly be improved. I needed to add an AC coupling capacitor like in the above schematic to remove the DC bias on chroma. In the beginning, I wasn't aware of two conditions: First, when your signal is coming from the emitter of a transistor (or a diode), you must have a resistor in the position of the leftmost one here or else literally no signal will get through. That's why it's impossible for me to add an AC coupling capacitor on luma with the current circuit. Second, the value of the leftmost resistor cannot be too high; it must fall as close to the combined resistance on the other side of the capacitor as possible. The rightmost resistor in this image corresponds to the 75 ohm terminator inside everyone's TV. We can't change that. If we have to make the leftmost resistor 75 ohms, then that means that your transistor will have to source a heck of a lot of current. Fortunately, in this case we have the middle resistor in place (to reduce signal level), but its value is a mere 10-20 ohms. Even if we can raise the leftmost resistor to 95 ohms thanks to this, that's still a lot of current to provide. Heck, even if we can get away with raising it to 120 or 150, which we mostly can, that's still a lot. The main problem, then, is that the more current the transistor has to supply from its emitter, the more it has to source from its base, and the NEC design doesn't give us a terribly great amount to work with at that base. I never measured it properly, but I did see that using 330 ohms for the leftmost resistor was enough to depress the whole signal - a clear indication that we were pulling too much. The solution was to use a transistor with a really high beta. The 2SC1815-Y, the two transistors recommended in the old mod, and the 2SC945 that NEC used in the real system all have betas in the 180-220 range. I took a 2SC1815-BL, which has a beta of over 550, and put it in the position of the third transistor in the chroma circuit. Having a higher beta means that it needs proportionately less current to drive the emitter. Fortunately, it seems that this made all the difference, and I could get away with the configuration you see in the big schematic linked above. I hesitated to use high-beta transistors before because they have worse parameters all around and may degrade or distort the signal. That's something I still have to check. If this 2SC1815-BL and all others like it cause problems, it's back to considering op-amps. If we're still in the safe range with them, however, it might open up some options. If we can get away with making the bottom-left resistor 75 ohms to match the one on the right, that not only improves our performance with the capacitor, but it also should give us matched impedance, at least as far as signal reflections are concerned. It also makes it possible to add an AC coupling capacitor to luma. In other words, it makes the circuit compliant enough to recommend it universally. Basically, we're at the fine-tuning stage.
|
|
samiam
Punkic Cyborg
Posts: 100
|
Post by samiam on Jan 17, 2020 15:46:50 GMT
Oh man.
I don't even know for sure what I did, but I think I just killed pin 40. I am not getting any luma signal at all now. My best guess is that I caused a short to the power rail while I was probing something. Dang it, guys, I'm sorry.
The RGB pins still seem to work (how ironic), so perhaps the system isn't finished. This is, however, an abrupt end to my S-Video adventure.
At least I wasn't trying this on my Supergrafx.
I might try to finish the design if I can get another system for cheap, but...Ugh, I am not feeling encouraged just now.
Anyway, I think I can say that the last working iteration I had was better than the old S-Video mod. By all means, use it if you want to.
|
|
keithcourage
Punkic Cyborg
https://www.facebook.com/turbografxfan/
Posts: 232
|
Post by keithcourage on Jan 17, 2020 23:35:59 GMT
That really stinks.....
Time to start working on a component video board instead?
I probably have an extra Hu6260 here if you are talented enough to swap out the chip.
|
|
|
Post by dshadoff on Jan 18, 2020 0:26:27 GMT
Yeah that sucks. That’s happened to me in the past (well, not PC Engine damage, but other stuff I was tinkering with at the time). I’ll look through my pile and see if I have any units in working or non-working (“donor”) condition to help you continue investigating. No promises, but I’ll look.
|
|