ENIO - NES Ethernet & USB KB Adapter

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
ENIO - NES Ethernet & USB KB Adapter
by on (#95415)
As I used to hear so often in my childhood, it's time to poop or get off the pot. I'm ready to put together a few ENIO boards for those who are interested in adding ethernet/USB KB capabilities to their game. It consists of two boards. The first is the EXP adapter board which contains the 3.3v regulator and the CPLD. The second is the CPU board which contains the PIC32, USB and ethernet components. It adds a few bucks to the design, but this way it's easier to connect the ethernet/USB cables and see the ethernet lights. The CPU board could also be attached to a custom cart for those who use a toploader or NES clone.

The EXP Adapter board
The CPU board

The cost will be $50 plus shipping. This includes both boards and the 26-pin IDC cable connecting them. The first couple users will be beta testers and will need to have a Pickit3 programmer. The SD card bootloader has not been rolled into the firmware yet. The board in the picture does not have the micro SD slot, but the next couple will. As you can tell from the picture, I'm etching the boards myself right now. I'll have a batch fabbed after getting input from the beta testers.

If anyone is interested in paying to be a guinea pig, let me know so I can get the necessary parts on the next Digikey order.

Thanks!

by on (#95436)
Nice work!

I'd like to pick one up from you. I'm not much of a pic guy so I have to ask, why won't my pickit2 work for programming it?

How soon do you plan to implement the sd card bootloader? I'd like to avoid buying a pickit3 if I can, not a deal breaker just preferred.

I know you've covered somethings in other posts and such but will you provide schematics and such for aid in interfacing and such? Also what's it's current state of operation? Any sort of demo or anything that can be run currently assuming the user has a devcart? Also curious what code you'll be sharing (nes, firmware, etc).

EDIT: also curious what the EXP connector looks like.

by on (#95437)
Super, SUPER awesome. :D

by on (#95441)
Thanks guys! Let's see...

Bootloader - I'll try to get the SD bootloader done in the next two weeks. That would be enough time to get the next batch of parts in and build another couple boards. I say the Pickit3 because the Pickit2 does not support the PIC32 chips. But hopefully I'll get the bootloader working and it will be a moot point.

Schematics - Not sure about the schematics, but I'lll definitely provide a pinout of the connectors, description of the signals and a general diagram showing the functions of each piece. I could see someone using the EXP Adapter to interface the NES with their own device. Or use the CPU board to give network capabilities to another legacy system.

Operation & Code - Right now there is a basic command set that the cart can use to tell the ENIO to open up a channel to an IP host. It's barebones but functional. You specify the IP to connect to, TCP or UDP, the port number and the virtual channel ID you want to give the connection. I'll provide the command set as well as ASM usage examples. The command set will be refined as beta testers provide feedback.

Demo - The demo I came up with is a guy walking around the DW1 overworld. Which is trivial except for the fact that the map data is not stored on the cart. It's streamed from a map server on a Linux box as the player walks around. Player moves up, map server sends another row of map tiles. Someone mentioned making a Google Maps 8-bit edition and I thought "what a waste of time!" Then I saw the Google April Fools joke they were referring to and started wondering if they had an ASCII rendering API I could integrate into the map server. :)

Connector - The EXP connector itself is the exact same as the one I used on earlier boards. I received a package yesterday with enough parts to make at least another 100 EXP connectors, so no worries there.
Early ENIO Board - Bottom

by on (#95490)
Alright well if you can count me in. I'm more than willing to do some beta testing and look forward to it. Fair warning though, I'm no guru when it comes to networking. I know the difference between TCP/UDP and what ports are and such but don't have enough experience to be too savvy with it. Perhaps that's a good thing though, I can follow directions and provide somewhat novice problems/feedback from a networking perspective.

by on (#95491)
I am REALLY happy to see this project revived.

So how would the adapter work with a game programmed to interface with it? (Sorry for the basic question, but I don't quite understand how it works.)

by on (#95499)
Good question. Think of the ENIO as broker. It does all the heavy lifting as far as IP communications and USB input. The NES simply tells it where to connect and how to connect to it. The NES talks directly to the ENIO over a command channel, VCID x01. USB KB data is input from VCID x02. IP sessions are dynamically assigned x10 and above. These numbers are subject to change, but the idea will stay the same.

A sample session goes like this...

Code:
--- Session Startup ---
NES -> ENIO (VCID x01) HELLO
ENIO -> NES (VCID x01) HELLO

--- Check for valid DHCP or Static IP ---
NES -> ENIO (VCID x01) Have an IP?
ENIO -> NES (VCID x01) YES/NO

--- If we have a valid IP, let's connect to a server ---
NES -> ENIO (VCID x01) Connect to 192.168.1.10 on TCP port 10101
ENIO -> NES (VCID x01) Established, use VCID x10
NES -> ENIO (VCID x01) Switch input to VCID x10

--- NES sends data to server and gets reply ---
NES -> ENIO (VCID x10) <some data to server>
ENIO -> NES (VCID x10) <reply from server>

--- NES tells ENIO to close IP session  ---
NES -> ENIO (VCID x01) Close session on channel x10

--- Input some data from the keyboard ---
NES -> ENIO (VCID x01) Switch input to VCID x02
ENIO -> NES (VCID x02) 'A'   <-- User pressed 'A' last


This is a simplified version of course, but it should give you an idea of what a conversation between the NES and ENIO looks like.

by on (#95501)
Any docs on the NES <-> ENIO communication protocol itself, aside from the simplified version? I'm looking for register interface details, packet formulation for things like src/dst IP address, IP vs. ICMP, IP protocol (TCP or UDP), port numbers, etc... :-)

by on (#95566)
Right now everything is in an Excel spreadsheet, but I'll put it up on a wiki before I send out any boards. I had it in Mediawiki on my site at one point but it got so much spam I took it down. Have to work on those security settings.

by on (#95567)
chykn wrote:
I had it in Mediawiki on my site at one point but it got so much spam I took it down. Have to work on those security settings.

These steps have ended up working for preventing spam on my own wiki:
  • Leave talk pages open to anons and new users, but require e-mail confirmation or autoconfirmed (two edits and four days) to edit pages in non-talk namespaces.
  • Use the QuestyCaptcha plug-in for ConfirmEdit and come up with questions that are relevant to the subject matter of your wiki. QuestyCaptcha has been far more effective for me than Google reCAPTCHA was.
  • Make Talk:Main Page a soft redirect to some other talk page and protect it.
  • Optionally, if you know regex, install AntiSpoof and AbuseFilter for any spam that makes it past these measures.

If you need help with setting them up in your LocalSettings.php, PM me or start a topic in General Stuff.

by on (#95632)
tepples wrote:
These steps have ended up working for preventing spam on my own wiki:

Thanks a bunch for the advice. I tightened things up a bit and re-enabled the site. I'll send you my settings file if I run into any more issues.

koitsu wrote:
Any docs on the NES <-> ENIO communication protocol itself, aside from the simplified version?

This should get things started. I updated the basic project info and added more details on the CGP protocol. Still need to put up a section on buffering, though. Look for the CGP link at the bottom of the ENIO wiki...
http://enio.chykn.com

I etched and assembled another set of boards yesterday. The new CPU board has the MicroSD slot to test the bootloader. Will be working on getting that rolled into the firmware this week. A pic of the new CPU board is on the wiki under "ENIO CPU Board".
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98616)
Posted a video on Youtube giving an initial look at the production EXP and CPU boards. Will try to post another in the next week or so with a more detailed look at the CPU board. Mostly information that's already on the project page, but presented with a twinge of southern drawl.

http://www.youtube.com/watch?v=KBSdktDG_tk
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98618)
very NICE!

The cases and everything looks really good, I wasn't expecting that much polish originally. Good luck with the final touches!
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98620)
Awesome work. Can't wait to see software up and running.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98658)
The SD bootloader is now functioning. Still need to update the code to rename or remove the image.hex file after flashing. But, I was able to flash a fresh board with the bootloader, put in the MicroSD card with the image.hex file and within a few seconds the CPU board was up and running. Will add the cleanup code and test it out some more tomorrow. For those who wanted one of the first couple, I should be able to have them in the mail Tuesday.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98661)
I want it all! I wrote you some weeks ago, but I didn't get an answer.
I'm not a developer or anything, but I want to be the first who can test new releases based upon this nifty thing :D
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98687)
Could you allow the USB keyboard connection to be translated signals to Famicom keyboard signals?

Also, I don't really like SD and think CompactFlash is better. Could there be a version with CompactFlash?

With internet connection, perhaps we can even try to make a gopher client and other stuff. The documentation doesn't seems to work with IPv6 so could they be added (in addition to the IPv4 it has)?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98692)
zzo38 wrote:
Also, I don't really like SD and think CompactFlash is better. Could there be a version with CompactFlash?

You really expect him to make a CompactFlash version just because you "don't like" SD?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98696)
zzo38 wrote:
Could you allow the USB keyboard connection to be translated signals to Famicom keyboard signals?

Also, I don't really like SD and think CompactFlash is better. Could there be a version with CompactFlash?

With internet connection, perhaps we can even try to make a gopher client and other stuff. The documentation doesn't seems to work with IPv6 so could they be added (in addition to the IPv4 it has)?


Emulating the Famicom keyboard would be possible, but a bit tricky. The problem is that it behaves similar to a controller - send a signal to latch the status of all keyboard keys at once. On the other hand, the USB keyboard reading routine outputs data in ASCII. That output would need to be mapped to a 9 byte array in the CPLD that would mimic the Famicom keyboard input. Also, implementing this would prevent the use of compatibility mode reads. You would have to have a cart capable of sending R/W and /CE signals down EXP7 and EXP8 in order to talk to the ethernet adapter. Then again, it may be better off going that route anyway. Good news is that the CPLD can be updated by the user.

No, unfortunately a CF card will not physically fit in the design. The CPU board is designed to fit in a Hammond 1593K enclosure, available at Mouser for ~$3. Plus the SD card is cheaper. The CPU board will not cost more than $60, so I have to keep costs down where possible.

If someone wants to add a gopher client, implement IPv6 support or use it to attach their NES to a potato gun, more power to them. I'm a network architect during the day and my wife and I have 5 kids, a dog and a guinea pig to take care of in the evening. What little time I do have is spent on implementing the necessary functions to make this thing work. The release version of the firmware will support IPv4 and include the functions necessary for the NES to interact with IP hosts as well as the USB keyboard and SD card. Not trying to sound like a jerk or anything; I just have to stay focused on the requirements to get it finished in a timely manner. Otherwise it will never get done.

That being said, yes, I do plan on releasing the PIC32 and CPLD source code when it's ready. I imagine there are a number of people with the time and development skills necessary to turn this into something better. Also, I think it would be very poor form to keep it closed. I may be the one who took the time to design and build it, but I certainly could not have done it without the technical knowledge and ideas provided by the Nesdev community.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98708)
chykn wrote:
Emulating the Famicom keyboard would be possible, but a bit tricky. The problem is that it behaves similar to a controller - send a signal to latch the status of all keyboard keys at once. On the other hand, the USB keyboard reading routine outputs data in ASCII. That output would need to be mapped to a 9 byte array in the CPLD that would mimic the Famicom keyboard input. Also, implementing this would prevent the use of compatibility mode reads. You would have to have a cart capable of sending R/W and /CE signals down EXP7 and EXP8 in order to talk to the ethernet adapter. Then again, it may be better off going that route anyway. Good news is that the CPLD can be updated by the user.
There could also be a physical switch to select the mode if that would help.

Quote:
No, unfortunately a CF card will not physically fit in the design. The CPU board is designed to fit in a Hammond 1593K enclosure, available at Mouser for ~$3. Plus the SD card is cheaper. The CPU board will not cost more than $60, so I have to keep costs down where possible.
I just think microSD card is too small and CompactFlash is a far superior design, but OK use SD if you want to and if you have to.

Quote:
If someone wants to add a gopher client, implement IPv6 support or use it to attach their NES to a potato gun, more power to them. I'm a network architect during the day and my wife and I have 5 kids, a dog and a guinea pig to take care of in the evening. What little time I do have is spent on implementing the necessary functions to make this thing work. The release version of the firmware will support IPv4 and include the functions necessary for the NES to interact with IP hosts as well as the USB keyboard and SD card. Not trying to sound like a jerk or anything; I just have to stay focused on the requirements to get it finished in a timely manner. Otherwise it will never get done.

That being said, yes, I do plan on releasing the PIC32 and CPLD source code when it's ready. I imagine there are a number of people with the time and development skills necessary to turn this into something better. Also, I think it would be very poor form to keep it closed. I may be the one who took the time to design and build it, but I certainly could not have done it without the technical knowledge and ideas provided by the Nesdev community.
Well, yes if I buy it I can implement some things myself.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98710)
zzo38 wrote:
I just think microSD card is too small and CompactFlash is a far superior design, but OK use SD if you want to and if you have to.

"You got your peanut butter in my chocolate!"
"You got your chocolate in my peanut butter!"

Well, you got your SD in my CF. Consider this a microSD card carrying case that doubles as an adapter to let you use the CF writer you already have.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#98721)
woowww.... i dream with this project!!!

imagine all the new famiclones with this hardware..... a new world to the nes/famicom!!!
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#99740)
I think ENIO could potentially also be the answer to running the JF + D7756C carts ( viewtopic.php?f=9&t=9323 ) without storing the ADPCM samples in RAM or ROM. Currently there are no hardware flash carts that fully support any of these games.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#99744)
Can it be used with 60-pins cartridges as well as 72-pins cartridges? Also, if it is simpler to do so, disable the ethernet when Famicom keyboard mode is selected (so that the ethernet can only be used with ASCII keyboard mode). It could be selected by keys on the keyboard (such as scroll lock key and light, since they have nothing to do with ASCII), by a physical switch, by protocol detection, by using some command which the NES/Famicom must send to enable ASCII mode (so that Famicom mode is the default), or if it is possible to support both protocols simultaneously, whichever work better. Ensure that if Famicom keyboard emulation is used, all of the Famicom's keys are mapped whether or not you have Japanese keyboard layout on the USB keyboard.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100132)
:?: Could you tell me what all the capabilities of this are? P.S. great idia. :mrgreen:
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100218)
what does this do other than allow you to use famicom expansion items?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100223)
Nes Kid wrote:
what does this do other than allow you to use famicom expansion items?


It allows you to connect your NES to the Internet.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100224)
infiniteneslives wrote:
It allows you to connect your NES to the Internet.

PRON?!
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100226)
You don't need the Internet for NES pr0nz.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100282)
:? Yes but what can you do? can you surf the web in 8 electrical paths in binary (8-bit)
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100284)
Nes Kid wrote:
:? Yes but what can you do? can you surf the web in 8 electrical paths in binary (8-bit)


Yep, you can use google maps in 8bit like this:

Image
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100286)
Nes Kid wrote:
:? Yes but what can you do? can you surf the web in 8 electrical paths in binary (8-bit)
Maybe you can; I don't know. But probably one of the simplest things to make with it would be a gopher client. Perhaps other things too, such as internet chess, IRC, etc.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100296)
Nes Kid wrote:
:? Yes but what can you do? can you surf the web in 8 electrical paths in binary (8-bit)


You and the NES are the only limits as to what you can do with this thing really. The ENIO is really only handling the net communications for you. It's up to you the developer to make something awesome with it. The other choice is wait around for someone else to develop something.

I guess it depends on the person but I don't really see the point try and surf the net or chat on the NES aside from novelty. Things I think would be cool is playing against each other on the net. Something like a simultaneous coop might be hard to do live, but most multiplayer NES games are turn based which could be easily supported. I think it'd also be cool to just have a nesdev score board or something of the likes. After publishing coding compo carts we could then have a playing compo, or bragging rights for high score and such ;)

If it were paired with a standardized flash cart we could have a library of homebrews that could be downloaded directly to the NES. Although that would be more of a novelty I guess...
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100329)
:mrgreen: I can't wait to get myself one! If the cpu board is already available, I would like to know how I get it.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100824)
:? Do you need a power pack to play games with each other? :?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100879)
Nes Kid wrote:
:? Do you need a power pack to play games with each other? :?


Depends on how said game is released. The power pak or any basic flash/dev cart is certainly an option. It'd also be possible to publish a cart. Those decisions are all really up to the author of the game. Hopefully if it's meant to be for the community as some competition all those possibilities will be included.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100890)
infiniteneslives wrote:
I guess it depends on the person but I don't really see the point try and surf the net or chat on the NES aside from novelty.


The novelty of doing things on an NES is what brings us together here, after all. Isn't it? I don't think I'd really be interested in doing online stuff on my NES, but I'm sure it would be fun for somebody. Also if we could get an ENIO emulation going in an internet-capable emulator, we might be able to get a lot more people online to try.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100893)
In my opinion, ENIO would need a kick-ass flag-ship project to promote it. Something that would make even non-coder want one...
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#100895)
rainwarrior wrote:
The novelty of doing things on an NES is what brings us together here, after all. Isn't it?

Yeah as I rambled I kinda realized I was merely weighing one novel thing against another ;)

I think chykn had already prepared emulator support which would help combat the issue you bring up SkinnyV, getting em in the hands of a non-dev'r is going to be tough. The possibility of giving people a taste of the ENIO without buying one. While a flag-ship project would definitely help I think something possibly more achievable is integrating it into a compo. Sort of a few small things by a group of us to get the ball rolling. Even if we made up a simple way for a developer to simply communicate the high score/fastest time so the ENIO wasn't the entire focus of the compo. Just make is a side option then have ENIO's as prizes or something for both the developer and high scoring gamer. Not sure how well we could keep people from cheating though with emu support... Guess we'd have to be on the honor system ;)
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#101051)
:wink: I guess it would be all of us on ENIO, that seems cool infin and skin and all of us :)
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#101682)
A few updates...

1. After reading some of the comments, I went back and restructured the code in a more modular fashion. I split all the ENIO specific functions into their own files, ENIO.c & ENIO.h. As promised, these will be open source. My original implementation of the ENIO code in FCEUX was utter crap. This one is a bit cleaner and will hopefully be easier to roll into the emulators.

2. I owe an apology to those who already have the CPU boards and have patiently been waiting for code updates and the most recent version of the CGP protocol. I will try to have those provided this week.

3. I received a full panel of (30) CPU board PCB's tonight. Assembled and tested one, everything checked out.
Image

4. Once I provide the aforementioned code updates and documentation, I'll start building more CPU boards. My goal is to have (10) built in the next week. As they are finished they will be offered to those who already purchased EXP boards. I said before that I would not charge more than $60 for the CPU board and that anyone who purchased both EXP & CPU board would get $10 off the pair. So if you already have an EXP board, the CPU board will be $50 + $5 shipping within the US.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#101746)
chykn wrote:
A few updates...

1. After reading some of the comments, I went back and restructured the code in a more modular fashion. I split all the ENIO specific functions into their own files, ENIO.c & ENIO.h. As promised, these will be open source. My original implementation of the ENIO code in FCEUX was utter crap. This one is a bit cleaner and will hopefully be easier to roll into the emulators.

2. I owe an apology to those who already have the CPU boards and have patiently been waiting for code updates and the most recent version of the CGP protocol. I will try to have those provided this week.

3. I received a full panel of (30) CPU board PCB's tonight. Assembled and tested one, everything checked out.
Image

4. Once I provide the aforementioned code updates and documentation, I'll start building more CPU boards. My goal is to have (10) built in the next week. As they are finished they will be offered to those who already purchased EXP boards. I said before that I would not charge more than $60 for the CPU board and that anyone who purchased both EXP & CPU board would get $10 off the pair. So if you already have an EXP board, the CPU board will be $50 + $5 shipping within the US.
I am proud of you.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#101747)
Chykn, please update your status report on enio wiki. Thank you. :mrgreen:
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#101748)
Say,would ENIO be able to connect from Japan? :?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#102021)
So when can we expect to see some sort of software demo for the CGP/ networking portion of the ENIO?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#102451)
8-) i purchased my exp on ebay, so how can I get my cpu.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#102665)
Looking forward to an email from you when I can buy mine. EXP board is first rate quality.
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#107657)
What's the latest? I'm dying to get more info!
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#125866)
Me 2 - where are the news?
Re: ENIO - NES Ethernet & USB KB Adapter
by on (#142489)
So this has been dead for more than a year now... Anybody hear anything? Is Chykn OK?