What's new

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

Joined
Jul 9, 2020
Messages
228
Likes
499
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
228
Likes
499
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
161
Likes
360
Location
Seattle W.A
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
228
Likes
499
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
228
Likes
499
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
207
Likes
235
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!
 
Joined
Jan 7, 2022
Messages
4
Likes
0
Kinda glad I'm not trying to make a portable N64, heh! (Those separated motherboards look complex as hell!) Nice work though, and on the ram/memory too! Looks like I'm buying a handful of expansion packs to cannibalize for their memory banks. Old and new style, huh? I'll tackle that aspect after finishing the overclock mod, as I don't have to alter the motherboard further. (The mod appears to only attach at the usual socket.) I'll pre-emptively cut a hole in the case to make room for the future mod. I'm aware commercial games won't use 16mb of ram, but this is for development work. Alphas and Betas that use more than 8mb, which are then optimized and reduced below that threshold.

P.S. I might even pay you for one of those expanded ram-boards if interested and it's allowed. Currently painting and prettying up the system as a Red Dev unit. The Cart is an Everdrive X7. The orange is the undercoat, and the "proper" red the currently finished overcoat. Need to get more paint.
WIN_20220107_17_13_42_Pro.jpgWIN_20220107_17_12_16_Pro.jpg
 
Last edited:
Joined
Jul 9, 2020
Messages
228
Likes
499
It looks more complicated than it actually is... the RGB board is optional. And the screen board doesn’t need to be attached either... you can use composite and skip that whole added complexity. The composite signal coming off the n64nis actually pretty good. Although the rgb amp is a definite improvement.

I sent you a PM about the request you asked about . :)
 
Joined
Jul 9, 2020
Messages
228
Likes
499
Well Folks, heres some progress after lots of space... my first n64 controller board had a few issues that made it not function. The NUS-CNT footprint was too small and i sent traces through the pads that were too small and delicate so they kind of fell apart under some soldering iron heat. Oh well... live and learn. It did look nice though! lol

I had to get un rusty with kicad. Felt nice to get this moving again...

1644620597873.png


1644620640071.png

1644620748906.png


I might end up doing another revision to make it more compact soon... but I want to test this version before moving forward. This one seems like its a bit bigger than the previous one. The last revision was also the the third i did in one week so I feel I was less rusty. This revision was a lot of remembering... so I'd bet if i did it again today it would be cleaner.

Thanks to @Gman for checking my footprint against his past work... appreciate that mate. Thanks to @Redherring32 for tips and tricks with Kicad. And thanks to @YveltalGriffin for helping proof read the PCB.

Glad to be moving forward. I've been playing my n64digital console lately and its pumping me up for having a portable (one day).

CHEERS!
 
Joined
Jul 9, 2020
Messages
228
Likes
499
The boards arrived from JLC PCB. They look really nice! I do wish that I centered the FRAM over the main chip but there will be another final revision I'm sure. Other than that I am very pleased!

IMG_8635.JPG


Did a preliminary assembly and it didnt work right off the bat... I was just using the controller test rom.

IMG_8596.JPG


I pulled off the FRAM and PIC and reflowed some of the CNT-NUS pins... I got the N64 to recognize the controller chip! Soldered in a button board and just used the C buttons as dpad for everdrive navigation. So far so good! Woo... progress. Next step, I resoldered the pic and did some programming. I accidentally transposed the 3v3 and ground pins on the pic header so i needed to just carefully wire that to my Pickit 3. Programming went pretty smoothly. Just had to do custom configuration for the pic16F15324 and make sure that the power value was 4.75 ( because i have the knock off pickit3 ). Thanks to @Gman for helping me tweak the settings to dump the hex. Oh! And he supplied me with the source code...
IMG_8636.JPG
IMG_8612.JPG


Soldered on the switch stick breakout board and connected it up. Upon plugging it in I was THRILLED to see the joystick working after all the challenges of this aspect in the past! YES! It was biased a bit towards the top of the plot... but i expected it not to be perfect as gman's code was originally intended for 3ds sliders...Since im using switch sticks I had to do some tweaking. I got the max and min analog values and with a bit of prodding and poking through the code ( and some guidance from G ), I was able to set up the SY_MIN and MAX Definitions to more accurately balance the switch stick's response.

IMG_8619.JPG


Its not perfect but its very close. I tried it out in SM64 and it felt very good there atleast. Maybe other games have different responses... The stick was pretty much showing +90 -80 on both axis so it could use slight balancing. But for now its fine! YAY! :)

Now to sort out the memory pak part of the board... it was showing up as sense but it was showing "pak abnormality" when trying to access or format the drive. I tried reflowing the fram to no avail. After checking the schema few times and consulting with @YveltalGriffin and @Gman, we discovered that I had accidentally tied 3v3 to the A15 pin mistakenly... I lifted the pin and added associated modification to correctly connect the pulldown 10k resistor. But the "abnormality" still persisted...

Mistake:
1646345500585.png



CORRECTION:
1646345426130.png


IMG_8634.JPG
IMG_8625.JPG
IMG_8626.JPG


I wondered if it was a damaged FRAM, or perhaps I misrouted the traces??? Gman recommended to reflow the pins again. Took some time to reflow the address and data pins on the CNT-NUS chip with my iron and BOOM brought the board to 100% functionality. So grateful! YES!

IMG_8630.JPG
IMG_8633.JPG


This feels great! Now I can do another revision... Im thinking of adding in the rumble circuitry and adding a switch for both of themm. IIRC, Rumble and Mempak can share the data and address lines but adding switch on the CE pin (e19) will allow the peripherals to be swapped around. Still have to do research and dev on that much... I already started reverse engineering the rumble pcb. (I didnt know what transistors so i just used random ones with the same pins for now while I was just documenting the circuit layout.)

1646345906424.png


I was also thinking of putting fram and pic on the back side for the next revision so the board will be only a bit larger than the nintendo cnt-nus chip itself...tinnnyyy

Thanks for checking out the thread folks. So relieved this part has made progress. YAY!
 

Attachments

Last edited:

Mocha

.
Joined
Mar 3, 2022
Messages
2
Likes
0
Location
Canada
This is so sick, love reading this worklog!
 
Joined
Jul 9, 2020
Messages
228
Likes
499
Sweet! So I just made a condensed revision. I put the ram chip and PIC on the back of the board and added some extra filter caps to the power rail for good measure. I did get to look at some of the design choices RDC made on his miNi64 v3 board... helpful reference :)

Definitely saved a lot of space so I couldn't use the big bear graphic.

SparkleBoard PCB.jpg
SparkleboardBackRender.jpg
SparkleBoardFrontRender.jpg


Just ordered a small run from JLCPCB so ill be assembling this version when they arrive in a week or two! :)

Hopefully I didn't make a careless mistake. Did a number of proof passes but alas, we are only human... or a bear...... ain't nothing but mammals.

Hah! Cheers! :)
 
Joined
Jul 9, 2020
Messages
228
Likes
499
Awesome! So, the most recent revision arrived from JLCPCB -- and it looks great! Saved so much space versus the last one sided board.
IMG_8732.JPG
IMG_8731.JPG


IMG_8730.jpeg


Populated the board after cleaning with IPA:

IMG_8717.JPG
IMG_8716.JPG


I tried to find a 2mhz xtal oscillator that would be more low profile but they are wayyy obsolete... Found one source but had to purchase 2000 of them.. sooo No...
Will have to live with it sticking out of the side for now.

Wired it up to test if n64 would sense the controller and alas it was discovered by the n64. Good signs all around so far... Next, i wired up the control stick, , attached the button board and programmed the pic with the same code as last time. Everything wired up!

IMG_8724.JPG
IMG_8722.JPG
IMG_8719.JPG


Plugged it in and all functions fired 100% first try! Woot!

IMG_8725.JPG


This might be the final revision pcb that goes into my portable at the end of this whole shindig. There is definitely a possibility that another set of revisions will happen that incorporate rumble pack circuitry and a switch so that its possible to swap between them in the portable. We shall see about such things.

Exciting when a thing works! Woo!

Next up is learning fusion 360 enough to model beyond a single rectangle. Excited.
 

Attachments

Top