kashimAstro / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

Port U8glib to Raspberry Pi #171

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
GPIO Programming: http://elinux.org/RPi_Low-level_peripherals

There seem to be two options:
Low level gpio programming (mmap/linux)

Other option would be to use this lib:
https://projects.drogon.net/raspberry-pi/wiringpi/

Original issue reported on code.google.com by olikr...@gmail.com on 26 May 2013 at 5:52

GoogleCodeExporter commented 8 years ago
#50, that'd be great.  I am using 4-wire SPI and got much better refresh rates 
by changing the bus speed.  What worked well for me was to change from 500 kHz 
to 3.2 MHz.  Check utility/u8g_com_raspberrypi_hw_spi.c on or near line #77

Original comment by vern...@gmail.com on 17 Mar 2015 at 11:16

GoogleCodeExporter commented 8 years ago
#44,can you send me source code for python?

Original comment by supr...@gmail.com on 27 Jun 2015 at 12:34

gatuno1 commented 8 years ago

I would like to report I was successful to compile the library and few examples from github code on Raspberry Pi, and also they work on my SSD1306 SPI connected!!

I did this procedure:

$ sudo apt-get install build-essential autoconf libtool libsdl1.2-dev

I had a lot of trouble to identify the need of packages autoconf and libtool, but after that the build was easy.

$ sudo git clone https://github.com/olikraus/u8glib.git
$ cd u8glib/

For the following examples I had to select the corresponding LCD, editing the following files:

$ sudo nano sys/arduino/Chess/Chess.cpp
$ sudo nano sys/arduino/U8gLogo/U8gLogo.cpp
$ sudo nano sys/arduino/GraphicsTest/GraphicsTest.cpp

changing the corresponding line of my lcd (SSD1306_128X64):

    //U8GLIB_SSD1306_128X64 u8g(10, 9);             // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)

changed to:

    U8GLIB_SSD1306_128X64 u8g(10, 5, 6);             // HW SPI Com: CS = 10 @wiringpi (8 @BCM_GPIO), A0 = 5 @wiringpi (24 @BCM_GPIO), RESET = 6 @wiringpi (25 @BCM_GPIO) (Hardware Pins are SCK = 14 @wiringpi (11 @BCM_GPIO) and MOSI = 12 @wiringpi (10 @BCM_GPIO))

My setup was using hardware SPI in Raspberry Pi and two addtional pins with the following connections (using WiringPi numbering from http://wiringpi.com/pins/ ):

OLED Module pin RPi Function / BCM Numbering pin RPi header pin WiringPi numbering Pin u8glib pin
1-VCC +3.3V pin 17 - -
2-GND GND pin 20 - -
3-NC not connected - - -
4-DIN (data input) MOSI / GPIO10 pin19 12 MOSI
5-CLK (clock) SCLK / GPIO11 pin23 14 SCK
6-CS (select) CE0# / GPIO8 pin24 10 CS
7-D/C (data/command) GPIO24 pin18 5 A0
8-RES (reset) GPIO25 pin22 6 RESET
$ sudo ./autogen.sh
$ sudo ./configure
$ sudo make
$ sudo make install
    $ sudo ./u8gwpi_logo

20151217_001448 20151217_001402