Git Product home page Git Product logo

spi-lcd-screen's Introduction

SPI-LCD-Screen

A pet project to program SPI communication protocol from the scratch to control a LCD module with Raspberry Pi.
So it uses a bit banging with GPIO instead of the standard SPI driver. GPIO is manipulated by mapping the memory and controlling directly the register at the address specified by /dev/gpiomem.

The module number of the LCD screen is COG-C144MVGI-08, whose driving IC is Samsung S6B3306 .
In order to manipulate the hardware registers and know their address, I referred to BCM2835 ARM peripheral documentation. At some point, I used wiringPi(http://wiringpi.com/) library to compare the GPIO switching time, etc.

Timing (to be verified.)

While a sleep function like "nanosleep" is provided for Raspberry Pi, the time measurement showed a huge discrepancy between the desired sleep duration and the actual duration at. This was measured by using oscilloscope and switching GPIO on and off. I recall that the switching time of GPIO measured by the oscilloscope was about 36 - 40 nanoseconds, but this is to be verified.

Anyway, in order to implement a sleep function with correct duration, I used the timer of BCM2835 by mapping the memory at /dev/mem + 0x2000B000.
While this seemed to increase the precision, it didn't work well below 400us, according to the delay_fnc_result.txt (Some part of this text file seems rather cryptic, and I do not know what I was thinking, but what really matters is fortunately intelligible).

The problem seems that we don't have a control over the OS scheduling and resource allocation. To increase the precision and avoid sudden spikes in sleep duration, I probably should use a Real Time OS.

Video Demo

https://youtu.be/34jqGsdNCsc

Video Demo

The video used for the demo is not actually a video but rather a GIF animation (but not exactly. Refer to the PixToMx.m, the matlab file.) It's just a series of bitmap images drawn at a high speed.

spi-lcd-screen's People

Contributors

cerfvert94 avatar

Stargazers

Timothy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.