Go Down

Topic: U8glib: Graphics Lib for LCDs and OLEDs (Read 54 times) previous topic - next topic

andrew-d

I'm sorry I've stuffed up some of the information I've presented. I'm attempting to correct it now. v12 is very wrong sorry about that.

The older flickr photos were using v1.04 and "U8GLIB_DOGM128 u8g(13, 11, 10, 9);". I modified this to add contrast from another device (I think U8GLIB_DOGM132 but cannot remember). The photo of it working perfectly was after I messed around with the reset pin and resting the Arduino. It was not easily repeatable. Leaving me to believe perhaps timing was involved in the problem.

The current flickr photos use the newer v1.08 U8glib. It's my opinion the U8GLIB_DOGM132 device would be a good starting point as it has the contrast code and only two minor issues.


olikraus

Hi

I have attached a version of u8glib with support for the MINI12864:
Code: [Select]
U8GLIB_MINI12864 u8g(13, 11, 10, 9);                    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
It has been derived from the DOGM132 with adjusted dimensions.

Please let me know if this is ok or if some other adjustments are required.

Oliver


andrew-d

Thank you Oliver!

I will test this out and post photos of the result as soon as I can.

andrew-d

The device U8GLIB_MINI12864 is close. Thank you. The image is still shifted five pixels to the left, with the far right edge filled with garbage pixels. Contrast is set and works but seems to be fixed.

I've attempted to read the source code and the datasheets registers and I must admit I don't understand what I'm looking at. For what it's worth I think this is the datasheet for the controller http://www.lcd-module.de/eng/pdf/zubehoer/uc1701.pdf

However I did experiment with the u8g_dev_uc1701_mini12864.c file. I messed with this line
Code: [Select]
  0x0a1, /* ADC set to reverse. Was a0 now a1 */

I found if I change this value from "a0" to "a1" the image is reversed but does not have pixels shifted.

I also played with this device:
Code: [Select]
U8GLIB_LM6059 u8g(13, 11, 10, 9);                    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

It does not have contrast adjustment (image is almost impossible to view) and has the top and bottom of the image swapped, but again the pixels are not shifted.

I will post photos shortly.

andrew-d

#79
Oct 22, 2012, 01:06 pm Last Edit: Oct 22, 2012, 02:15 pm by andrew-d Reason: 1
More progress. It works as it should if I use:
Code: [Select]

Line 51:  0x0a0, /* ADC set to reverse */
Line 52:  0x0c8, /* common output mode */
Line 60:  0x027,          /* contrast value, EA default: 0x01f */


"c8" Flips the screen 180 and so far appears to work without fault. I'm guessing this is the proper or intended orientation. The contrast value just makes the screen a little easier to read. Note I also returned ADC to "a0".

I feel a little stupid. I've just re-read some of this the messages in this thread and I must have missed at least page 4. It's the same typical types of issues. I feel I should have experimented more before asking for help.

Here's the photos:
http://www.flickr.com/photos/andrew-d/8112363433/in/photostream
http://www.flickr.com/photos/andrew-d/8112371880/in/photostream

It would be nice to be able to control the contrast within the main program but I'm unsure how to do this.

My next change is fonts like koyaanisqatsi posted. I'd like to be able to draw my own as bitmaps and then convert to fonts. I can draw fonts no problem (I have very small and very large fonts in mine for a specific project) but I'm lost on converting them. I need fixed height and widths and some only numbers.

Updated with more info

Go Up