Network connection through expansion port?

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

Moderator: Moderators

tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Why are they called PS/2 keyboards if they don't even work in a PS2? (Keyboards for PlayStation 2 are USB.)
User avatar
Anders_A
Posts: 88
Joined: Mon Nov 27, 2006 11:56 pm
Location: Sollentuna, Sweden

Post by Anders_A »

Because they were intruduced with the PS/2.

(actually the same kind of keyboard used on the AT, but with another connector)
User avatar
atarimike
Posts: 38
Joined: Mon May 23, 2005 8:43 pm
Location: Davis, CA

Post by atarimike »

I don't think I'm going to worry about a keyboard until I get the whole network thing going. It's going to be a big enough project without the keyboard.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

I guess it would actually be much easier to get a keyboard working than a network, huh.
Useless, lumbering half-wits don't scare us.
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Post by commodorejohn »

Yeah, hold off on the keyboard for now, but if you are going to do a telnet client, it'd be much easier to use than an onscreen keyboard.
[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]
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

I have keyboard working on Squeedo, that's how you navigate the UI currently, as a matter of fact.

Goes like:
PC Keyboard -> terminal (XMODEM) -> PIC interrupted, buffers -> NES gets IRQ when enabled, receives buffer.

There is also the el cheapo way, skipping the PIC and just hooking the serial line to the controller port. It's a crappy way to go though, because the NES can only receive keys when it keeps polling constantly.

I've been meaning to write a program that would allow the NES to write to the PIC, then have the PIC relay it to the PC where it could go to any TCP/IP port. The only prog I'd seen like that costs hundreds of bucks, which seems pretty nuts with how simple it should be..
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Memblers wrote:I've been meaning to write a program that would allow the NES to write to the PIC, then have the PIC relay it to the PC where it could go to any TCP/IP port. The only prog I'd seen like that costs hundreds of bucks, which seems pretty nuts with how simple it should be..
What you want to do is set up a PPP server. What makes you think the PPP server software costs >200 USD? Or are you talking about having to put together a second PC using Linux-friendly hardware?
rbudrick
Posts: 284
Joined: Wed Sep 21, 2005 3:20 pm

Post by rbudrick »

What about just interfacing it with CopyNES? Is that possible? Would it take any work out of the problem?

-Rob
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

tepples wrote:
Memblers wrote:I've been meaning to write a program that would allow the NES to write to the PIC, then have the PIC relay it to the PC where it could go to any TCP/IP port. The only prog I'd seen like that costs hundreds of bucks, which seems pretty nuts with how simple it should be..
What you want to do is set up a PPP server. What makes you think the PPP server software costs >200 USD? Or are you talking about having to put together a second PC using Linux-friendly hardware?
Here is the prog I was talking about, that does what I was looking for:
http://www.taltech.com/products/tcpcom.html
Seems simple enough.

Setting up a linux PC isn't really an option, I want to find or make software that would be included with the Squeedo kit and usable by almost anybody.
offensive_jerk
Posts: 6
Joined: Thu Sep 27, 2007 4:47 pm

Post by offensive_jerk »

Did anyone ever get a NES Ethernet device working? This is an awesome idea.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

No one has really started it yet. Just to review what's needed if a relay computer isn't used:

Hardware- basic (for me), I could hook up an ISA ethernet card in a couple minutes

UDP- somewhat easy, can include stuff like DHCP without too much extra work

TCP- INSANELY HARD! A cut down TCP stack would be barely possible with the amount of ram available. Stuff like reordering and reconstructing packets gets really messy. Could be ripped out of ContikiOS.
drk421
Posts: 329
Joined: Sun Nov 14, 2004 11:24 am
Contact:

Post by drk421 »

I'm actually working on this project right now,
More later...
User avatar
Wookie
Posts: 76
Joined: Sat Mar 01, 2008 5:06 pm
Location: Seattle, WA
Contact:

Post by Wookie »

I think you guys are missing a much easier solution to the EtherNES idea. Instead of trying to use one of the ethernet chips with address and data lines, why not use the Microchip ENC28J60. It is a 10baseT chip with an SPI interface.

There are two different designs that I have schematics for, one is just a simple ethernet adapter to get your NES on the net, the other has a PIC uC and the ENC28J60 so that it can do more stuff.

Simple EtherNES:
The design uses a 74HCT08 to do the 3.3V to 5V level shifting of the SO and INT lines from the ENC28J60. The ENC28J60 can tolerate the 5V SI and CLK signals from the CPU, but can only output 3.3V SO and INT signals. The interfacing is then done by bit-banging the SPI protocol using the expansion port pins of the controller registers $4016 and $4017. The NinTech.txt file shows two pins/bits in each registister that go to the expansion port. My design uses the two bits in $4016 for the SPI CLK and CS lines and the two bits in the $4017 for the MOSI and MISO lines. The ENC28J60 pulls down the expansion port /IRQ line when it has received a packet. Incidentally, this design is so simple and compact that the PCB can be fitted to the expansion port and then the expansion port snap cover can be fitted back over it. You still have to cut a small hole in the cover for the ethernet port though.

The More Complex EtherNES:
This design uses one of PIC uC's to give the adapter more capabilities like audio output by hooking an analog out pin from the PIC uC to the AIN pin in the expansion port. The uC is also connected to the cart through the expansion port cart pins. This allows for things like downloading game code/data updates over the network and storing them on the cart, and also reading data from the cart at runtime for things like MP3 decoding and output. The primary 6502 interface works through the controller ports the same way the the simple design above does. This allows the same SPI protocol library to be used to talk to both devices.

If I could figure out how to successfully use the data lines on the expansion port, I could do a lot more in fewer clock cycles, since the serial protocols through the controller port registers are much slower. Maybe there's a way to use a custom mapper chip in the cart that will allow the expansion port cart pins to be used as address lines. The cpu could set a bit in a mapper register to flip it into "expansion mode". This would dynamically remap a segment of the cart's memory space into the "expansion port" by routing the address lines from the CPU to the expansion port cart pins allowing the CPU to send an address signal to the expansion port. The data bus pins work as normal to read/write a byte of data from/to the address specified by the expansion port cart pins. The only reason I don't like doing this for the primary access to the expansion port is that it (1) breaks possible famicom compatibility, and (2) it means the EtherNES would only be usable with specially built carts with the correct mapper hardware.

You know, the only thing that is preventing me from building and releasing either of these EtherNES adapters is a lack of a good part to interface with the expansion port. At this point, I'm talking with a company that may be able to customize their 48-pin card edge connector to fit the unusual dimensions of the expansion port "card" on the NES. If anybody has a good part for this, let me know and I'll unleash the long dreamed about EtherNES adapter on the world. I'll also release a software library for implementing the SPI protocol to talk to the device and port one of the embedded stacks to use it.

Ultimately, if I can get a connector part, I'll probably go with the more complex EtherNES design in the end because I really want to build a cart that has a ton of serial flash memory (256MB) that can be accessed through the expansion port cart pins to allow for code/data updates. The game would then be able to have short loading screens to pull data from the flash and populate parallel flash memory/ROMs. I have a completely fleshed out game design that would take advantage of the capability for some true 8-bit awesome.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

Wookie wrote:I think you guys are missing a much easier solution to the EtherNES idea. Instead of trying to use one of the ethernet chips with address and data lines, why not use the Microchip ENC28J60. It is a 10baseT chip with an SPI interface.
The parallel ethernet chips are generally chosen for speed (at least 10x faster than serial) and because they can be interfaced directly to the NES CPU bus with no parts. An ISA ethernet card can be configured to map its registers directly into the $4200 or $4300 range with no more hardware, just wires.

For networking the hardware is incredibly basic, and the software is incredibly hard. Unless you already have at least a UDP implementation programmed you haven't even started. No, most libs you can download will not work with the NES, they use far too much RAM and processor time. Soldering ~15 address/data lines isn't stopping anyone, its the huge programming job.
Wookie wrote:You know, the only thing that is preventing me from building and releasing either of these EtherNES adapters is a lack of a good part to interface with the expansion port.
So you have finished network stacks using a prototype hand built version? What internal resources are left for the game?
Wookie wrote:At this point, I'm talking with a company that may be able to customize their 48-pin card edge connector to fit the unusual dimensions of the expansion port "card" on the NES. If anybody has a good part for this, let me know and I'll unleash the long dreamed about EtherNES adapter on the world. I'll also release a software library for implementing the SPI protocol to talk to the device and port one of the embedded stacks to use it.
Unless you plan on making many thousands of parts there is no way injection molding will work (and I guarantee you will not sell thousands of these). It will cost many thousands of dollars for the mold alone, ~$10k last time I got it quoted. May be able to find a more direct place to do it for $3-5k, but if you only sell 100 then thats $30-50 for the plug alone. A far better idea would be to sell systems with the EtherNES board installed, or available as a solder in board like the CopyNES. If its really that cheap then you could have it inside the cart instead.
User avatar
Wookie
Posts: 76
Joined: Sat Mar 01, 2008 5:06 pm
Location: Seattle, WA
Contact:

Post by Wookie »

bunnyboy wrote:The parallel ethernet chips are generally chosen for speed (at least 10x faster than serial) and because they can be interfaced directly to the NES CPU bus with no parts. An ISA ethernet card can be configured to map its registers directly into the $4200 or $4300 range with no more hardware, just wires.
Yes, but this solution doesn't work through the expansion port because the CPU's address lines aren't available there.

The network stack available for free from Microchip runs on embedded systems with much less resources than the NES. Speed isn't an issue either because the NES is going to be the bottleneck. You're right about the coding being a big job but I've implemented embedded stacks before. It really isn't that hard.

I have 48-pin connectors that almost fit. They're the right size, but the opening is just barely too skinny to take the thickness of the expansion port "card".
Post Reply