Start by placing the header pins in to the pin holes designed for the Pi Zero:
And mount the Pi Zero this way:
It’s recommended to put a kapton tape or anything in between the adapter and pi zero to avoid shorts before soldering the header pins to the Pi.
The next step is to cut the pins and plastic below the header pins and solder them to the DPI Adapter.
The final step is to solder the Pi Zero’s USB data pins (D+ and D-) to the 2 holes on the DPI Adapter. These holes will connect the Pi Zero’s data pins to the D+ and D- pads on the adapter for connecting any USB device. (Note: The D+ and D- pads on the DPI board are mislabeled. The upper pad should be D- and the lower pad should be D+. Thanks to Paul for reporting.)
The 5VIN and GND pin holes below the tinkerBOY DPI Adapter are your 5v and GND inputs.
Edit the config.txt and copy/paste the following lines:
Save the file.
The tinkerBOY DPI Adapter v1.0 uses a custom overlay for the DPI interface. Download this file, unzip and place the dpi18_666.dtbo file inside the overlays folder in the boot partition of the sdcard where the config.txt is also located.
This guide might also work on any screen that we use for building our Game Boy Zero as long it uses the CL6201 LED driver IC with the “7001” label on it.
I will be using a Raspberry Pi Zero for this tutorial but any Arduino/Atmel chips with PWM pins can also be programmed to do the job. I have actually tested it with an attiny13a and it works just fine.
Before we start, follow the Wiring Guide for the 3.5″ GearBest Screen with 5V Mod. Then start by soldering a wire from the CL6201’s EN pin 4 to the Pi Zero’s GPIO19 pin. The CL6201 Datasheet says that the EN pin can be used to adjust the brightness by connecting it with a PWM square wave signal between 100Hz and 100KHz. That means with the Raspberry Pi’s capability to produce PWM signal we can control the brightness with it.
For the control buttons let’s use two tactile buttons for increasing and decreasing the brightness. Wire the buttons like this:
You can write a program in Python or C to do the PWM routine but let’s keep it simple by using a progam called pigpio and write a simple python to just call it. Login to your Raspberry Pi and install the program by following the instruction at abyz.me.uk/rpi/pigpio/download.html.
We are now ready to test the program. Type the command sudo pigpiod to load the pigpio daemon. Now we can test it with the following command format:
pigs p GPIO DUTYCYCLE(0-255)
GPIO is the gpio pin we want to use which is GPIO19 and DUTYCYCLE is what controls the brightness.
pigs p 19 50
The above code should dim the screen. Try experimenting with other DUTYCYCLE values from 0-255.
Now for the actual buttons to control the brightness I wrote a simple python to call the pigpio program. Copy the code below and paste to a new file with .py extension. You can just name it as brightness_controller.py if you want.
Most of these 3.5″ screens are intended for 12v power supply. The 12V input goes to a chip called XL1509 and converts that to 5V. Like any DC to DC converter there’s always going to be wasted power as a result of the conversion. This is the reason why I highly recommend that you do the 5v mod eventhough the screen works if you feed it with 5v without the need for any modification.
To make the connections more reliable let’s remove the Female JST connector..
..just be careful not to lift the contact pads which I’ve mistakenly done here. Luckily the board has two video connections which are AV1 and AV2. I will be using the AV1.
Cut the cable that came with it and solder the wires directly to the board. In order to do the 5V mod, you just solder the RED wire directly to the XL1509’s Pin 2 or to the SS24’s cathode pin which is easier to solder to. The other end of the RED wire goes to your 5v power supply of course (PowerBoost 5v output). Since the Raspberry Pi only requires just one video connection, solder the YELLOW wire to the Pi’s TV connection. Join the WHITE and BLACK wire and solder them directly to the GND pad on the screen board. The WHITE(GNDTV) wire goes to the GND beside the TV pin on the Pi while the BLACK wire goes to your normal powerboost’s GND output.