Network connection through expansion port?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

User avatar
atarimike
Posts: 38
Joined: Mon May 23, 2005 8:43 pm
Location: Davis, CA

Network connection through expansion port?

Post by atarimike »

I'm thinking about hooking some kind of network adapter (be it serial or some kind of embedded ethernet) to the ol' NES.
I've been trying to get some information about the expansion port, but haven't found too much. It seems like all you have to work with is an 8-bit data register, and the controller lines.

One ethernet controller I've been looking at (http://www.invector.se/iet8900.asp) has the following signals:
A[0..4], D[0..7], reset, CS, RD, and WD.
Is there any way to use the signals on the expansion bus to drive it?
I suppose another way would be to use the cart lines, and put special hardware in the cart, but I'd rather not do that.
Failing that, could it be possible to hook up to a RS-232 device, like a modem?
gannon
Posts: 162
Joined: Sun Nov 20, 2005 9:38 pm
Contact:

Post by gannon »

Planning on using it with Contiki or something?
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

I don't think the expansion connector provides any address lines for decoding. This would be a very easy thing to hook up to the cartridge bus, just decode the chip's /CS to some area and make /RD = !(Phi2 && RW) and /WR = !(Phi2 && !RW), could be done with a 74138 and 7400.

You can definately use a modem too, you'd just need a MAX232 type device connected to the controller port or the expansion bus (through the controller bits) if you don't want to interface through memory I/O.
User avatar
Quietust
Posts: 1918
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust »

Technically, you could get away with just using $4016 D1/D2 for output and $4017 D1/D2 for input without conflicting with any controllers, and you'd get Famicom compatibility as a bonus (using its smaller expansion port).
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
atarimike
Posts: 38
Joined: Mon May 23, 2005 8:43 pm
Location: Davis, CA

Post by atarimike »

I'm still pretty new at all this, so sorry if some of these questions are a little basic.
kyuusaku wrote:I don't think the expansion connector provides any address lines for decoding. This would be a very easy thing to hook up to the cartridge bus, just decode the chip's /CS to some area and make /RD = !(Phi2 && RW) and /WR = !(Phi2 && !RW), could be done with a 74138 and 7400.
So if I understand correctly, you would map a certain memory area to the ethernet chip's address space?
I can't find any information on the Phi2 or RW lines - what do they do?

gannon wrote:Planning on using it with Contiki or something?
Maybe at some point, but right now I'm just experimenting. I'd probably first make it a webserver or make a telnet client.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

atarimike wrote:
kyuusaku wrote:This would be a very easy thing to hook up to the cartridge bus, just decode the chip's /CS to some area and make /RD = !(Phi2 && RW) and /WR = !(Phi2 && !RW), could be done with a 74138 and 7400.
So if I understand correctly, you would map a certain memory area to the ethernet chip's address space?
Yes. See [[Memory-mapped I/O]]. The networking controller would in effect become part of the mapper.
I can't find any information on the Phi2 or RW lines - what do they do?
Phi2 is the clock. R/W is +5V for reads or GND for writes.
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Post by commodorejohn »

I like the idea of telnetting into retroMUD from a NES.
[size=0]"There is only one basic human right, the right to do as you damn well please. And with it comes the only basic human duty, the duty to take the consequences."
- P.J. O'Rourke[/size]
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

The problem with a telnet client is the difficulty of text entry: The NES (as sold in Latin-alphabet countries) has no alphabetic keyboard.
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

The Miracle Piano Teaching System game uses the strobe signal of controller port 1 to send midi data to the instrument.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

EtherNES is still on my list of projects. My basic idea was to use an isa ethernet card, very basic to memory map into an address like the 5x00 range. The card is already set up to decode address ranges so you just need to connect the address lines in a way that will work. Control of the card is very easy through the isa registers and the card already has 8/16KB to buffer data.

You will find the net stack far more difficult than the hardware or low level driver software. UDP and DHCP are pretty basic but TCP is way complex. If you are using a proxy you can cut out some of the stuff like reordering but it is still messy. Frequently games will use UDP and add their own system to make sure messages are received, but web browsers/servers and telnet clients fully use TCP.

The last part of my plan was to take some classic games and rewrite them for net play. Latency should be no problem if the data rate is low. Yay multi player Excite Bike!
User avatar
atarimike
Posts: 38
Joined: Mon May 23, 2005 8:43 pm
Location: Davis, CA

Post by atarimike »

kyuusaku wrote:I don't think the expansion connector provides any address lines for decoding. This would be a very easy thing to hook up to the cartridge bus, just decode the chip's /CS to some area and make /RD = !(Phi2 && RW) and /WR = !(Phi2 && !RW), could be done with a 74138 and 7400.
So the data lines are already hooked up to the expansion port, I would just need to worry about the address lines, right?
When you say decode to some area, how exactly would I do this? Would I wire the low 4 bits of the address bus to the expansion port, hook the chip to those lines, then pick some random region in memory, like $6000 - $6015, detect (how?) that location being active on the bus, and throw the /CS line in the ethernet chip?
User avatar
atarimike
Posts: 38
Joined: Mon May 23, 2005 8:43 pm
Location: Davis, CA

Post by atarimike »

quietust wrote:Technically, you could get away with just using $4016 D1/D2 for output and $4017 D1/D2 for input without conflicting with any controllers, and you'd get Famicom compatibility as a bonus (using its smaller expansion port).
dwedit wrote:The Miracle Piano Teaching System game uses the strobe signal of controller port 1 to send midi data to the instrument.
It looks like using the 8-bit data bus will work. I think I'm going to try to use that, as it's much faster.
tepples wrote:The problem with a telnet client is the difficulty of text entry: The NES (as sold in Latin-alphabet countries) has no alphabetic keyboard.
That is a problem, as using an on-screen keyboard is really annoying.
bunnyboy wrote:You will find the net stack far more difficult than the hardware or low level driver software. UDP and DHCP are pretty basic but TCP is way complex. If you are using a proxy you can cut out some of the stuff like reordering but it is still messy. Frequently games will use UDP and add their own system to make sure messages are received, but web browsers/servers and telnet clients fully use TCP.
Luckily, the full net stack is more in what I'm experienced, as opposed to the low-level hardware stuff. There's some a few good embedded stacks out there, such as the one for Contiki. Still, you're right, it's going to be quite a challenge working with the limited NES power.
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Post by commodorejohn »

As for text entry, it'd be a lot less annoying to just add a PS/2 keyboard connector than trying to implement an onscreen keyboard. Whatever extra cost might be added would be worth it, if you ask me.
[size=0]"There is only one basic human right, the right to do as you damn well please. And with it comes the only basic human duty, the duty to take the consequences."
- P.J. O'Rourke[/size]
rbudrick
Posts: 284
Joined: Wed Sep 21, 2005 3:20 pm

Post by rbudrick »

What about the Famicom Keyboard. ;)

-Rob
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Post by commodorejohn »

Only works with Famicoms, unless a connector were added to the cart, and is hard to obtain. PS/2 keyboards are all over the place for dirt cheap and are, in my experience, sturdier and more reliable than USB keyboards.
[size=0]"There is only one basic human right, the right to do as you damn well please. And with it comes the only basic human duty, the duty to take the consequences."
- P.J. O'Rourke[/size]
Post Reply