today I want to show you how I set up my Tontec 3.5″ Screen on my Raspberry Pi B. I thought I should write about this in my blog since it took quite some research to get this screen up and running. Ok. Let´s start 🙂
- Raspberry Pi B
- Tontec 3.5″ Screen (I bought it from here.)
- Raspbian Wheezy (You can download it from here.)
The first step is simple. Build the case and attach the screen to your Raspberry Pi. When you are done it should look like this:
sudo apt-get update sudo apt-get upgrade sudo reboot
Now we will download and install a firmware update. To do this simply run the following commands and wait a few minutes:
sudo apt-get install rpi-update REPO_URI=https://github.com/notro/rpi-firmware sudo rpi-update sudo reboot
The next step is to adjust the SPI and Overlay settings to our Tontec MZ61581 display:
sudo nano /boot/config.txt
Add the following code to the end of the file and hit save:
dtparam=spi=on dtoverlay=mz61581 gpu_mem=128
Your config.txt file should now look like this:
# uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display is not detected and composite is being output #hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) #hdmi_group=1 #hdmi_mode=1 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800 # for more options see http://elinux.org/RPi_config.txt dtparam=spi=on dtoverlay=mz61581 gpu_mem=128
Now we will install the necessary dependencies to set our Default Display to our Tontec Screen:
sudo apt-get install xserver-xorg-video-fbturbo
After you have successfully installed the dependencies you need to alter the following file:
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
All you need to do is to alter the following line:
Option "fbdev" "/dev/fb0"
To look like this:
Option "fbdev" "/dev/fb1"
This will switch the Default Display from HDMI to the Tontec Screen.
Here you can see how your 99-fbturbo.conf file should look like:
# This is a minimal sample config file, which can be copied to # /etc/X11/xorg.conf in order to make the Xorg server pick up # and load xf86-video-fbturbo driver installed in the system. # # When troubleshooting, check /var/log/Xorg.0.log for the debugging # output and error messages. # # Run "man fbturbo" to get additional information about the extra # configuration options for tuning the driver. Section "Device" Identifier "Allwinner A10/A13 FBDEV" Driver "fbturbo" Option "fbdev" "/dev/fb1" Option "SwapbuffersWait" "true" EndSection
The last step is to tell your Raspberry Pi to display the boot screen on your Tontec Screen. To do so edit the following file:
sudo nano /boot/cmdline.txt
Now add the below code before “rootwait“:
Your cmdline.txt file should now look like this:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fbcon=map:10 rootwait
Now reboot your Raspberry Pi one last time:
Now when your Raspberry Pi boots your screen should switch on and you should be able to see the boot screen on it.
Well, that´s it. Your Tontec screen is now ready to use 🙂
If you want to have a look at my config files or the documentation of the screen I found online you can find them here.
I hope you liked my post and I hope to see you again next time 🙂