Worklog SparkleBear's First Portable Nintendo 64 Build Project Worklog.

Joined
Jul 9, 2020
Messages
76
Likes
204
It's been a few weeks since I posted in the work log... I've put alot of hours into the project with out a ton to show for it... Worked on prototyping a controller on a proto board so I could start to understand how these chips interact. Studied up on the guide hub post on controller chip pinout. Desoldered and wired up some buttons... Gman said its better to keep it on the board and trim around it so took the advice and trimmed controller board around chip while keeping the oscillator.

IMG_7441.JPG
IMG_7442.JPG

IMG_7450 2.JPG
IMG_7461.JPG



It was more of a proof of concept to myself, I knew that this was not going to be the solution that would go into the portable. Still it was a good exercise to understand the fundamentals of the controller. Integrating this NUS-CNT into a custom PCB would be the end goal, even though I was still open to finding an existing community pcb to use in the portable.

Still needed a MCU solution for the joystick conversion. In my very first conversation with @YveltalGriffin, he shared with me about an attiny24 centered analog joystick to n64 encoder signal converter (https://nfggames.com/forum2/index.php?topic=5803.0). Griff told me that I could program this project with an Arduino UNO, ordered that on amazon. I tried sending an email to purchase boards from the man on NFGGames forum, but no response for weeks. Took the gerber files to JLCPCB and had a small run printed and shipped. Luckly, the day I started investigating controller boards, this PCB showed up in the mail. I went down that rabbit hole for quite a while...

I built the board pretty quickly, although none of the analog sticks fit the footprint.. I had to finagle it in there with some bent pins at an angle... but electrically it was sound.
IMG_7451.JPG
IMG_7457.JPG


I spent the better part of two days trying to figure out how to flash the MCU. What a freaking journey. I used Arduino IDE with the Ardiuno UNO over usb to program the ATTINY24 (eventually). First step was to program the arduino to be an Arduino as ISP; load up the example template called ArduinoISP. Make sure arduino uno is selected as the device and also confirm the port is properly selected for the COM port. Verify, compile, and flash to UNO with ArduinoISP.

I had to build a header cable to connect the arduino to the attiny. The board had 6pin ICSP header but Griff recommended that I dont use the icsp on the arduino but rather the pins 10-13 on the long arduino header. Since this was the new way, i needed to go into the arduino code and activate this style wiring.

if you scroll down the programming text you will find:
// #define USE_OLD_STYLE_WIRING
If you delete the slashes it will use old style wiring...

Now that the arduino is programmed, I can wire up the header pins to the ICSP. It is also important to note that if you do not put a capacitor between reset pin and ground, the arduino won't be able to program the Attiny24 for some reason i dont quite understand. Basically, there is a condition that the MCU and arduino reach that would trigger the arduino to reset when we don't want it to... Thats why we need the cap. Here is the documentation from Arduini IDE program:

pins MOSI, MISO and SCK are the same pins as
// digital pin 11, 12 and 13, respectively.

Pin 10 is the reset pin for the attiny. NOT the reset pin for arduino. I made a mistake at first and wired a cap between pin 5 and 6 on the ICSP header. But infact it should be as pictured below. With negative leg in ground and other leg in the reset pin on the long header beside the arduino IC.

1633320980692.png
IMG_7456.JPG


First we need to burn the bootloader onto the attiny24. I needed to download a bunch of files for AVR and attiny chips... and change the fuse values on board.txt. to 0x42 for the low fuse, and 0xdf for the high fuse. Select the chip from IDE's "Tools" menu, set processor speed to 1MHz, select port the same as before, select programmer as "Arduino as ISP", then "hit burn bootloader". This took me a few trys to get this far...

After that being a success, I had to flash the hex and eep files... THIS part took me days. Long story short, I had to use my windows 10 virtual machine. find the AVRDUDE directory in my program files. Put a copy of avrdude.conf in the folder too. I put the hex and eep into that same folder (you can also copy all these 4 files to their own folder too). I entered the command line and navigated to the folder where these 4 files are in; AVRDUDE.exe, avrdude.conf, Joystick.hex, joystick.eep. **joystick.hex and joystick.eep is the name of whatever you rename your hex file**

avrdude -P com3 -b 19200 -c avrisp -p attiny24 -v -e -U lfuse:w:0x42:m -U hfuse:w:0xDF:m -U eeprom:w:joystick.eep -U flash:w:joystick.hex -v

This defines the port as COM3, sets baud rate at 19200bps, config as avrisp, target device as attiny24 verifies all that, erases chip, sets low/high fuse, writes 6 bytes to eeprom, flashes 1067 (or so) bytes to chip's program memory.

After what finally showed as a "successful" programming of the chip, the board would not for the life of me (or itself) register to the NUS-CNT controller chip. I made sure that worked with an official joystick. I flashed and flashed and reflashed and changed chips to start over.... Nothing would make it work. I know i was successfully programming the ATTINY24 because I extracted the hex for blink from the temporary files and used it in the same manor and method. I got the attiny to run the blink program.

I even got the gamecube style joystick from the local retro store to do more research. Turns out, as @Gman informed me, these joysticks are a cheap knock off of the open source attiny project that I was working with. I tried swapping that chip in too... nothing there either.

IMG_7460.JPG

I tried everything to get that thing to work to no avail... So I let it rest for a while.

Thanks to @YveltalGriffin, for helping me get started with the ATTINY programming while he was packing up to move to his new jobby job in a far away land. Thanks buddy!

Thanks to @Gman for the humor and guidance with the mcu programming :)

Thanks to @Shank for encouragement and kinship in the headache of programming attiny. Sorry it took you through so much headache bud.



_______________________________________________________

I met @printsmith3d, through his worklog of an amazingly cool n64 portable he has been working on... said he had lost the eagle files he had designed but he was kind enough to share the oshpark board file links with me. Got a couple of those printed for further research... perhaps this would be a solution. He used the same attiny project with the code tweaked a bit for switch joysticks.

IMG_7685.JPG
IMG_7687.JPG


I had a much easier time programming the MCU this time around. But still it would not register a joystick. :(
I finally tried his code with a switch joystick and actually got it to recognize it for a moment there but it was all biased incorrectly and needed a calibration. This felt like a small victory... SOMETHING was happening even though it was not quite right. I wired up the switch micro had designed for calibration but at that point no response from joystick again ;\ UGH!

IMG_7700.JPG


Something has to give...
 

Attachments

Last edited:
Joined
Jul 9, 2020
Messages
76
Likes
204
At this point two different designs around the same chip just didn't work for me no matter how many things I tried. A few weeks earlier, Gman generously shared the code he wrote for a PIC16F MCU. I now have decided to design my own PCB that suits my needs and I can troubleshoot from the ground up.

A few design goals for the pcb:
- Integrate 64 pin NUS-CNT oem controller chip
- FRAM FM28V202 non-volitile memory for integrated control pak
- house pic16f15324 chip for analog stick > n64 encoder signal converter, and 5 pin programming header.
- pads for switching E19 between FRAM and trimmed rumblepak board. (maybe even reverse engineer rumble pak circuit and integrate into PCB
-Space efficient two sided board. NUS CNT on front with button connector pads, fram and mcu on back.


Last night, i started learning the ways of kicad. Thanks to @Ethan and @Gman for their tips and guidance in the early stages of this kicad journey. I made custom symbols for the NUS-CNT and FRAM. I also imported the symbol and footprint for the pic16f15324... I have gotten as far as designing the beginning of the schematic. It feels really good to start to learn something new. It feels very productive and a good use of time...

Used the guidehub's NUS-CNT page and a control pak pinout i found too. (http://www.qwertymodo.com/hardware-projects/n64/nonvolatile-nintendo-64-controller-pak). Using his pinout i was able to more deeply understand the integration of the FRAM chip.

Thanks to @Luis Mendonça for sharing his FM20V202 and NUS-CNT footprints with me :)

1633323737432.png


I've been talking with @Downing about reverse engineering RDC's old mini64 board to glean some of the custom configs he had with his chip too... perhaps a new board like this can be designed with the amalgamation of all the best ideas from the past.
RDC front.jpg
RDC back.jpg

Looks like there are some things on that board that I am very curious about. What is q2 doing on that rail with the FRAM? How to use jumper pads to get other configurations on the board so it can be useful for more people down the road... What are all the extra components?

I did not design in the CE line switcher for changing from rumble to memory. As far as I understand, @Gman said all of the rumble and fram pins can be wired together to the same pins on the NUS-CNT except for pin e19 which will be the switched pin. I will use a DPST switch with the common going to the NUS-CNT e19 and each pole going to CE on Rumble and FRAM respectively. In theory this should work but i have not tested it yet. I purchased a few rumble paks on ebay to test this out soon. But I have still to get FRAM connected to the system... once this happens i will be able to test a switching system. :)

I am excited to be on this journey right now, designing an awesome pcb for my project and hopefully for the community at large.
 
Last edited:

Pacal

.
Joined
Jul 30, 2016
Messages
138
Likes
260
Portables
RDP 64
i been working in a N64P too and im having problems with the controller too, i want to use a Nintendo switch joystick and i tried to program the attiny24 chip too but like yourself i have not been able to do it too.

A few years ago a bought 4 of those mini64 from downing it was the v2.1 but this one doesn't have the FRAM on the back but they do work good, im going to design the Pcb for my controller so i was thinking to remove the Nus, the microchip and some of the other components that i need to make it work and put them all into the Pcb, but im afraid that if i do that i may end up destroying the mini64 board.
i been thinking to use one of those cheap GameCube style controller too, its a little different from the one you have, you know just remove everything design the pcb put everything and use like that, if i can`t find a way to use the other joystick before i finish designing the case and the pcb controller im going to use this cheap joystick.
im going to wait a little longer to post a worklog, im half way from this project.
i cant way to see more of your awesome project, Good luck.
 
Joined
Jul 9, 2020
Messages
76
Likes
204
Almost done with the first revision of my controller board. Learning kicad is a fun process...

1633975916939.png

Way cleaner than the first version I did earlier in the day:
1633975994359.png


I am still figuring out how I am supposed to connect the E14 detect pin works in the circuit... so I don't think it will work quite yet. Gonna get an OEM control pak to do some research. Also, this revision does not have the rumble pak switcher implemented yet. But I do have a couple of rumble paks that I will probe around with to understand the connections...

Bit by bit. :)

After looking at the second version of the layout, G suggested i keep all the components on one side... Maybe rev 3 will explore that :)

Thanks to @Ethan, @Gman, @Redherring32 and @YveltalGriffin for guidance with the schematic and PCB stuff. New skills are fun, appreciate the support. :)
 
Joined
Jul 9, 2020
Messages
76
Likes
204
Just uploaded gerbers to JLCPCB! Woot! Thanks to @Redherring32, @YveltalGriffin and @Gman, for looking over my schematics and board layouts. Super appreciate it fellas...

Spent a bunch of time with Griff working on the trace entry angles at the pads -- as well as organizing the decoupling caps more concisely. Also learned about stitching the ground planes together with vias. Lots of little upgrades...

Discovered how to make vector art to import into KICAD...
1634196738401.png
1634196783209.png
1634196760803.png


Griff said he likes to make the stitching vias spread out like a constellation... i took it literally :P

I really like how this looks in the previews. I hope it is electrically correct!! Ill know in a week or so :) Last time the boards came very fast...

We shall see...
 
Joined
Apr 12, 2020
Messages
164
Likes
152
Just uploaded gerbers to JLCPCB! Woot! Thanks to @Redherring32, @YveltalGriffin and @Gman, for looking over my schematics and board layouts. Super appreciate it fellas...

Spent a bunch of time with Griff working on the trace entry angles at the pads -- as well as organizing the decoupling caps more concisely. Also learned about stitching the ground planes together with vias. Lots of little upgrades...

Discovered how to make vector art to import into KICAD...
View attachment 19400View attachment 19402View attachment 19401

Griff said he likes to make the stitching vias spread out like a constellation... i took it literally :P

I really like how this looks in the previews. I hope it is electrically correct!! Ill know in a week or so :) Last time the boards came very fast...

We shall see...
THIS IS SICK! Great job brother!
 
Top