Category Archives: Uncategorized

Interfacing with the OLED Display

The FreeExpression contains a nice little OLED display which measures roughly 2.7 inches diagonally.  The display module has a very thin ribbon cable on which is stamped the module’s part number “UG-2864ASYDT01”.

A bit of Googling dug up the data sheet (interestingly stamped “Confidential” across every page).  This device uses a driver integrated circuit called an SSD-1325.

I’ll admit that writing code to make this display work is probably outside my skill set at this time.  Luckily, I found a library named u8glib which contains support for this driver, as well as numerous others.

Now, my task is to figure out the physical connections to the driver, and configure the software accordingly.

oled_AVR_connection

The laborious task of following each trace is very tricky with such small components.  I use a multimeter that has an audible beep when two connections are in a closed circuit configuration.  However, this does not work across components like resistors.  So one must follow the trace from end to end, continually testing each connection point.

The SSD-1325 driver IC uses two modes of operation, Parallel and Serial.  Luckily, the Cricut engineers decided to use the Serial configuration to save pin count.  The display’s pinout diagram was pulled from the data sheet:

DisplayPinout

 

Now that I identified each pin on the display, and it’s corresponding pin on the AVR, I could plug these values into the u8glib’s initialization routine and hopefully get it going…
The u8g init routine looks like so:

Software SPI:
uint8_t u8g_InitSPI(u8g_t *u8g, u8g_dev_t *dev, uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset);

The u8glib wiki has a cheat sheet of device types:

https://code.google.com/p/u8glib/wiki/device

Since I am using “software spi” on an NHD27 compatible device, from this list, I can see that my desired device type is probably one of these two:

u8g_dev_ssd1325_nhd27oled_bw_sw_spi
u8g_dev_ssd1325_nhd27oled_gr_sw_spi

I can see I need sck, mosi, cs and a0 lines.

My Display to AVR connections are as follows:

D/C# -> PF7
D1/MOSI -> PF5
CS# -> PE7
D0/SCLK -> PF6

u8g_InitSPI(&u8g, &u8g_dev_ssd1325_nhd27oled_bw_sw_spi, PN(5, 6), PN(5, 5), PN(4, 7), PN(5,7), U8G_PIN_NONE);

To test this, I used the u8glib example code named “graphicstest.c”…. and…. it didn’t work… at all.

I communicated with the u8glib author via email several times, each time he assured me that it worked with the SSD1325. I was at my wits end. I even thought that I had some how broken the display or disabled it. So I then decided to wire up an LCD module and test it. It didn’t work either. Now I was really flabbergasted. I had all but given up on the display, but then I remembered that the display pins are the same pins as the JTAG interface. I had already considered this, and switched to the ISP interface for programming the device. However, I did not reset the AVR Fuse for JTAGEN. This must be disabled in order for the display pins to work in the normal mode. ARG… So then I disabled the fuse, reconnected the OLED display, and reloaded the test code. Voila! It works! (Video coming soon…)

So now I switch back to my main project to re-integrate the display initialization routines into my project and write some code to print to the display. On my long list of to-do items is to create a menu of sorts and wire up the button’s to display the proper screen or information according to function.

SSD1325 datasheet