New approach to the fabled NES ethernet adapter

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

Moderators: B00daW, Moderators

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

Post by Memblers »

The MCU is $1 less at Arrow, for a smaller quantity anyways. They don't stock a usable crystal though.

Looking at Digikey, the 11.0592 is a lot more common than 11mhz, might as well spec it.

I want to build a few, but don't have a programmer that will do this chip. Which brings up another question, is it possible and worthwhile to fit a bootloader into it?
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

Memblers wrote:Looking at Digikey, the 11.0592 is a lot more common than 11mhz, might as well spec it.
Now that you mention it, I've been running at 11MHz because I'm using an ATTiny2313-10 instead of the -20 version. They only carry stock of the -20 surface mount version, but it costs the same. We could go up to 18.432MHz for the same price. I'm set up for surface mount rework, so it wouldn't be a problem.
Memblers wrote:I want to build a few, but don't have a programmer that will do this chip. Which brings up another question, is it possible and worthwhile to fit a bootloader into it?
Good one. Yes, there are at least two boot loaders for the ATTiny2313. The NES232 firmware is only 693 bytes, so that leaves plenty of space for a bootloader. Looks like we can also bump the RS232 serial rate to 230,400. Both the 11.0592 and 18.432 crystals would support this. So, tonight I'll play around with upping the speed to 230,400 and using a bootloader.

Two more things we need to make a decision on. I'm going to come up with a PCB layout for an SMD version. It will include the ATTiny2313, crystal, (2) 22pf caps and connection points for the NES controller cable.
  • Do we want to have a three post header for the RX/TX/GND and leave the TTL-RS232 conversion to the user or go ahead and include a MAX232 & caps in the circuit? I ask because of the earlier discussion about using an FT232 USB converter. Some like me won't even use a converter, some will need USB and some will want the good old RS232.
  • What kind of header do we want to connect the controller cable? We could either have 5 empty pads for the user to solder the cable to or put a standard 10-pin header on it.
Of course, we could give the board one 10-pin header for all connections. Then people could just plug a standard 10-pin header cable to it and use any of the three options (TTL, USB, RS232) without modding the board. Just wire the header cable to whatever.

Code: Select all

       +5v CLK LAT DATA GND
       +-------------------+
NES    | 0   0   0   0   0 |
       |                   |
Serial | 0   0   0   0   0 |
(TTL)  +-------------------+
            TX  RX      GND   
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

I think it would be good to put a max202 clone on the board, and assume most of the interested users won't want to solder anything to it. You could drill some big holes for cable tiles to fit through, for strain-relief on both sides of the cables. max202 by itself doesn't cost much, and I guess one could use a seperate RS232-to-USB adapter if they really had to.

I actually have a box of new RS232 cables I never used (since I wanted to go to USB). It would be cool to have a use for them now maybe.

My Squeedo cart uses a right-angle polarized .1" header, it was 6 pins but I'll cut it down to 4 on the later revision (VCC,TX,RX,GND). It's just TTL-level at that point. The idea is that one could theoretically use it to control another serial device. I don't know if anything would be made for it, but if the adapter included that connector, it could make the controller port compatible with the same type of stuff.
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

Memblers wrote:I think it would be good to put a max202 clone on the board
Yeah, you're right. Most folks will need to have a turnkey solution. I went ahead and ordered enough parts to do 5 SMD boards with TTL-RS232 converters and DB9 headers. The only thing the user will need to do is supply a controller cable and splice it in. Digikey didn't have those and I'm not giving up my Arkanoid controller. :P I'll also have enough parts to do 2 or 3 thru-hole boards with no TTL-RS232 converter. Someone could use one of those if they wanted to do the USB thing.

Will work on the PCB layout over the next few days, hopefully be done by the time the components get here. Should be able to ship the first board to you Monday. Might be possibly to interface the Squeedo's UART directly with the NES232. That way the Squeedo would be able to load game code or whatever without having to go through the second controller port. Man, that would be cool. First NES cart to connect to an IP host and load a game on the fly.

I put a few of these 8-position terminals on the order...
http://search.digikey.com/scripts/DkSea ... =ED2606-ND
This way someone can just strip the controller wires and tighten the screws down. Like a car speaker amp. No taping or soldering; very clean and modular. This will also let us put the MAX232 and NES232 on the same board but still be separate. You'll be able to change from MAX232 to TTL by simply unscrewing the RX/TX leads and connecting another set of wires to the terminal.
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

I think there is a much faster way to load data if you're using an SNROM cart, maybe other MMC1 boards. Since the NES232 has 10 unused data pins, you could hook the 8 PortB pins to the PRG data bus and take the place of the WRAM chip. Remove/disable the WRAM chip and tie the CE & WE lines to the NES232. The beauty of this is that it could use the exact same hardware and the NES232 could use either method to communicate. Load bit-by-bit through the controller port or load a byte at a time on the PRG data bus. The cart would dictate which method to use. But instead of using 70 instructions to load a byte, you might cut it down to 1 or 2. The NES232 would detect the CE/WE signals and switch the direction of PortB based on that.

The only problem here is that I've never played around with WRAM before. Am I correct in assuming that you can read byte by using "LDA $6000" and write by using "STA $6000"? Or is there some other setup you have to do first? If it's a single statement each, then the NES would have to automatically toggle the WRAM CE in the background. The toggle would serve two purposes - tell the NES232 to activate as well as increment the buffer pointer if data is ready to be sent.

You would have to make two changes to the NES232. One, add a 12-pin header to the PCB design (8 data, 1 WE, 1CE, VCC & GND). No big deal, can by done in an hour. Two, update the firmware to accomodate communicating through PortB. Probably take an evening or so. In the end, you could either use controller port B or a jumper cable to the cart itself.
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

The parts came in Saturday, started building today. I've never actually designed a surface mount board before, so I got a bit of a crash course. The etching took a few tries, but in the end it worked. Made the mistake of not using the bottom copper, so the solder joints on this one are on top. Like I said, this is my first surface mount board. :P I'm going to get this one up and running then rework the PCB on the next board. Move the DB9 connector so it's flush with the edge and use the bottom copper for the thru-hole solder joints.

I've mounted the ATTiny2313 as well as the MAX202 and its caps. The MAX202 circuit works perfectly; tested with a WRT54G. Still need to mount the headers, flash the ATTiny2313 then mount the crystal and 22pf caps. Here is the board as it is now...

Image
hyarion
Posts: 164
Joined: Tue May 05, 2009 6:12 pm
Contact:

Post by hyarion »

it's alot easier to each a PCB if you use copper-fill/pour on the board, that way you don't need to etch away all copper between the tracks. And it's easier to solder the parts if you put the throuhole components on the other side of the PCB

do you have the schematics/pcb files available somewhere?

btw, good work :)
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

hyarion wrote:it's alot easier to each a PCB if you use copper-fill/pour on the board, that way you don't need to etch away all copper between the tracks. And it's easier to solder the parts if you put the throuhole components on the other side of the PCB
Good idea. I went ahead and flipped the DB9 header so it can be mounted from the other side. All other headers and pins can be mounted from the other side without further modification. Also moved the DB9 connector out so that it is flush with the board.
hyarion wrote:do you have the schematics/pcb files available somewhere?
Sure. If you'd like to add the copper-fill, that would be great. Here are the DSN and FPC versions of the layout. Currently unrouted since I just made the change to the DB9 header. Don't have a schematic made up of the MAX202 portion, but the schematic for the ATTiny2313 portion is on the project page. And earlier in this thread. There are a pair of 2-pin headers on the MAX202 portion. One is to jumper the MAX202 VCC pin to VCC and the other (on the right) goes to the TTL in/out pins. A header cable will attach these pins to the RX/TX holes on the 8-pin terminal. This was done so you can either disable the MAX202 or use the MAX202 for another TTL/RS232 circuit. Could have just traced them straight to the UC, but I prefer the flexibility.
http://www.chykn.com/NES232.dsn
http://www.chykn.com/NES232.fpc
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

The first board is complete and has been tested with the NES. Here are a few pics. Low res, had to use the Blackberry. Kids took my camera batteries for their Leapsters.

Top of the PCB
Image

Bottom of the PCB
Image

You'll notice a few traces on the PCB that had to be jumpered due to moving the thru-hole components to the other side. And the recessed DB-9 connector. These are corrected on the Rev 1.1 PCB. The 12-pin header can be used to reprogram the Attiny2313 via ISP. I was able to get the bootloader to talk to the PC, but haven't been able to load any code yet. So for now you can only update the firmware by using an ISP programmer. They are actually VERY easy to build. I used this one when I was starting off. It consists of (3) 220 ohm resistors, a 25-pin male connector and some wiring. Connects to an LPT port on the PC.
http://www.qsl.net/ba1fb/fbprg.gif

So, if you want one (NES232), let me know. I'll go ahead and start building a couple boards if there is some interest.
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.
I read this again and realized this could easily interface with the NES232. The SPI pins come out on the 12-pin header, so the NES232 could be reprogrammed and jumpered to the ENC28J60. This would provide the ethernet connectivity and allow the NES232 to communicate by either RS232 or SPI. The beauty of this is that this change would be transparent to the NES as well as the server. You wouldn't have to update the game or server code. If anyone has worked with this chip, please let me know. Could use some help integrating it into the design. Maybe swap an ENC28J60 based board for a NES232 if someone has a spare.
User avatar
chykn
Posts: 108
Joined: Sun Feb 21, 2010 6:06 pm

Post by chykn »

The first two Rev2 boards have been built and shipped. Here is a pic of the Rev1 board next to the two Rev2 boards in their housing. I separated the NES232 and MAX202 into two individual modules so they could be placed into the slots of a small Radio Shack project box. This also allows you to quickly swap the TTL-RS232 converter board for a TTL-USB serial cable. Having a sturdy container for shipping doesn't hurt, either.

Image

If anyone else wants one, LMK. Will build and ship one in the project box for $25; need to raise a few shekels to build more. Can include an AVR910 serial programmer for $5 if you do not have an AVR ISP programmer. A jumper cable from the MAX202 allows you to switch the serial port to either the NES232 or AVR910. The first Rev2 board above has an external programmer. The second Rev2 board has the same programmer on an internal module. If we are able to get a bootloader working, we will not need the programmer.
Post Reply