#Adventure of YM2151+YM3012+MCUs

1 messages ยท Page 1 of 1 (latest)

silk ocean
#

I wonder if the output voltage is really 0~2.5

void sedge
#

So, what is your question?

#

Reading the YM3012 datasheet more carefully, in the "Relationship between Digital Input Data and Analog Output Voltage" section, it seems to say 1/2Vdd is the center voltage, which would imply the output range is 1.25V - 3.75V. However, it's confusingly worded, so I'm not sure.

silk ocean
#

Yeah probably circuit diaram says the truth; and yes I assume it's 1/2Vdd, but I am not so sure if it goes negative voltage

those YM2151 connection diragram says that it need negative voltage so

void sedge
#

It does show a bipolar supply for the op-amps. It could be because op-amps in those days weren't so good. However, these days, 5V single supply rail-to-rail op-amps are common and cheap.

void sedge
#

A couple of solid inexpensive options (available in breadboard friendly DIP-8 packages) are the Microchip MCP6002 and Texas Instruments TLV272. If you're looking for higher fidelity, perhaps the Analog Devices LT1494.

silk ocean
#

โ˜‘๏ธ

silk ocean
void sedge
#

Given the voltage swing, any modern op-amp that can operate with a 5V (total) supply should do.

silk ocean
#

Yeah, thinking about using 4580

void sedge
#

If I read the documentation correctly, the signal never gets near either the 0V or 5V rails anyway

silk ocean
#

Yeah I assume so, I think it's around 1V-3V

#

Since of BIAS

void sedge
#

Yeah, my guess is the 1.25V - 3.75V I mentioned earlier. The 4580 is a fairly old chip, but should work (it can work down to a 4V total supply voltage)

silk ocean
#

NJM4580 is still good opamp

void sedge
#

There was an AdaFruit hint a while back pointing out that the LM741 is pretty old, and suggesting upgrading to the newer TL072. The 741 is over 50 years old, the TL072 is only 47 or so. My current go-to op-amp is the 5532, which came out in 1977. Analog just doesn't rush along like digital.

silk ocean
#

NJM5532

#

TI stopped selling opamps and whatnot in my local seller :V

silk ocean
#

I'll try to make a design that you can hotswap

#

Also, how do you mix audio? Probably I could do additive mixing with opamps?

void sedge
#

I'll usually have resistors from each source to a virtual ground point at the input of an op-amp.

silk ocean
#

Hm

silk ocean
#

was thinking siomething like this to mix a audio

silk ocean
#

In theory this will work, would it?

silk ocean
#

Probably need to have a coupling cap

#

And some LPF

silk ocean
#
  • think about USB power, how to reduce noises.
  • can I just use biased addition opamp
#

Hmm at the USB noise reduction. I heard it's unusually stable for VBUS

void sedge
#

You may need coupling capacitors if the inputs would object to being pulled toward a particular DC voltage. To reduce noise in a voltage supply, amusingly, you want the opposite concept: a "decoupling" network.

#

Normally USB noise will be high frequency noise, which is fairly easy to filter.

silk ocean
#

Yea, I think so.
I know there is like big caps

#

It ties VBUS and GND always

#

(also don't forget CC pin pulldowns :))

void sedge
#

I'll often use small caps in a CLC or CRC configuration. You'll often see the same approach used for analog reference supplies in microcontrollers.

silk ocean
#

Bias the opamp, Decouple the power, couple the audio.

#

๐Ÿ‘

void sedge
#

That's it in a nutshell

silk ocean
#

Although, how stable is the USB power anyway?

void sedge
#

It depends where you're getting it. Most computers provide well-regulated 5V to their USB ports (although there's some series impedance due to polyfuses and other protection circuitry). USB chargers vary from Apple quality (solid, low noise power) to a dangerous spiky mess. USB power banks are similar, with varying performance.

silk ocean
#

something like this I guess

#

where R9 = 10k, R10 = 10k

#

Then decouple the DC offset BEFORE the amp or HPA

#

so it will be biased to 2.5V,

#

idk if the 4580 could do near 5V...

void sedge
#

Note that I like to put a capacitor on the non-inverting input (thereby decoupling that derived voltage) or even buffer it (if I'm using it for multiple op-amps). Also note that it can be useful to balance the impedances on the inputs to minimize offset voltage, but it's not critical in this application.

silk ocean
#

yea

#

I'll add it on finished prods.

#

Actually let me ๐Ÿ˜›

#

something like this perhaps?

#

each output now have caps

#

(low ESR is considerable choice, but)

void sedge
#

You don't really need minimum ESR for audio frequency work (there's plenty of series resistance anyway), but you probably don't want polarized capacitors there.

silk ocean
#

(also, sorry if I am taking up your time :C)

#

oh yea

#
#

soemthing like this would be good perhaps?

void sedge
#

I meant adding a decoupling capacitor to ground at the junction of R9 and R10.

silk ocean
#

ahh

#

but I gonna add coupling for each FM input

#

and PCM mixing, if I were to.

#

(I would LOVE the PCM emulation :D)

void sedge
#

An X7R ceramic is possibly not ideal for max fidelity, but these are low fidelity waveforms anyway, so it's not a big deal. If you want to get fancy, a film capacitor is traditional.

silk ocean
#

I'll memo it ๐Ÿ˜„

#

(also yes I am japanese so I use those local sellers)

#

(too bad TI stopped selling parts to the 2nd hand reseller, not sure why. but it just sucks)

void sedge
#

That is annoying, especially since TI has bought many of the brands.

silk ocean
#

I think range of 100p ~ 1000p is fine?

void sedge
#

That's pretty low for audio work

silk ocean
void sedge
#

Side note: I'm fond of retro electronics and film capacitors

silk ocean
#

like this? ๐Ÿ˜ฎ

#

OOOO

#

Nice ๐Ÿ˜„

#

inb4 me I do not understand OpAmps and analog way of doing this, this is first time in practise.

void sedge
#

No, a capacitor from the junction of R9, R10, and pin 5 on the op-amp (the aforementioned non-inverting input) to ground.

silk ocean
#

Ah

void sedge
#

That way, the voltage divider resistors do double duty as voltage dividers as well as decoupling resistors.

silk ocean
#

โญ

void sedge
#

Yes, that's what I'd do. If I wanted to get fancy, I'd add a 100nF capacitor in parallel to the polarized one to absorb high frequency noise.

silk ocean
#

is floating pin okay for external mixing?

#

(R7, in this case)

#

so I can connect external sources, or is that should be avoided?

void sedge
#

Yes. Since the other end is at a low impedance point (the "virtual ground"), it won't tend to pick up noise or anything.

silk ocean
#

๐Ÿ˜„

#

Yeah I guess I'll use this. I just need to know VBUS stable
to be honest, could tuck the ESP32 and use USB that way.

#

thanks!

void sedge
#

I tend to avoid knowing much about the details of USB (it's complicated).

silk ocean
#

anyway, time to make a schematic that uses YM2151 and YM3012

#

Now probably I gonna ask about actual audio outputs. Probably could just feed this mixed VOUT to jack and use active speaker

#

or connect external HPA

#

(I do not consider passive speaker because....yes...)

void sedge
#

Those two are basically equivalent. Alternatively, you could use the existing output to a tape deck, digitizer, etc.

silk ocean
#

true

void sedge
#

One of the AdaFruit boards does use an op-amp as a low-level speaker driver. It works, but not very powerful.

silk ocean
#

...is connecting active speaker to HPA bad?

void sedge
#

Generally yes, you don't want to put a high power "speaker level" signal to an input expecting a low power "line level" signal.

silk ocean
#

so I can integrate some kind of HPA chips like 7368

#

ah ok

#

oh YEAH

#

that's why there is two jacks

#

yeah I guess I gonna leave this project to output line level (as in opamp level), and user can connect external HPA

void sedge
#

The 7368 is a bit of an oddball, but it should work fine (I usually use a common LM386 for simple circuitry, or something fancier like a PAM8302 for more fidelity and efficiency)

silk ocean
#

hm

#

but TA7368, that's external HPA, to output speaker level, for headphone right>

void sedge
#

For your amusement, a noisemaker I built out of the classic SN76477 "complex sound generator" chip, along with an LM556 (basically two 555 timers in a single package) for more waveforms, and the usual LM386 as a speaker amplifier

silk ocean
#

๐Ÿ˜„

#

I wanna make a stackable design that can take many YM soundchips

#

like YM2608 and whatnot

void sedge
#

ALL the sounds!

silk ocean
#

Yeah

#

But first I wanna experiment eith YM2151+YM3014

#

...even though my dream would be to capture YM2151 serial output, into pico or something

#

And then do a nesscery math, to restore 16bit audio stream to I2S

void sedge
#

It might be easier to just emulate the YM2151 function digitally, but sometimes we just want to use the real thing (only better)

silk ocean
#

Yeah; emulation is kinda...yeah.

#

I just wanna use og chips because I have it ๐Ÿ™‚

#

But yes, FPGA replication would be fun...

#

(but I do not wanna see jt12)

void sedge
#

I'm actually toying with an FPGA replication of the old unobtainable Atari Video Music chip

silk ocean
#

ooh

#

Probably this would be your interest?

void sedge
#

Heh, somebody's already done it. I'm not terribly surprised.

silk ocean
#

but idk FPGA so not really my forte ๐Ÿ˜›

void sedge
#

I got started in FPGA then lost most of my enthusiasm after getting some very rude replies in a Discord that's supposed to be helpful

silk ocean
#

:C

#

sad

#

But thanks for help, I might need them more :C

#

ooh

#

I found local seller selling TL074

#

But probably NJU7034

silk ocean
#

but probably that makes things interchangable between 4xxx series

#

but I do not know if I should use bipolar... eh

#

I don't think it will go above 4.0V

silk ocean
#

hmm

#

should I use ESP32-S3 for this with appopriate level shifter or :C

silk ocean
#

How would I go with converting voltage in both ways? TXB0108s?

#

Or can it be done with logic ICs alone?

silk ocean
#

Idea:
Have two jacks. One with Line and One with Headphone

void sedge
#

The TXB chips might work. You may not need bidirectional conversion for such a simple interface.

#

It is a bidirectional data bus, so you'd need either steering logic or the aforementioned bidirectional chips

silk ocean
#

Yeah

silk ocean
silk ocean
#

Either

  • disable readout from YM2151

  • and use only a octal buffer to convert

  • use SIPO to access

  • enable readout from YM2151

  • TXB0108

  • MCP23S17 (?)

  • ...?

#

Or use 74245

silk ocean
#

I guess I'll go for using Write-Only approach

#

by not asserting /RD at no time

silk ocean
#

Hmmmmm

silk ocean
#

Maybe I should just use MCP23S17.

#

wish you can just, connect 3v3 over parallel expansion chip

#

or use TXB0108.

silk ocean
#

RevA- use MCP23017

silk ocean
#

Think about DAC

void sedge
#

I thought you were going to use the companion YM3012 DAC.

silk ocean
#

No

silk ocean