Page 1 of 2

Interfacing the MD's Serial Ports to a PC

Posted: Tue Jun 18, 2013 8:14 pm
by MintyTheCat
Hello all,

does anyone have a Schematic that I could use to 'safely' connect my MD 1 up to my Linux Machine over 232?

Thanks.

Posted: Tue Jun 18, 2013 8:39 pm
by Mask of Destiny
I don't have a schematic, but you probably want to look into the MAX232 level translator IC. That said, the max baud rate is really low. You can get better throughput with a 4-bit parallel protocol.

Posted: Tue Jun 18, 2013 8:58 pm
by MintyTheCat
Mask of Destiny wrote:I don't have a schematic, but you probably want to look into the MAX232 level translator IC. That said, the max baud rate is really low. You can get better throughput with a 4-bit parallel protocol.
I've used MAX232 and its relatives in the past, I was wondering how the lines should be pulled and what value resistors and capacitors I should use though. Art transfer speed I really just wanted to pass very small amounts of data back and forth but I could use parallel too later. Do you have any ideas for safe values at all?

Posted: Tue Jun 18, 2013 10:00 pm
by Mask of Destiny
I don't have any direct experience using the MAX232, but based on a quick perusal of the datasheet, some example schematics and what I know about the gamepad ports, I don't think you'll need any resistors. The datasheet suggests you should use 1.0 uF capacitors for the 232. Other variants require different values.

This thread has some information about which pins and registers to use for serial operation: viewtopic.php?p=18483

Posted: Wed Jun 19, 2013 12:46 am
by Chilly Willy
If you really want to do this via serial, get a USB to TTL serial cable. That will connect directly to the controller port without any level shifting.

Posted: Thu Jun 20, 2013 10:49 am
by MintyTheCat
Yes, I actually bought a USB-RS232 converter and a couple of TeensyUSBs and forgot that I had them.

I had a look at the MD's Schematic and I can see that the Serials are connect to EM1X Ports on IC315-5309. My question: are these standard RS232 level lines at +-11V ? Also, am I being too paranoid in wanting to use opto-isolators on the port?

Cheers.

Posted: Thu Jun 20, 2013 10:57 am
by TmEE co.(TM)
They are 0 to 5V

Posted: Thu Jun 20, 2013 11:39 am
by MintyTheCat
TmEE co.(TM) wrote:They are 0 to 5V
I see, so we must use the level-shifter to get the +-11V on the PC side down to 0 to 5V.

Thanks for the Info.

Posted: Thu Jun 20, 2013 1:10 pm
by TmEE co.(TM)
That is what you need the MAX232 or equivalent for. It'll work as is.

Posted: Fri Jun 21, 2013 5:49 pm
by MintyTheCat
TmEE co.(TM) wrote:That is what you need the MAX232 or equivalent for. It'll work as is.
I have my MAX232 here and I started to draw up my Schematic. However, I wanted to have confirmed that the Pins connected to 315-5309's EM3X are correct as I have no Oscilloscope to check the Output at this time and worry about damaging the Pins. Can someone confirm that Pins for RS232 Serial are as:

1,2,3,4 : UP, DOWN, LEFT, RIGHT
5: VCC
6: TL (Serial Send TX)
7: TH (Serial Interrupt)
8: GND
9: TR (Serial Receive RX)

I will put my Schematic together along with a Test-Program to help out anyone who is starting to work with Real MD Hardware :wink:

Posted: Fri Jun 28, 2013 7:15 pm
by MintyTheCat
Hello Blokes,

in case anyone will read this and would like to know:

[MD Ext.-Port Set to Serial-Mode]

SCTRL = 0xB0 : Baud=1200bps, Serial-In, Serial-Out, No-Interrupt.

Pins:

TX = TL = 6
RX = TR = 9

Make sure that you Ground Pin 8

I also pulled the TL and TR up to +5V using 10K Resistors.

I wrote a quick Test to send alternating Bytes over the Port to my Bus-Pirate v3 in UART-Mode set to automatic update for all Data received.

I need to take the MD's 5V down to something that my Teensy3 can use, so around 3.3V. I'll update you once I've sorted the Hardware out.

Cheers.

Posted: Wed Jul 03, 2013 3:38 am
by mder
How about using Sweet Rammy?
http://68000.web.fc2.com/sram.html
This tool can perform reading and writing of SRAM,FRAM,EEPROM or FlashROM using a serial port.
Of course, reading of a commercial game can also be performed.

Posted: Wed Jul 03, 2013 9:42 am
by KanedaFr
WOW! Sweet Rammy seems to be exactly what I was looking for !!

Posted: Wed Jul 03, 2013 10:53 am
by mder
The present correspondence procedure is transmitted and received by HEX data using terminal software.(HyperTerm,Teraterm,etc.)
It is necessary to change into BIN from HEX data.

Supplement: With the present version, Reading and Writing of EEPROM correspond only MODE1(7bitsWORD).

All the Megadrive games put on the market in Japan can be read.
The following games also correspond.
*Phantasy Star - Hukkokuban (SMS Game)
*Virtua Racing (SVP used)
*Super Street Fighter II - The New Challengers (Memory mapper used)
*Sonic and Knuckles & Sonic 2 (Include Extra data)

The writing of FlashROM of 29Fxxx series is made.
Creation of an original Flash cartridge can be performed.

I think that it is useful also to those who study Megadrive(Genesis) since Sweet Rammy can carry out operation of the address directly.

Please try.

Posted: Fri Jul 05, 2013 4:45 pm
by MintyTheCat
konnichiwa MDer, ogenki desuka?

I had a look at your Schematic and your Idea for using the M68K's HALT Pin. Yes, this was used all the way back to the 6800 uCs for single-stepping. My only concern was that by removing the M68K that the MD's Custom ICs would fail although I had wished to try it out in the future - cheers.

I tried your SRAM.bin using my Mega Everdrive but I get a flickering Screen.

Machine: MD #1
PAL, German

It might be that your Program is built for NTSC Machines.

We are actually putting a Project together to give the MD Developer a Command-Monitor. If you'd like to have more Information then please Message me.

Cheers.