Pi in a Gameboy Advance Build - WIP
-
@obsidianspider yeah the older games didnt have massive resolution anyway, so they look fine. I found the handheld games look better, because they were designed to be viwed on the smaller screens, but playing a game designed to be viewed on a tv can be a bit fuzzy
Used to own a game gear back in the day (its still in the loft) and that had an adaptor to let you play master system games. I remember having the same issue when playing master system sonic, on a game gear. lots of squinty text
-
http://www.stuffaboutcode.com/2016/01/pocket-pigrrl-battery-monitor.html
Found this while hunting for some Low Power LED wiring diagrams. Thought this might help!
If you can make heads or tails of this little strip he wired up please let me know hah
-
I don't want the big plastic GPIO connector on the back of the screen when it's in the Gameboy, so I decided to try to figure out what pins were necessary to make it work as opposed to the ones that were "just there" because it's mean to just plug right in. The SainSmart web page for the screen had some pinout information, but didn't list what the pins were actually numbered, so it wasn't really helpful. Since the SainSmart screen is a clone of the Waveshare I went looking for pinout information for that and I was in luck. The Waveshare page has pinout information with pin numbers. I put a screen shot below just in case that web page goes away in the future.
I don't want to use the buttons or the touch screen, so pins associated with those were easy to dismiss, as well as the "NC" pins. It also looks like there is a lot of power and ground redundancy going on. I wasn't sure if the screen ran off 3.3V or 5V so I connected up one 3.3V, one 5V and one ground pin, leaving the redundant power pins disconnected. The screen worked the same as it had when directly plugged in, so that was a good sign. I tried removing the 5V power and booted the Pi and the screen didn't come on at all. I connected the 5V and then disconnected the 3.3V pin and the screen works correctly. It looks like it runs on 5V. What I don't love is that the 5V pins on the Pi are "hot" all the time, so the backlight is on whenever there is power to the Pi. Just for the heck of it I tried connecting the 5V pin from the screen to the 3.3V pin on the Pi and it didn't work. But it was worth a try.
This is how I have the screen wired and working properly on my Pi 2 test system.
Pin No Symbol Description 4 5V Power Positive (5V Power Input) 13 RST Reset 15 LCD_RS LCD Instruction Control, Instruction/Data Register Selection 19 LCD_SI/TP_SI SPI Data Input of LCD/Touch Panel 20 GND Ground 23 LCD_SCK/TP_SCK SPI Clock of LCD/Touch Panel 24 LCD_CS LCD Chip Selection, Low Active
-
@monstermadeofman Ooh I like it. Definitely a good way to show that information, but I was thinking maybe a multicolor LED status would be "better" like adamspc used in their PSPi, though I haven't gotten to power stuff yet. Though I do want a "soft shutdown." adamspc has a simple and advanced version explained on their website. I also saw two versions in the forums over at sudomod that are worth investigating.
I did see that Arrow is giving away a Pi 3 with any orders over $3.14 for the next few days (It seems like a limit of 1000 free Pis per day, so I'll try again tomorrow) so it has me thinking about trying to cram a 3 in this thing if I can get one cheap. If I desolder the high stuff and cut the board down to where the test pads are for the USB ports it'll just fit if I rotate it… But my bigger concern than space would be power usage. As we all know a Pi 3 uses a lot of juice and I don't know of a power booster that can supply that much oomph or a battery that would last more than a few minutes. But it's fun to think about, especially since this Wii U controller with a Pi 3 is doing it.
Edit: I see they're using a PowerBoost 1000 Basic which can output 4A but doesn't have a charging circuit. To get around it a separate charging circuit was used. The PowerBoost 1000C can only output 2A (1 A to the battery, the other 1A to the connected device)
-
With the TFT working, now it was time to trim the PCB so it wouldn't stick out past the screen edge.
First I carefully pried the screen away from the board with a plastic spudger.
I then used Goof Off to remove the residue from the double-stick foam that was used to adhere the screen to the board.
With the board and screen clean I desoldered the switches (who knows, I may use them at some time in the future) and the GPIO connector.
Then it was time for some weight reduction. With a pair of tin snips I trimmed the board down and dressed the edges with my Dremel. I then took some ribbon cable and soldered only the contacts that I knew I would be using.
With the wires soldered to the board I plugged in the screen and hooked the wires up to my Pi 2 and…
…it didn't turn on.
At first I thought I cut something I shouldn't have in the board, or that I damaged the ribbon cable. After way too long with my multimeter testing voltages it turned out that I just had the wires connected to the Pi backwards. Luckily I didn't fry anything. Oops
With the screen and the trimmed board now working I put a piece of electrical tape over the back of the GPIO holes (the back of the screen is metal) and then attached the screen to the board with a piece of double-sided packing tape.
The USB hub I ordered came today and I tried connecting it to my Zero and sure enough, it didn't work. Things were initially looking promising with the Wifi dongle blinking during boot, then the wifi dongle went dark and EmulationStation didn't see my controller. I connected the hub to a "real computer" and plugged in four USB sticks at the same time and all were detected, so I am convinced the hub works. I'm thinking that the Pi is just not feeding the USB port enough voltage. I am going to connect a full-size USB port to the zero with power being tapped from GPIO to see if that makes the hub work before I try taking it apart, but that won't be tonight.
-
@obsidianspider there is lots of sockets to fit in the case there!!! Your screen is not using many GPIO, there will be plenty left for buttons O:-) im sure i say that to everyone!! although i think you are using the usb for sound too so that may kill my plans.
You can get OTG hubs that will negate some of the connections you have there (http://www.ebay.co.uk/itm/331758527958 first on i found on da'bay) that does have a power input, which may solve the issues you are having? i do have one somewhere, i will see if i can dig it out and have a play
-
@moosepr the plan is just to use the board from the hub, but I'm only going to do that if the hub works with the zero. If not I'll have to find one that does. Yes, I plan to use USB audio and want to be able to plug in an adapter for Wifi (or hard wire it if it will fit)
-
Well, that was $5 wasted.
I tried adding a full size usb port to the pi, tapping power from the test pads under the micro usb input. Then I tried hot rodding the output by tapping off the power in to the hub and tying power to each individual output instead of going through the board. My wifi and usb audio show up, but a keyboard or controller don't.
I went to the terminal and it looks like this hub is junk. Not a "real" USB 2 hub, just masquerading as one.
lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 12M |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 12M |__ Port 3: Dev 8, If 0, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 8, If 1, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 8, If 3, Class=Human Interface Device, Driver=usbhid, 12M
lsusb Bus 001 Device 008: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter Bus 001 Device 003: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] Bus 001 Device 002: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
from
dmesg
- as you can see, the wifi adapter isn't running at full speed.usb 1-1: New USB device found, idVendor=05e3, idProduct=0606 [ 2.264969] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2.264987] usb 1-1: Product: USB Hub 2.0 [ 2.265002] usb 1-1: Manufacturer: ALCOR [ 2.266261] hub 1-1:1.0: USB hub found [ 2.266546] hub 1-1:1.0: 4 ports detected [ 2.543192] usb 1-1.1: new full-speed USB device number 3 using dwc_otg [ 2.643731] usb 1-1.1: not running at top speed; connect to a high speed hub [ 2.645576] usb 1-1.1: New USB device found, idVendor=7392, idProduct=7811 [ 2.645603] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.645622] usb 1-1.1: Product: 802.11n WLAN Adapter [ 2.723190] usb 1-1.2: new low-speed USB device number 4 using dwc_otg [ 3.183189] usb 1-1.2: new low-speed USB device number 5 using dwc_otg [ 3.643184] usb 1-1.2: new low-speed USB device number 6 using dwc_otg [ 4.143201] usb 1-1.2: new low-speed USB device number 7 using dwc_otg [ 4.643181] usb 1-1.3: new full-speed USB device number 8 using dwc_otg [ 4.744387] usb 1-1.3: New USB device found, idVendor=0d8c, idProduct=000c [ 4.744419] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 4.744438] usb 1-1.3: Product: C-Media USB Headphone Set [ 4.752104] input: C-Media USB Headphone Set as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.3/0003:0D8C:000C.0001/input/input0 [ 4.803575] hid-generic 0003:0D8C:000C.0001: input,hidraw0: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-20980000.usb-1.3/input3 [ 4.883174] usb 1-1.4: new low-speed USB device number 9 using dwc_otg [ 5.343205] usb 1-1.4: new low-speed USB device number 10 using dwc_otg [ 5.803179] usb 1-1.4: new low-speed USB device number 11 using dwc_otg [ 6.303184] usb 1-1.4: new low-speed USB device number 12 using dwc_otg
When I plug in the Wifi adapter by itself:
lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M
from
dmesg
[ 2.083255] usb 1-1: new high-speed USB device number 2 using dwc_otg [ 2.083663] Indeed it is in host mode hprt0 = 00001101 [ 2.285232] usb 1-1: New USB device found, idVendor=7392, idProduct=7811 [ 2.285328] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.285349] usb 1-1: Product: 802.11n WLAN Adapter
Even though it's been listed as "working" on a few websites (which is why I bought it, even though Amazon reviews said it was junk) I'd suggest avoiding this hub for use with a Pi Zero. For what it's worth, I also tried plugging the hub into my Mac and it also shows up as a low speed device even though it's "USB 2"
Now I need to either find a hub that shows up at full speed and try that, or rethink this project…
Edit: I've seen that some cheap hubs will revert back to USB 1 speeds when a USB 1 device is plugged in. The "slow" speeds reported show up even when the only device plugged in is my USB wifi adapter (USB 2) and on my Mac it shows as slow even when I just plug in the hub with nothing else plugged in.
If anyone can recommend a "real" USB 2 hub that's small that shows up as high speed, I'd love to check it out.
-
Well, I'm in a bit of a better mood. I just got an email from Arrow with a promo code for a free Pi 3 after their servers got slammed during their "Free Pi 3 with a purchase of $3.14 or more" promo that was going on. I bought an Adafruit mono amp which I needed anyway, but I wasn't sure if I'd get the actual Pi.
Now that I have a FREE Pi 3 coming my way, do I keep pursuing a hub, or do I try to cram a Pi 3 in this GBA?
-
@obsidianspider someone on the forum did do a Pi3 handheld build. Can't remember who for the life of me, but they did say that it's power consumption is high. Something like half an hour of play time with a 2000mAh battery.
-
@monstermadeofman Half an hour?! Yikes. Definitely something to consider. I'll have to look up power usage by a 3 vs a Zero.
-
@diegzumillo said in Gameboy Pi (Rethought the concept):
My only recommendation is to avoid using pi 3 if possible. Seeing how you want to emulate 16 bit and lower, the pi zero is definitely the way to go. It's cheaper, smaller, easier to power... it's more convenient in every aspect. I say this because I ran into a huge problem with my handheld using pi 3, because it has complicating power demands that the popular powerboost from adafruit cannot handle. And I'm not even able to play anything the zero couldn't handle, because it would require overclocking it the thing.
Other than that, I don't see any difficulties in your project. The PiGrll seems like a solid starting point. I used those buttons on mine and they are awesome!
Everything looks promising! Good luck with everything.
This was the guy! I can't find the post where he was talking about power consumption but you get the idea.
-
@monstermadeofman Thanks
I'm certainly not going to tell them to cancel the free Pi 3 ;) , but I guess I'll go back to hunting for a small hub that actually shows up as a high-speed USB 2.0 hub and will detect a keyboard and controller…
-
Had a quick hunt on the Sudomod wiki and found something that might help you a bit
-
@monstermadeofman said in Pi in a Gameboy Advance Build:
Had a quick hunt on the Sudomod wiki and found something that might help you a bit
That list was the one that told me the "octopus" hub would work! (It doesn't) ;)
-
huh that is odd. They haven't led me astray yet. But then again this is the internet.
I'm using a cheap 4 port hub a chain shop here in the UK, I don't know if you can get it in the US (the brand that is)
http://www.wilko.com/computer-accessories/usb-hub-4-port/invt/0349276
I've got my keyboard and my wifi dongle plugged in and I have no issues.
-
OK, I'm back in business. That "octopus" hub is just a piece of junk. I updated the wiki entry to reflect my findings.
I went to Best Buy on my lunch break and picked up the Targus ACH114US that was listed as the "original" Gameboy Zero hub and it works perfectly. With my wifi adapter, usb controller, usb keyboard and usb soundcard everything is operating as it should.
lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 1: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M |__ Port 2: Dev 6, If 0, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 2: Dev 6, If 3, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M |__ Port 3: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M |__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M
While it works, it's pretty long. Which is the main reason I went with the "octopus" hub originally.
Taking it apart was pretty easy, but I'm going to have to think about how I am going to be able to fit it inside the Gameboy Advance shell.
Another neat thing I learned. The Targus hub has five wires, but it's only USB 2. The plug only has four pins. The fifth blue wire is apparently a "drain" wire and is tied to ground and is connected to all of the metal on the plug and on the socket surrounds.
-
@obsidianspider said in Pi in a Gameboy Advance Build:
sound
You talked about a adafruit monoamp? Is this an I2S device, like the one used in my latest build? Maybe you will then also find the I2S sound config be useful.
USB Hub issues
Yes, that's hard. I had luck with my both hubs - they worked all flawlessly. But take care about power consumption. Those passive hubs can just provide 100mA per connector and some external devices (USB WLAN STICKS!!!) can use more than 100mA. I got an old WLAN stick working as I desoldered the power LED.
Pi0 and Internet connection
Yes... therefore you should backup your wifi credentials :)
It's driving me crazy to get a internet connection .... but @BuZz made a cool job with the Wifi key import feature for RetroPie -
@cyperghost I ordered the Adafruit 2130 amp which I believe will accept a line in and amplify it. At least that's what I want it to do.
So far the Targus hub is working well.
I saw that Targus had a small blob of hot glue where the wires met the PCB as a bit of strain relief. Inspired by that I added a blob of glue (maybe a bit too much, we'll see) to where I soldered the ribbon cable to the screen PCB. The next thing I'll need to do is modify the case to fit the screen, and I shouldn't have to chop too much, and a quick mockup shows that I won't have too much of the screen cut off by the factory screen cover, which I think I'm probably going to keep in place. If anything, upgrading to a glass one.
-
@obsidianspider i was going to use the 2.8 ili9341 (i think its the same as the one on your screen actually) in my advance. It actually fits pretty well, just a slightly different aspect ratio than a standard GBA screen.
Have you got much clearance between the sides of the screen and the buttons? i was worried i would have to shave some off the sides of the buttons to get it all to fit (although i didnt actually get that far in)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.