Posted on

tinkerBOY DPI Adapter v1.0: Visual Guide for Raspberry Pi Zero

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.

Posted on

tinkerBOY DPI Adapter v1.0: Gettting Started Guide

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.

That’s it for the settings.

Guides:

 

Posted on

How To Add Brightness Control For The 3.5″ GearBest Screen

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.

Hardware

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:

Software

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.

Testing

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.

Example:

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.

Run it by typing the command  python brightness_controller.py. Press each of the buttons and it should increase or decrease the brightness on the screen.

Here’s a demo:

That’s it! Let me know in the comment below if this works for you.

Posted on

Wiring Guide for the 3.5″ GearBest Screen with 5V Mod

I get a lot of wiring inquiries about the 3.5″ GearBest Screen so I decided to make one.

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.

Yep, That’s it!

Posted on

RetroPie: Disable Builtin Sound Card and Enable USB Audio Only

Edit the file /boot/config.txt and comment the line:

#dtparam=audio=on

Now edit the file /etc/modprobe.d/alsa-blacklist.conf and add:

blacklist snd_bcm2835

Finally edit the file /lib/modprobe.d/aliases.conf and comment the line:

#options snd-usb-audio index=-2

Or if you just want the USB Audio to be your primary sound device.

Posted on

Raspberry Pi: Downmixing From Stereo to Mono Sound Output

First, let’s choose which device to use. Enter the command cat /proc/asound/modules to list all available sound devices whether it’s a PWM audio or USB sound device.

The command you just entered should output something like:

0 snd_bcm2835 << this is the PWM audio I configured on GPIO18 & GPIO13.
1 snd_usb_audio << this is my USB sound device.

Enter the command sudo nano /etc/asound.conf and paste the following code:

Change the N on the line slave.pcm "hw:N" to  the number that corresponds to the audio device you want to use. I will be using my USB audio device so mine should read slave.pcm "hw:1".

The above code uses both left and right audio input to output to LEFT channel. If you want the output to the RIGHT then you can just edit the line 8 – 14 to:

# Copy both input channels to output channel 1 (Right).
0.1 1
1.1 1
# Send nothing to output channel 0 (Left).
0.0 0
1.0 0

Restart ALSA by sudo /etc/init.d/alsa-utils restart or you can reboot your Raspberry Pi using sudo reboot.