DOGM132-4 LCD reset trouble [fixed] - Page 1
Forum section: electronics / projects

author: frank26080115
author_rank: Regular Contributor
timestamp: January 18, 2011, 03:47:08 am
content: 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 likeCode:cbi(PORTD, 3); // reset_delay_us(50);sbi(PORTD, 3); // release_delay_us(50);lcd_sendChar(0b01000000, 0); // display start line 0lcd_sendChar(0b10100000, 0); // ADC reverse for upside downlcd_sendChar(0b11001000, 0); // common mode reverse (for upside-down)lcd_sendChar(0b10100110, 0); // display normal orderlcd_sendChar(0b10100010, 0); // set LCD bias to 1/9 (duty 1/33)lcd_sendChar(0b00101111, 0); // pwr ctrl: booster, reg, and follower onlcd_sendShort(0xF800, 0); // set internal booster to 3x/4xlcd_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 animationThe manual is here:http://www.lcd-module.com/eng/pdf/grafik/dogm132-5e.pdfThere is another datasheet for the internal controller:http://www.lcd-module.com/eng/pdf/zubehoer/st7565r.pdfthis 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 disappearsA 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 thatone 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 problemI 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 differenceAttempting 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 currentI 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

author: doctormord
author_rank: Regular Contributor
timestamp: January 18, 2011, 04:15:35 am
content: Cheers Frank,http://www.lcd-module.com/eng/pdf/zubehoer/st7565r.pdfstarting page 60, there are the timings. But i assume, you already know this.

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 18, 2011, 04:25:02 am
content: sounds like startup or reset issue.

author: frank26080115
author_rank: Regular Contributor
timestamp: January 18, 2011, 07:33:47 am
content: 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 completelyfound herehttp://code.google.com/p/dogm128/source/browse/libraries/Dogm/utility/dogm128.c

author: frank26080115
author_rank: Regular Contributor
timestamp: January 18, 2011, 07:59:52 am
content: WOOOWdisregard my post, i found the problem, it doesn't have to do with the display at allworking perfectly now every timethe 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