Join the Ben Heck team every week for amazing hacks! Watch them build and mod community-inspired projects using electronics!
|The Learning Circuit|
|See All Episodes|
Ben’s got a 480x272 TFT-LCD screen, pretty much the same screen that was in the original PlayStation Portable. He’s going to wire it up into 16-bit color which would be 5 bits of red, 6 bits of green, and 5 bits of blue. Ben insulates the screen with a piece of plastic. He bends the ribbon cable back so that he can attach the breakout board into position. He can then see how to fit on the Raspberry Pi A module. Felix is desoldering some parts and should have that for Ben very soon. The plan is to manually wire from the Raspberry Pi over to the module. The 50 pin TFT breakout that he’s using is from Adafruit. It gives you a bunch of solder points so you can attach things to a TFT screen. There is also a voltage booster on this board. It’s for the LED backlight. The LED backlight on this runs at 21 volts and they’re going to power this off 5. They will need a booster circuit to take the 5 volts this runs at and bump it up to a higher voltage that’s just 21. There’s a chip and a coil that will give them their higher voltage. Ben pulls out the header and inserts the flat flex ribbon cable into it. Once he knows it’s in place he can lay it down and that tells him optimum position to place this board. Ben puts the LCD breakout board in place and puts the depopulated Raspberry Pi board in place. Felix removed the GPIO header, camera port, DSI port, HDMI, USB, and AV jack from the Pi. Ben takes a look at a super useful document he found at https://elinux.org/RPi_BCM2835_GPIOs. It’s a list of all the modes the Raspberry Pi GPIO can go into. The thing to look at here is the alt versions. If you go to https://www.raspberrypi.org/documentation/hardware/raspberrypi/dpi/README.md you can find a depiction of how the GPIO can be mapped to an RGB color space or RGB pixels. Using both sheets, Ben can cross-reference how to do the breakout board. That will give him all the colors and then there’s also the signal pulses, data sync, vsync, etc, and that is listed as well.
Next, Ben shows you how to setup retropie using win32diskimager. You can get a RetroPie disk image from https://retropie.org.uk/. He’ll test to make sure everything is working on another Raspberry Pi A. That way he can make sure everything is working and compile the DTS file, then bring it over to the board he’s working on. Once the image is complete, Ben shows you what’s on the SD card. He opens up the config text file and shows you what the DTD file looks like. The DTD file is a device tree overlay blob file which basically defines a lot of the functions of the Broadcom system on a chip processor. When the system boots up it looks at the config file and the DTB files and it tells it what it should do. They can modify these files in such a way as to use the new interface. Ben finds the config file for the 4.3 inch TFT on the Adafruit site https://learn.adafruit.com/adafruit-dpi-display-kippah-ttl-tft/installation , although they’ll probably have to modify it a little bit. He copies the config file for the 4.3” TFT file and adds it to the bottom of the confi g file on the SD card. Next, he takes the DT blob file that he found at Adafruit, and copies over the code for the Raspberry Pi A plus. He sets up the Raspberry Pi with ‘sudo raspi-config’, configuring localization and enabling SSH. He installs a compiler for DTS file:
$ sudo apt-get install device-tree-compiler
And uses the following command to compile:
$ sudo dtc –l dts -0 dtb –o dt-blob.bin dt-blob.dts
The DTS file has been compiled into a bin file and it’s now time to tweak the config file. Ben connects a Raspbery Pi A+ directly to an LCD and then used a blob file along with the config text file to drive it.