Author Topic: DOGM132-4 LCD reset trouble [fixed]  (Read 4024 times)

0 Members and 1 Guest are viewing this topic.

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
DOGM132-4 LCD reset trouble [fixed]
« on: January 18, 2011, 03:47:08 am »
I'm playing with a DOGM132-5 LCD, which is the same one Dave used in his credit card calculator.

The LCD is powered by 3.3V, I am using the example low voltage circuitry provided in the manual (several capacitors to utilize the LCD's built in boost converter)

Here's what my initialization roughly looks like

Code: [Select]
cbi(PORTD, 3); // reset
_delay_us(50);
sbi(PORTD, 3); // release
_delay_us(50);

lcd_sendChar(0b01000000, 0); // display start line 0
lcd_sendChar(0b10100000, 0); // ADC reverse for upside down
lcd_sendChar(0b11001000, 0); // common mode reverse (for upside-down)
lcd_sendChar(0b10100110, 0); // display normal order
lcd_sendChar(0b10100010, 0); // set LCD bias to 1/9 (duty 1/33)
lcd_sendChar(0b00101111, 0); // pwr ctrl: booster, reg, and follower on
lcd_sendShort(0xF800, 0); // set internal booster to 3x/4x
lcd_sendChar(0b00100011, 0); // v0 v-reg set (contrast set)
lcd_sendShort(0x811F, 0); // elec volume mode set (contrast set)

...

set page and column, start writing data for animation

The manual is here: http://www.lcd-module.com/eng/pdf/grafik/dogm132-5e.pdf

There is another datasheet for the internal controller:
http://www.lcd-module.com/eng/pdf/zubehoer/st7565r.pdf

this startup sequence is derived from the manual, except I have changed it slightly because I need to use my LCD in up-side-down mode. (it is important to note that my animation is being displayed in the correct mode every time, so I know that the set of commands I am sending is correct)

the problem is that this works only sometimes, when I can see a test animation I wrote become displayed on the screen. since the animation works, I can safely assume my SPI routines are ok, and I can also assume that my wiring is correct.

note that it works (animation being displayed) at first power on quite frequently (about 50% of the time, unplugging and replugging the main power will cause the animation to show), but hardly ever upon resetting my microcontroller.

if I see my animation and then press reset on my microcontroller, the screen goes blank, but my pattern is not re-written, the LCD appears blank and idle. The animation NEVER works twice in a row, interrupting the animation by pressing the reset button on the microcontroller will guarantee that the animation will not show up.

here's the really weird part, if I wait maybe a minute, and then press reset, it starts displaying my animation again, but if i press reset quickly, my animation disappears

A few more things to note:

as you can see, the function where I send two consecutive bytes is called lcd_sendShort, I'm not sure if I'm supposed to deselect and reselect the CS pin in between the two bytes. I tried without deselecting CS and the behaviour is worse, no animation is ever displayed.

there is nothing telling me the minimum time between commands, or the minimum period for which CS should be de-asserted before being re-asserted between commands. The DOGM model does not give me any read capability so I am unable to check the BUSY flag. Adding a 1 microsecond delay between commands does not help.

there is apparently a requirement for the power-on procedures to be completed within 5ms, but my timing should be within that

one concern is that I may have entered a two byte command sequence without exiting it by pressing reset at just the right moment, to counter this, I have tested the startup sequence with a NOP command, which is meant to exit any "waiting for 2nd byte" state, and it made no difference to my problem

I have also tried a combination of software (the LCD does have a soft-reset command) and hardware reset (toggle the reset pin) method, makes no difference

Attempting to measure the voltage outputted by the boost converter will cause the screen to go blank, which probably means my multimeter is sinking too much current

I do not have an oscilloscope to monitor the boost converter.

Another thing (irrelevant to my problem) that is frustrating is that the LCD's internal display RAM is not reset by the hardware reset or the software reset, which is actually a documented fact in the datasheet. This is super annoying as I have to manually for-loop to clear every RAM location manually.

edit: FIXED
« Last Edit: January 18, 2011, 01:28:16 pm by frank26080115 »
 

Offline doctormord

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
Re: DOGM132-4 LCD reset trouble
« Reply #1 on: January 18, 2011, 04:15:35 am »
Cheers Frank,

http://www.lcd-module.com/eng/pdf/zubehoer/st7565r.pdf

starting page 60, there are the timings. But i assume, you already know this.  :-[
#fine_arts & #electronics  - www.360customs.de
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: DOGM132-4 LCD reset trouble
« Reply #2 on: January 18, 2011, 04:25:02 am »
sounds like startup or reset issue.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: DOGM132-4 LCD reset trouble
« Reply #3 on: January 18, 2011, 07:33:47 am »
I tried copying an arduino library that does not de-assert CS between commands, but I did not have success displaying my animation at all.
The same library also neglects the reset pin completely
found here http://code.google.com/p/dogm128/source/browse/libraries/Dogm/utility/dogm128.c
« Last Edit: January 18, 2011, 07:37:27 am by frank26080115 »
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: DOGM132-4 LCD reset trouble
« Reply #4 on: January 18, 2011, 07:59:52 am »
WOOOW

disregard my post, i found the problem, it doesn't have to do with the display at all

working perfectly now every time

the problem was with SPI initialization, if SS pin on the ATmega was low, the SPI goes into slave mode even if you tell it to go into master mode, and I made the mistake of leaving SS floating
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf