Cart Design Questions

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Sat Aug 18, 2018 2:56 pm

Thanks so much for that detailed reply Tiido.

So, there isn't a problem with sending a 0-5v signal through to cart B1/B3? Isn't the Mega Drive expecting a -1v to +1v signal on those lines? If that's not a problem, that's good news.

With the diagrams you kindly posted, how should I go about working out what value the resistors in the diagram should be? Is there some sort of formula I should follow? There appear to be many resistors in the diagram, but I'm unsure about what values they should be or even how to find out what values they should be.
I'm sorry if I am asking too much...
If worse comes to worse I can try using the LM358, biased between 0v and 5v, filtering the output with a capacitor and seeing how I go. If the signal is too loud I can try reducing it with some resistors, hopefully..

User avatar
TmEE co.(TM)
Very interested
Posts: 2317
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Cart Design Questions

Post by TmEE co.(TM) » Sat Aug 18, 2018 3:33 pm

MD biases the signals to its own needed offsets, there's series capacitors on all the signals which are there for that purpose. It is all AC coupled. You cannot do full 5V swing for similar reasons as you get in the cart, the machine still only has 5V power rails. You'll have to experimentally find the right gain that won't clip on any hardware.

Bias voltage resistors are only a voltage divider, the calculation to those is found easily online. Biasing resitor depends on what sort of filter response you need (the serier capacitor will from a RC high pass filter), formula is easily found online too. Gain resistors depend on what gain you want. On power buffer side things get more complicated, the first 4 resistors determine idle current and set operating conditions for the transistors and their values are completely dependent on transistors, opamp and what idle current you want. Emmiter resistors are 1ohm range things, higher values are better but will reduce immunity to driving hard loads like 75ohm (output will droop and distortions increase). LM358 has low output current so it might have hard time driving the transistors fully. 1k (from opamp to base) and 68k ohm (base to power rail) might be good starting points. If things distort then you have to reduce the 68k resistor and possibly decrease 1k resistor too.
There are variations that use diodes in place of the 1k resistors but from my experience they limit output swing dramatically for given bias currents and there seems to be no advantages in distortion performance either.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Tue Aug 21, 2018 11:13 pm

Thanks Tiido. I have done lots of learning since your last post. I know now that the LM358 for example will only output a puny amount of current, and not enough to surmount 75ohms on a model 1 MD, that is why the output goes through a power buffer circuit that you have designed there.

In that case, perhaps the LM358 is not powerful enough and I should be looking at another op-amp entirely.
I have found another op-amp, the NJM2073. This op-amp looks like the ticket. Just like with the circuit you suggested, the NJM2073 needs voltage reduction resistors and filtering capacitors at the inputs and outputs, but the output should be powerful enough to not need a power buffer circuit, which should help to reduce part count and complexity. With the example circuits given in the datasheet for the NJM2073, it appears the negative input can be ground, just like with the LM358.

I am designing a PCB for the Mega Drive in a PCB design software package which uses 3.3V flash, a linear power regulator and voltage steppers, along with jumpers for me to divert stuff to an ARM discovery board once I get that going. After the initial PCB is designed I'll order the parts and get my first PCB made.

Once all those things are in my possession, I can experiment with different voltage reduction and gain settings on the op-amp to find what sounds good and doesn't clip.

My biggest problem now is to find free PCB design software that allows me to place card edge connectors! I've tried 3 so far and am having trouble with all of them either to bugs or missing functionality! I will get there though!

User avatar
TmEE co.(TM)
Very interested
Posts: 2317
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Cart Design Questions

Post by TmEE co.(TM) » Wed Aug 22, 2018 4:03 am

All opamps can have the negative power go to GND, and as with all opamps you then have to bias the inputs to somewhere between GND and positive power rail in such case. Now as far as NJM2073 goes, it isn't a regular opamp but a special purpose thing which has internal biasing to reduce external part count. only drawback is that it is a pretty low quality thing with poor THD+N figures but it can drive 75ohm without any drop in output. You will have to make sure the output capacitors are large enough not to kill too much of the lower frequency range. Output capacitor + 75ohm resistor forms a high pass filter. Signal swing will also be limited by power rails,

Card edge connectors are made with multiple pads turned into a component that you can then place whereever you want.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Thu Aug 23, 2018 10:44 am

Hmmm. It's a shame the NJM2073 looks to be low sound quality.. I have found plenty of linear power regulators which take in up to 6V and spit out both 3.3V and 2.5V - so the mid-point voltage is easily solvable if necessary.
In that case, which op-amp would you choose Tiido if you were me? Do you know of another op-amp that could drive 75ohms well and have good sound quality, while not needing a further power buffer circuit to give it more current? Would the LM4880 be a better bet? (It seems to have many of the same features, similar price, but better THD).

User avatar
TmEE co.(TM)
Very interested
Posts: 2317
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Cart Design Questions

Post by TmEE co.(TM) » Fri Aug 24, 2018 2:21 am

LM4880 seems to be adequate. It has better THD and PSRR and looks to be just as easy to use. It should be noted that the output is inverted compared to input (but this has no consequences usually).
Only opamps made to drive 75ohms are video stuff but they're usually unsuitable for audio for the most part. Very noisy in the lower frequencies, easy to make them oscillate and made to work with 1Vpp signals pretty much.
I personally will stick with a high quality opamp such as NJM4580 and a power buffer, I'm after the higher end of performance figures and guaranteed operation.
Last edited by TmEE co.(TM) on Sat Aug 25, 2018 3:26 am, edited 1 time in total.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Fri Aug 24, 2018 4:00 am

Awesome, thanks Tiido. I think I'll purchase both and experiment when building the op-amp circuit. Can't wait to get started. Need to design the first PCB that holds most of the components together first though!

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Tue Oct 09, 2018 9:25 am

Hi everyone,
8 weeks ago my wife and I had our first baby so things have been very busy but I have been planning and thinking about this project lots regardless!

I now have a question about the pins on the cart and how write low/high works. It's difficult for me to explain so I'll try to use examples to illustrate as best I can.

I note that pin B28 is Lower Byte Write and pin B29 is Upper Byte Write. Both active low, as I understand it.

What I want to know is how they relate to writes, when writing 16 or 8 bit.

When writing 8Bit numbers to even addresses, is pin B28 (lower byte write) taken low and pin B29 left high, and for odd addresses B28 is left high and B29 is taken low? Or visa versa? Or does it work differently?
Like this:
volatile unsigned char* addr = (volatile unsigned char*)(0xA13000);
*addr = 128;
=> This will take pin B28 low, pin B29 will still be high, and pins D0-D8 will form the number 128?

volatile unsigned char* addr = (volatile unsigned char*)(0xA13001);
*addr = 128;
=> This will bring pin B28 high, pin B29 will be taken low, and pins D0-D8 will form the number 128?

When writing 16bit numbers, I assume that both B28 and B29 are taken low, is that correct?

Pins D9-D15 are only utilized when writing a 16bit number, is that correct?
eg: volatile unsigned short* addr = (volatile unsigned char*)(0xA13000);
*addr = 3000;
=> If this relates to memory, then 0xA13000 will have 0B10111000 and 0xA13001 will have 0B00001011, using D0-D15?

I have sincerely looked around but have not been able to learn exactly how the pins on the cartridge work when writing 8bit and 16bit numbers. Any help explaining this to me will be infinitely helpful! Thanks guys.

Mask of Destiny
Very interested
Posts: 572
Joined: Thu Nov 30, 2006 6:30 am

Re: Cart Design Questions

Post by Mask of Destiny » Tue Oct 09, 2018 11:48 pm

themrcul wrote:
Tue Oct 09, 2018 9:25 am
When writing 8Bit numbers to even addresses, is pin B28 (lower byte write) taken low and pin B29 left high, and for odd addresses B28 is left high and B29 is taken low? Or visa versa? Or does it work differently?
!LDSW (B28) goes low (which is the "active" level) for writes to odd addresses and !UDSW (B29) goes low for writes to even addresses. For 16-bit writes, both will go low.

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Wed Oct 10, 2018 12:39 am

Awesome, thanks heaps Mask.
Just to confirm, for 8bit writes, only the first 8 data lines are used, is that correct? Do the upper 8 data lines (D8-D15) go to 0V? Or is their state indeterminate?

User avatar
TmEE co.(TM)
Very interested
Posts: 2317
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Cart Design Questions

Post by TmEE co.(TM) » Wed Oct 10, 2018 5:23 am

Low and high bytes contain same data when doing 8 bit writes.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

themrcul
Very interested
Posts: 65
Joined: Fri Apr 15, 2016 2:21 pm

Re: Cart Design Questions

Post by themrcul » Wed Oct 10, 2018 5:39 am

You guys are amazing, thanks. How do you know all these things!?

Anyway, so if my interface between the MD and the ARM chip is 8bit, I can just hook up the lower 8 data lines, and hook the write high/write low to an AND gate, so that 0V = WRITE, 5V = READ.
The ARM chip I am looking at now is the ATSAM4SD32BA-AU. It has an External Bus Interface for handling data transfers without interrupts. Even though it is only an 8bit interface, it's timings are highly configurable. From my reading, transfers happen independently from normal CPU operation. Should be fun to experiment.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests