Antonorosso / u8glib

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

add software reset to UC1701 controller #201

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
From the post about my nokia5110 replacement you might have seen that we have 
also developed another product called 'Industruino' (www.industruino.com) which 
also uses the u8glib.
On that project I had to find ways of limiting the amount of pins that the LCD 
screen and other peripherals took away from the atmega32u4. Therefore I delved 
in the UC1701 datasheet and read that I could tie the reset pin of the lcd to 
vcc, because the uc1701 has an internal reset circuit. I implemented this and 
when verifying my prototypes it seemed to work but sporadically I would have 
screens that didn't work properly. So after lengthy debugging I came to the 
conclusion that in order for the internal reset circuit to work you need to 
call the reset command in software. I added this line to your 
'u8g_dev_uc1701_mini12864.c' in the 'u8g_dev_uc1701_mini12864_init_seq' 
function:    0x0e2,      /* soft reset
After this small modification I haven't had any issues. I was wondering if it 
would be possible to incorporate this change in the next version of u8glib?

the complete init function then looks like this;

Code:
static const uint8_t u8g_dev_uc1701_mini12864_init_seq[] PROGMEM = {
  U8G_ESC_CS(0),             /* disable chip */
  U8G_ESC_ADR(0),           /* instruction mode */
  U8G_ESC_RST(1),           /* do reset low pulse with (1*16)+2 milliseconds */
  U8G_ESC_CS(1),             /* enable chip */

  0x0e2,                /* soft reset
  0x040,                /* set display start line to 0 */
  0x0a0,                /* ADC set to reverse */
  0x0c8,                /* common output mode */
  0x0a6,                /* display normal, bit val 0: LCD pixel off. */
  0x0a2,                /* LCD bias 1/9 */
  0x02f,                /* all power  control circuits on */
  0x0f8,                /* set booster ratio to */
  0x000,                /* 4x */
  0x023,                /* set V0 voltage resistor ratio to large */
  0x081,                /* set contrast */
  0x027,                /* contrast value */
  0x0ac,                /* indicator */
  0x000,                /* disable */
  0x0af,                /* display on */

  U8G_ESC_DLY(100),       /* delay 100 ms */
  0x0a5,                                /* display all points, ST7565 */
  U8G_ESC_DLY(100),       /* delay 100 ms */
  U8G_ESC_DLY(100),       /* delay 100 ms */
  0x0a4,                                /* normal display */
  U8G_ESC_CS(0),             /* disable chip */
  U8G_ESC_END                /* end of sequence */
};

Original issue reported on code.google.com by olikr...@gmail.com on 25 Sep 2013 at 7:35

GoogleCodeExporter commented 8 years ago
added for both uc1701 display devices

Original comment by olikr...@gmail.com on 3 Oct 2013 at 6:36

GoogleCodeExporter commented 8 years ago
verified with DOGS102

Original comment by olikr...@gmail.com on 3 Oct 2013 at 6:38