{"id":15540388,"url":"https://github.com/rm-hull/st7735fb","last_synced_at":"2025-04-23T16:43:54.952Z","repository":{"id":6877755,"uuid":"8126958","full_name":"rm-hull/st7735fb","owner":"rm-hull","description":"Schematics and build info for assembling a custom Raspberry Pi kernel with ST7735 TFT-LCD framebuffer drivers ","archived":false,"fork":false,"pushed_at":"2013-05-02T22:11:40.000Z","size":12501,"stargazers_count":29,"open_issues_count":2,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-03T12:17:40.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-10T19:32:54.000Z","updated_at":"2023-10-15T20:02:01.000Z","dependencies_parsed_at":"2022-09-20T03:51:08.593Z","dependency_job_id":null,"html_url":"https://github.com/rm-hull/st7735fb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fst7735fb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fst7735fb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fst7735fb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fst7735fb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/st7735fb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472241,"owners_count":21436106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T12:13:39.991Z","updated_at":"2025-04-23T16:43:54.930Z","avatar_url":"https://github.com/rm-hull.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ST7735 FrameBuffer for Raspberry Pi\n===================================\n\nThe ST7735 is a single-chip controller/driver for 262K-color, graphic type \nTFT-LCD, which can be picked up on eBay relatively cheaply with pin-outs on\na break-out board.\n\n![1.8\" 160x128 pixel TFT-LCD](http://www.adafruit.com/adablog/wp-content/uploads/2011/12/window-57.jpg)\n\nTested working with Rev B 512Mb Rasberry Pi (Raspbian \"Wheezy\" \u0026 latest kernel sources - 3.8.11+). \nA couple of video demos are available here: \n* https://vimeo.com/59438789\n* https://vimeo.com/59765667\n\nFurther technical details for the LCD screen can be found in the \n[datasheet](https://github.com/rm-hull/st7735fb/blob/master/doc/tech-spec/datasheet.pdf?raw=true) [PDF]. Other documentation\ncan also be found in [docs/tech-spec](https://github.com/rm-hull/st7735fb/tree/master/doc/tech-spec).\n\nBuilding and installing the frame buffer driver\n-----------------------------------------------\n1. On the Raspberry Pi, enable SPI: edit `/etc/modprobe.d/raspi-blacklist.conf`\n   to comment out blacklisting of _spi_bcm2708_.\n\n2. Ensure that the latest firmware has been applied to the Raspberry Pi. Use the updater from\n   https://github.com/Hexxeh/rpi-update to perform the update (use the BRANCH=next prefix). \n   After rebooting, confirm the kernel version as follows (digits xx and yyy dont matter too much):\n\n    ```\n    $ uname -a\n    Linux raspberrypi 3.8.xx+ #yyy PREEMPT ...\n    ```\n\n3. Ensure the gcc build tools are installed on a host PC (it is much\n   quicker to cross-compile on an x86 linux machine than build the \n   kernel on the RPi): \n\n    ```\n    $ sudo apt-get install make build-essential ncurses-dev git-core\n    ```\n     \n4. Download the kernel sources with the ST7735 drivers:\n\n    ```\n    $ mkdir ~/RPi\n    $ cd ~/RPi\n    $ git clone https://github.com/rm-hull/raspberrypi-linux.git\n    $ git checkout rpi-3.8.y+rmh-st7735fb\n    ```\n\n5. Download the cross-compiler tools:\n\n    ```\n    $ cd ~/RPi\n    $ git clone git://github.com/raspberrypi/tools.git\n    ```\n\n6. Follow the instructions for building a cross-compiled kernel [here](http://elinux.org/RPi_Kernel_Compilation).\n   Note that when the guide refers to `.config`, this is provided as `etc/config.gz` in git.\n\n   Let's assume that the tools are installed in `~/RPi/tools`, and the kernel source is `~/RPi/raspberrypi-linux`. \n   Briefly the compile steps are: \n\n    ```\n    $ cd ~/RPi\n    $ export CCPREFIX=~/RPi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-linux-gnueabi-\n    $ export MODULES_TEMP=~/RPi/modules\n    $ wget https://github.com/rm-hull/st7735fb/raw/master/etc/config.gz\n    $ cd raspberrypi-linux\n    $ make mrproper\n    $ zcat config.gz \u003e raspberrypi-linux/.config\n    $ make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig\n    $ make ARCH=arm CROSS_COMPILE=${CCPREFIX} -j 6\n    $ make ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} modules_install\n    ```\n\nOnce compiled, scp the `arch/arm/boot/zImage` over the `/boot/kernel.img` on the Raspberry Pi (make a backup first). \nNext copy the `~/RPi/modules/lib/modules/3.8.11+` directory to `/lib/modules/3.8.11+` on the device (again move the\nexisting directory out of the way first).\n\nOn rebooting, you should get a second frame buffer at `/dev/fb1`, and the screen should present a nice gradient pattern. \n\nBreak-out board pin-outs\n------------------------\nThere appear to be a large number of break-out boards available for this device; this is the one \nI have, with an additional SD card slot:\n\n| TFT Pin | Name | Remarks | RPi Pin | RPi Function | Wire color |\n|--------:|:-----|:--------|--------:|--------------|------------|\n| 1 | GND | Ground | 6 | GND | Black |\n| 2 | VCC | Power | 1 | 3V3 | Red |\n| 3 | NC | | | | |\n| 4 | NC | | | | |\n| 5 | NC | | | | |\n| 6 | RESET | Set low to reset | 18 | GPIO 24 | Blue* |\n| 7 | A0 | Data/command select (aka DC or 'register select') | 16 | GPIO 23 | Grey* |\n| 8 | SDA | SPI data | 19 | GPIO 10 (MOSI) | Orange |\n| 9 | SCK | SPI clock | 23 | GPIO 11 (SPI CLK) | Brown |\n| 10 | CS | SPI chip select - set low | 24 | GPIO 8 (SPI CS0) | Green |\n| 11 | SD-SCK | SD serial clock | | ||\n| 12 | SD-MISO | SD master in, slave out | | ||\n| 13 | SD-MOSI | SD master out, slave in | | ||\n| 14 | SD-CS | SD chip select | | ||\n| 15 | LED+ | Backlight control 3V3 - 3V7, already fitted with 10K resistor? | 1 | 3V3 | Red |\n| 16 | LED- | Backlight ground | 6 | GND | Black |\n\n*-not shown on stripboard layout below - direct track connection.\n\nStripboard Layout\n-----------------\nWith 4 push-buttons, resistor values 10K.\n\n![Stripboard Layout](https://raw.github.com/rm-hull/st7735fb/master/doc/schematic_bb.png)\n\nButtons (from left to right) are wired onto BCM pins as follows:\n\n* GPIO 22\n* GPIO 25 \n* GPIO 17\n* GPIO 14 (TxD)\n\nAlso: Dallas Semiconductors DS18B20 digital thermometer, wired onto GPIO 4, with 4.7K pull-up resistor. See \nseparate usage note [here](https://github.com/rm-hull/st7735fb/blob/master/DS18S20.md).\n\nTesting\n-------\n### mplayer\n_scale_ is used because the movie is larger than most small displays. -3 means keep aspect ratio and calculate height.\n\n    $ sudo mplayer -nolirc -vo fbdev2:/dev/fb1 -vf scale=156:-3,rotate=2 examples/video/bird-is-the-word.mp4 \n\n### Image viewer\n\n    $ FRAMEBUFFER=/dev/fb1 fim examples/images/tux-small.png\n\nUsing the LCD as a console device\n---------------------------------\nTo use the display as a console, the kernel must be re-compiled with the BCM SPI \u0026 ST7735 drivers 'baked in' \nrather than as separate modules (the config settings above do this); add this to the end of the line in \n`/boot/cmdline.txt`\n\n    fbcon=map:10 fbcon=rotate:3 fbcon=font:MINI4x6\n\nSee [fbcon doc](http://www.mjmwired.net/kernel/Documentation/fb/fbcon.txt#72) for more info.\n\nAnd the finished article:\n\n![Built stripboard](https://github.com/rm-hull/st7735fb/blob/master/doc/images/IMG_2774.JPG?raw=true)\n\nExamples\n--------\nThe framebuffer is owned by root, so first:\n\n    $ sudo -s\n    $ export FRAMEBUFFER=/dev/fb1\n\nTo demo the maze generator:\n\n    $ python maze.py\n\nCopper bar animation:\n\n    $ python copper_bar.py\n\nSnake game (needs Wii Remote and bluetooth enabled):\n\n    $ python snake.py\n\nTODO\n----\n* Extended documentation\n\n* Improve build instructions\n\n* Example code (SDL / Python)\n\nReferences\n----------\n* http://elinux.org/Rpi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29\n\n* http://www.sitronix.com.tw/sitronix/product.nsf/Doc/ST7735?OpenDocument\n\n* http://learn.adafruit.com/1-8-tft-display\n\n* http://www.raspberrypi.org/phpBB3/viewtopic.php?t=28696\u0026p=262909\n\n* http://elinux.org/images/1/19/Passing_Time_With_SPI_Framebuffer_Driver.pdf\n\n* http://www.flickr.com/photos/ngreatorex/7672743302/\n\n* https://github.com/notro/fbtft\n\n* http://www.areinhardt.de/news/raspberry-pi-tft-display/\n\n* http://www.whence.com/rpi/\n\n* http://fritzing.org\n\n* http://harizanov.com/product/1-8-tft-display-for-raspberry-pi/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fst7735fb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fst7735fb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fst7735fb/lists"}