• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Converting 5v to 3.3v and vice-versa

Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Hi guys.

You might have seen a few posts recently of me building a NES Box with a Raspberry PI.

Well im nearly finished but i need a little help from your generous selves with regards to wiring the original controllers.

I'm using a driver called SnesDev to map the controller buttons to keyboard keys for use with emulators but that's not really important.

The original controllers run on 5v, whilst the rpi GPIO pins can only handle up-to 3.3v.

So my question what is the best method to convert these voltages.

The NES controller requires power, ground, data output, clock and latch pins from the rpi.

Now the fun bit. There are apparently three types of controllers.

  1. Some NES controllers will be fully functional at 3.3v across the board.
  2. Some require 5v input but will run on 3.3v for the latch and clock pin meaning the output data pin will have to be converted down to 3.3v
  3. The last sort require 5v across the board. Meaning the data out pin will have to be converted from 5v to 3.3v but also the 3.3v clock and latch pins will have to be converted up to 5v for the controller to work with them.
Now my controller falls into category 2. When running of 3.3v nothing would work. I briefly connected it to the 5v instead and everything fired into life. However i don't want to run it like this without bringing the data pin down to 3.3v for fear of damaging my rpi.

So what options do i have to bring the 5v data out pin down to 3.3v? Also im toying with the idea of just upping the clock and latch to 5v if not too costly so i don't need to worry when getting a second controller for player two.

So yea hope all of that makes sense. I will also post up a project log, this time once its finished. Ive learnt my lesson posting logs in progress as i very rarely finish my projects before moving onto the next.
 
Joined
Apr 16, 2011
Messages
719 (0.15/day)
Location
coventry UK
System Name Gwafwar
Processor Ryzen 5 3600
Motherboard Msi MPG X570 Gaming Plus
Memory 16Gb Adata Spectrix 3600 Cl18
Video Card(s) Palit GTX970 SLI
Storage Adata 512Gb SX8200 pro
Display(s) 3x 27" 1080p Lg's
Case Coolermaster 690 II pure black
Audio Device(s) onboard
Power Supply Coolermaster 750W Masterwatt
Mouse Saitek X65-f HOTAS
Software Win10 Pro
Can't you just power it via USB? Since the VDD and the GND are not signal carriers.

The you should be able to cut R1 R2's feed and use a 3.3V feed from the same port. Failing that you could divide the potential at R1 R2 with a second set of resistors in parallel to ground.

 
Last edited:

eidairaman1

The Exiled Airman
Joined
Jul 2, 2007
Messages
40,435 (6.61/day)
Location
Republic of Texas (True Patriot)
System Name PCGOD
Processor AMD FX 8350@ 5.0GHz
Motherboard Asus TUF 990FX Sabertooth R2 2901 Bios
Cooling Scythe Ashura, 2×BitFenix 230mm Spectre Pro LED (Blue,Green), 2x BitFenix 140mm Spectre Pro LED
Memory 16 GB Gskill Ripjaws X 2133 (2400 OC, 10-10-12-20-20, 1T, 1.65V)
Video Card(s) AMD Radeon 290 Sapphire Vapor-X
Storage Samsung 840 Pro 256GB, WD Velociraptor 1TB
Display(s) NEC Multisync LCD 1700V (Display Port Adapter)
Case AeroCool Xpredator Evil Blue Edition
Audio Device(s) Creative Labs Sound Blaster ZxR
Power Supply Seasonic 1250 XM2 Series (XP3)
Mouse Roccat Kone XTD
Keyboard Roccat Ryos MK Pro
Software Windows 7 Pro 64
Need a resistor adapter board
 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Well that was my original idea but then i read on another forum that powering it from 5v means the Data out will be at 5v which the rpi cant handle. Is that not the case?
 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Need a resistor adapter board

Resistor Adaptor Board? Do you just like a voltage divider or zener diode? Not 100% clued up on how they work but its what google has thrown up. However im a little concerned from @Iceni post. Don't these methods rely on a known input voltage? If the Controller does output 3.3v and not 5v then they will cause issues right? Need to buy a multi-meter and have a test i think.
 
Joined
Nov 10, 2006
Messages
4,665 (0.73/day)
Location
Washington, US
System Name Rainbow
Processor Intel Core i7 8700k
Motherboard MSI MPG Z390M GAMING EDGE AC
Cooling Corsair H115i, 2x Noctua NF-A14 industrialPPC-3000 PWM
Memory G. Skill TridentZ RGB 4x8GB (F4-3600C16Q-32GTZR)
Video Card(s) ZOTAC GeForce RTX 3090 Trinity
Storage 2x Samsung 950 Pro 256GB | 2xHGST Deskstar 4TB 7.2K
Display(s) Samsung C27HG70
Case Xigmatek Aquila
Power Supply Seasonic 760W SS-760XP
Mouse Razer Deathadder 2013
Keyboard Corsair Vengeance K95
Software Windows 10 Pro
Benchmark Scores 4 trillion points in GmailMark, over 144 FPS 2K Facebook Scrolling (Extreme Quality preset)
How important is it to you that you stick with genuine NES controllers?

 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
How important is it to you that you stick with genuine NES controllers?


That's what ive used in the past and whilst it worked, it doesn't look right, and doesn't feel as good to use as the original. Plus i now own the original :)

Well i got my self a multimeter (Thanks to some left over Christmas vouchers :) ) And when fed with 5v the data out is at 5v. But stangly the clock and latch from the rpi are also at 5v? Nowhere in the retropie forums or tutorials has this been mentioned. I thought the clock and latch was sent by the pi so it controlled its voltage? However when running the controller of 5v everything (data, clock, latch) is at 5v, when running of 3.3v everything is at 3.3v. Im a little confused.

Does this mean to run the controller on 5v which it needs im going to have to limit the data out to 3.3v? Shouldn't be hard with a voltage divider (According to Google.) But also use some form of level shifter for the clock and latch so the pi isnt being forced to output 5v on these when it should only run 3.3v?
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
26,956 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
Have you tried with a 7805 voltage regulator and something like a LD1117V33 for 3.3 V ?

You should be fine without the glue components (capacitors/resistors), just the regulator alone should work for that purpose.

Edit: Misread your original post, those regulators won't work to change logic signals, but they might still be useful to you.
 

Frick

Fishfaced Nincompoop
Joined
Feb 27, 2006
Messages
18,914 (2.86/day)
Location
Piteå
System Name Black MC in Tokyo
Processor Ryzen 5 5600
Motherboard Asrock B450M-HDV
Cooling Be Quiet! Pure Rock 2
Memory 2 x 16GB Kingston Fury 3400mhz
Video Card(s) XFX 6950XT Speedster MERC 319
Storage Kingston A400 240GB | WD Black SN750 2TB |WD Blue 1TB x 2 | Toshiba P300 2TB | Seagate Expansion 8TB
Display(s) Samsung U32J590U 4K + BenQ GL2450HT 1080p
Case Fractal Design Define R4
Audio Device(s) Line6 UX1 + some headphones, Nektar SE61 keyboard
Power Supply Corsair RM850x v3
Mouse Logitech G602
Keyboard Cherry MX Board 1.0 TKL Brown
VR HMD Acer Mixed Reality Headset
Software Windows 10 Pro
Benchmark Scores Rimworld 4K ready!
Have you tried with a 7805 voltage regulator and something like a LD1117V33 for 3.3 V ?

You should be fine without the glue components (capacitors/resistors), just the regulator alone should work for that purpose.

This, at least for small currents which I've no idea of how large they'll be, but I can't imagine them being too large.
 
Joined
Mar 23, 2012
Messages
777 (0.18/day)
Location
Norway
System Name Games/internet/usage
Processor I7 5820k 4.2 Ghz
Motherboard ASUS X99-A2
Cooling custom water loop for cpu and gpu
Memory 16GiB Crucial Ballistix Sport 2666 MHz
Video Card(s) Radeon Rx 6800 XT
Storage Samsung XP941 500 GB + 1 TB SSD
Display(s) Dell 3008WFP
Case Caselabs Magnum M8
Audio Device(s) Shiit Modi 2 Uber -> Matrix m-stage -> HD650
Power Supply beQuiet dark power pro 1200W
Mouse Logitech MX518
Keyboard Corsair K95 RGB
Software Win 10 Pro
A resistor network looking like this for each pin needing to be converted down from 5V to 3,3V:
Resistor network.png

1: here you connect the 5 V input from the NES controller
2: connect the 3,3 V output to the microcontroller you are using

The values of R1 and R2 are not that important, but the relationship between them are, R2 must at its MAX be R1 x 2, the lower R2 is in relation to R1 the lower the voltage form 2 will be.

the actual values for R1 and R2 will depend on the input resistance your microcontroller, but i guess values:
R1 : 1000 ohm
R2: 1500 ohm
are small enough to not get influenced by the input resistance, it will give you an output at 2 of
5 V/(1 k +1,5 k) * 1,5 k = 3V
with a draw of 5V/2,5k ohm = 2 mA for the resistor network.

Should 3V be to small a voltage for the input you can replace R2 with a 1800 ohm resistor giving
5V /(1,8 k +1 k) * 1,8 k = 3,22 V
this with a draw of 5V/2,8k ohm = 1,8 mA
 
Last edited:
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Hi guys

Thanks for all the help, i tried to look over examples of some of the components and circuits you posted and i realised i was a little over my head.

So i stumbled across this for a couple of quid and picked one up to have a play with.

http://www.adafruit.com/product/757

Should do the job of catering the category 3 NES controller i posted above. Ill report back when it arrives.
 
Top