Dangerous Prototypes

In development => Project logs => Topic started by: Markus Gritsch on July 31, 2011, 09:48:01 pm

Title: SSD1308 AVR Library for Arduino/Teensy
Post by: Markus Gritsch on July 31, 2011, 09:48:01 pm
Hi,

since people are repeatedly asking for the library code and the pin connections of the modified OLED display shown in this (old) YouTube video

    http://www.youtube.com/watch?v=xbbnZvbWwqU (http://www.youtube.com/watch?v=xbbnZvbWwqU)

I decided to post it here, so that I can link to it from the YouTube comment.

* 'mgr_lib.zip' contains the library
* 'SPI_font.zip' contains the example sketch

Have fun,
Markus
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: Sjaak on July 31, 2011, 09:56:06 pm
I love those burning marks on your notes ;) Looks a bit like notes I have lying here ;)
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: ian on August 05, 2011, 01:40:00 pm
Nice! Sorry for my late reply, I'll post this up.
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: davegior on February 11, 2012, 04:00:37 am
I have the same display and would like to use it with the Arduino Pro Mini 328/16mhz, 5v but have no clue looking at the notes.
I am fairly new and would greatly appreciate any ones help. Thanks.
I've been Goggling but can only find this thread for Arduino.
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: mctouch on August 21, 2012, 10:43:44 pm
I noticed that there is another device on the breadboard on the right hand side, is this a boost converter for the SSD1308 to 7v?

Also I am having issues compiling the code in Arduino 1.01 & 0023.

SPI_fong.ino: In function 'void loop()':
SPI_font_test:23 error: '_SIN' was not declared in this scope.

but it is declared in tri.h

#define _SIN( a ) ( (int8_t)pgm_read_byte( &_sin[ a ] ) )

Not too sure what I am doing wrong, any ideas?

thx
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: Markus Gritsch on August 22, 2012, 09:42:00 am
The device on the rhs is an accelerometer.  You can see it in action here http://www.youtube.com/watch?v=Ez3JnTUxack (http://www.youtube.com/watch?v=Ez3JnTUxack) and download the code for it here viewtopic.php?f=50&t=1647 (http://dangerousprototypes.com/forum/viewtopic.php?f=50&t=1647).

The SPI_font.pde example compiles fine when you change the line
    #include <tri.h>
to
    #include "tri.h"

Have fun,
Markus
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: mctouch on September 03, 2012, 12:58:41 am
Hi,

Thanks for your help Markus

I am using one of these.

http://www.ebay.co.uk/itm/0-96-128x64-O ... 3397wt_875 (http://www.ebay.co.uk/itm/0-96-128x64-OLED-Display-Module-SSD1306-Arudino-AVR-/130536921656?pt=LH_DefaultDomain_0&hash=item1e649b5a38#ht_3397wt_875)

The sketch works on this OLED but it is very very faint (not bright). The helix animation is barely visible, are you using the 3.3 Volt Regulator on the Teensy?

(pin mapping I am using)
OLED to Teensy
RS(MISO) = DC to PB7
SDIN(MOSI) to PB2
CS to PB0
SCLK to PB1
3V3 to Vcc
GND to GND
RES to RST


Mark
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: mctouch on September 03, 2012, 12:59:40 am
Its a SSD1306 Driver not the SSD1308 you are using..
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: mctouch on September 03, 2012, 02:44:39 pm
Yes apologies I knew this and should have put it in my post. It does work however only faintly, I am hoping that upping the contrast fix this. The only difference I can see between the SSD1306 and SSD1308 is the charge pump is onboard the 1306 and not on the 1308 assuming you are supplying a separate 7.5 volt power supply on the OLED, or maybe the seeed breakout board has one.

I will try and boost the brightness tonight.

Thanks for this fantastic Frame buffer driver..

:)

Mark
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: mctouch on September 05, 2012, 08:47:58 pm
ok so its working...

All I had to change is the charge pump to use onboard power in oled.c


Code: [Select]
void oled_config()
{
    send_command(0xaf); // display on

    send_command(0x20); // Set Memory Addressing Mode:
    send_command(0x00); // Horizontal addressing mode

    //send_command(0xb0); // set page address
    //send_command(0x00); // set low col address
    //send_command(0x10); // set high col address

send_command(0x8d); //
   send_command(0x14); // enable charge pump

Code: [Select]
//send_command(0x10); // 

    send_command(0x81); // Set Contrast Control:
    send_command(0xfa); // default: 0x7f

//send_command(0xf9); // Set pre-charge period
//send_command(0xf1);

    //send_command(0xa7); // Set Inverse Display
    send_command(0xa6); // Set Normal Display
}

Thanks again
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: Markus Gritsch on September 11, 2012, 11:35:00 am
Thanks for the update.  Good that it works for you now.
Title: Re: SSD1308 AVR Library for Arduino/Teensy
Post by: robouden on March 20, 2013, 03:48:13 pm
Nice article. I am trying to use a Teensy V3,0. But get compiling errors like:myspi.c:26: error: 'DDRB' undeclared and a whole bunch more. Any suggestions?

regards
rob

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01092094080session_write_close ( )...(null):0
20.01122225672ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01122226448Database_MySQL->query( ).../DatabaseHandler.php:119
40.05742365184Database_MySQL->error( ).../Db-mysql.class.php:273