EXP port as UART? For MD/GENNY soundcard project...

For hardware talk only (please avoid ROM dumper stuff)
Post Reply
tinctu
Very interested
Posts: 97
Joined: Tue Oct 30, 2007 8:28 pm

EXP port as UART? For MD/GENNY soundcard project...

Post by tinctu » Sat Dec 01, 2012 1:13 pm

My HW friend developed FM board for arduino. FM emulation runs on modern 32bit MCU. He sends data and rest do PCB board (stereo song replay).
It is based on OPL emulation (soundblaster16,adlib).
So my question is can EXP port works as UART? When yes we will have 8euro soundcard which doesnt consume 68000 or Z80 time for music.
So YM2612 can be used for effects only (guns, kicking, explosions etc etc)... So we can have massive soundsystem like on arcade maschines was...

Here is board:
Image

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

Post by TmEE co.(TM) » Sat Dec 01, 2012 5:37 pm

All 3 ports got up to 2400 baud serial mode. No hardware handshake though
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

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Sat Dec 01, 2012 8:54 pm

You could do what byuu did on the SNES and maybe try to use the controller port instead?

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

Post by TmEE co.(TM) » Sat Dec 01, 2012 8:55 pm

Parallel arrangement will result in a lot greates speeds on MD. 4bits for data I/O and 2 for handshake got me ~60KB/sec comms to PC over LPT port.
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

bastien
Very interested
Posts: 208
Joined: Mon Jun 25, 2007 7:19 pm
Location: Besançon,France
Contact:

Post by bastien » Sun Dec 02, 2012 9:02 am

Hi,
That's a very good project !
I'm also want to do a simple project ( Led Bliking with the I/O port)
Did you have some docs about Megadrive I/O i have read the Gen.hw.txt from Charles Mc Donald , good docs but i don't have enough information.

Thanks !

doragasu
Very interested
Posts: 125
Joined: Tue Oct 09, 2012 8:15 am

Post by doragasu » Sat Dec 08, 2012 3:55 pm

I'm also interested on how to set up the MD ports to use them as UARTs. 2400 bps is a very low baud rate (that's around 4 bytes per frame), but can be enough for some simple input/output devices.

Chilly Willy
Very interested
Posts: 2816
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Dec 08, 2012 5:57 pm

Actually, it's 4800 baud. All three controller ports (the two normal control ports + the exp port on the MD1) can be used for serial. There are three registers for each port, starting at 0xA1000F:

TxData - write a byte to send
RxData - read a byte received
S-Ctrl - controls serial:
b7-6: baud rate = 00 = 4800, 01 = 2400, 10 = 1200, 11 = 300
b5: serial in enable = 0 = no serial in, 1 = serial in from TL
b4: serial out enable = 0 = no serial out, 1 = serial out on TL
b3: read int enable = 0 = no int, 1 = int on input byte ready
b2: read error status = 0 = no err, 1 = error on RxD
b1: read ready status = 0 = no byte, 1 = input byte ready
b0: transmit buffer full status = 0 = not full, 1 = TxD full

So if you were using EXP for serial, the registers would be 0xA1001B, 0xA1001D, and 0xA1001F. Note that the serial is not full duplex - you should enable reading or writing, not both. Use the other parallel bits for control lines, like CTS and RTS. If you enable the read byte ready int, that will be INT2 just like for lightguns.

doragasu
Very interested
Posts: 125
Joined: Tue Oct 09, 2012 8:15 am

Post by doragasu » Mon Dec 24, 2012 12:44 pm

Thanks a lot for the info. It's a pity the port isn't full duplex and has no Tx interrupt :(

If I want to use controller port 1, then registers are 0xA1000F (TxData), 0xA10011 (RxData) and 0xA10013 (S-Ctrl), right? What's the pinout for TX and RX pins? Does it use standard DB-9 pinout (e.g. pins 2 and 3 for Rx and Tx)?

Chilly Willy
Very interested
Posts: 2816
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Dec 24, 2012 7:53 pm

doragasu wrote:Thanks a lot for the info. It's a pity the port isn't full duplex and has no Tx interrupt :(
Yeah, but consider when it was made... you're lucky it has interrupts at all, and goes a HIGH as 4800 baud! :D
If I want to use controller port 1, then registers are 0xA1000F (TxData), 0xA10011 (RxData) and 0xA10013 (S-Ctrl), right?
Right.
What's the pinout for TX and RX pins? Does it use standard DB-9 pinout (e.g. pins 2 and 3 for Rx and Tx)?
Slight goof on my info above... serial in is on the TR line, and serial out is on the TL line. The info above incorrectly states serial in was also on TL.

TR and TL are the button lines on the DB9 - TR = C, and TL = B.

I put them both on TL in the previous post because there's an error in the figure on pg 105 of the Genesis Software Manual showing TL being both out and in. So that means that a correction to the S-Ctrl is needed - b5 controls the serial in on TR, not TL.

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

Post by TmEE co.(TM) » Tue Dec 25, 2012 7:54 pm

You can cause an interrupt on a transfer by pulsing the TH line from the other side.
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

Chilly Willy
Very interested
Posts: 2816
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Dec 26, 2012 12:32 am

TmEE co.(TM) wrote:You can cause an interrupt on a transfer by pulsing the TH line from the other side.
Great idea... use the TH int as the transmit done int. Needs a little more hardware in the device, but not much.

doragasu
Very interested
Posts: 125
Joined: Tue Oct 09, 2012 8:15 am

Post by doragasu » Wed Dec 26, 2012 9:45 pm

Genesis software manual?

Is that some kind of leaked document? Sounds interesting :-P

Chilly Willy
Very interested
Posts: 2816
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Dec 27, 2012 12:49 am

doragasu wrote:Genesis software manual?

Is that some kind of leaked document? Sounds interesting :-P
It's been out for many years now. You can find links to a PDF version on the boards here somewhere... just click the search button at the top of the page. :D

The original had some missing pages, and there have been corrections to some of the info. I seem to remember a couple of threads on the manual and mistakes in it.

tinctu
Very interested
Posts: 97
Joined: Tue Oct 30, 2007 8:28 pm

Post by tinctu » Tue Jan 08, 2013 7:14 pm

THNX for infos.

Post Reply