cancel
Showing results for 
Search instead for 
Did you mean: 

NHD-C12832A1Z with the STM32F103

Maddi.Mike
Associate II
Posted on March 30, 2013 at 18:41

I need some help. I have a board with a STM32F103CB micro and an NHD-C12832A1Z 128x32 pixel graphic LCD display with built in ST7565R controller. My problem is that I can not get the display to display anything. The LCD is connected to use the SPI pins of the micro. I tried the example code from ''NHD-C12832A1Z with ST7565C'' from this link

http://www.newhavendisplay.com/app_notes.html

and it does nothing. I am at my wits end. I need example code specifically for my application. Can someone please help? I can supply you with the schematic. Thanks.
6 REPLIES 6
frankmeyer9
Associate II
Posted on March 30, 2013 at 19:28

Could you verify the SPI communication ?

I mean, have you measured at the display, and compared with the datasheet ?

I don't have experience with those ST7565R chips, but other graphics display drivers have some register one could read out, like an ID register returning a chip-specific value. That would be a proper proof you can actually access it.

Have you checked the schematics ? Maybe some other circuitry is connected to your SPI pins. You could configure them as GPIO and do some static level test. I had such a case recently, also with SPI (NSS) involved. Changing the pin solved the problem.

I had spent long hours with other chips, so I could understand you pain...

Maddi.Mike
Associate II
Posted on March 30, 2013 at 19:53

Thanks for your reply. I have scope leads on the MOSI and SPI clock pins at the LCD and they look fine. I can see the actual data I am sending and the clock. So do the chip select, reset, and A0 lines. All look good. The only thing I can manage to do is turn on the back light. But that's not a SPI function. It's simply a GPIO output high or low.

frankmeyer9
Associate II
Posted on March 30, 2013 at 20:33

I can see the actual data I am sending and the clock. So do the chip select, reset, and A0 lines. All look good.

 

Not that I haven't expected this...

But does it match the ST7565 spec. ?

Have you tried to slow down the SPI speed ?

And often, this graphics driver need relative long delays during power up, to get all those internal voltage converters up to level. Often in the range of 10 .. 100ms.

And additionally, the sequence of initialization steps is rather critical.

One might not always find a C example for the STM32. I have sometimes used examples for PIC/AVR controllers, even in BASIC, as template.

As said, I don't have an example for this chip ready. But I believe I've seen examples at Adafruit, at least for similiar drivers.

Anyway, Happy Easter !

Maddi.Mike
Associate II
Posted on March 30, 2013 at 20:37

Thanks for you help. I'm going to try a few other things. Check the specs again. Maybe resort to bit banging instead of the SPI until I get it going. You have a happy Easter too.

jj2
Associate II
Posted on March 30, 2013 at 22:02

Feel your pain - and second fm's suggestions.

Usually - with such displays - one pin is devoted to contrast control.  Can you see your pixel field?  If not - it is possible that misunderstanding or mis-set of this contrast pin's voltage requirement is your ''sole'' issue.

In the past - this voltage was most always ''negative'' with respect to ground.  Recently - many of these contrast requirements have changed to ''positive'' - but it is still likely to be in excess of all other display voltages - normally confined to 5V or 3V3 (newest).

That firm also has forum - perhaps others have noted your issue - and received factory guidance.  Surely worth a look.

Final point - have yet to use that display controller - but very often there is a data bus as well - and those pins must be properly terminated - even if only SPI is the selected interface.  Dawns now that there may also be an ''SPI/serial'' select pin - which enables SPI - again I'm uncertain - and again worth your checking...

Maddi.Mike
Associate II
Posted on March 31, 2013 at 15:40

Some very good suggestions. I recall now some years back I did have a contrast problem with a totally different LCD and controller. I recall the display was actually working but I couldn't see anything because of the contrast. I will have a look again at all that stuff in addition to your other suggestions. I really appreciate your help. Thanks again and happy Easter.