cancel
Showing results for 
Search instead for 
Did you mean: 

ST7036 display interface with STM32

pranathi1091
Associate II
Posted on November 13, 2012 at 12:30

Hello All,

I am using ST7036 LCD controller. And i want to interface this with my STM32 board using 8 bit parallel interface.

My pin connection are as follows

E-PD9

RS-PD7

RW-PD8

And PortC0-C1 to data lines of LCD.

I have modified the available driver for ST7036 display.

But i could not find anything to be displayed.

i have attached the code.

Could anyone pls let me know where am i going wrong.

Thanks

#stm32 #interface-display
21 REPLIES 21
frankmeyer9
Associate II
Posted on November 13, 2012 at 13:07

I can't find any GPIO port initialization in the supplied code. Did you check that it works ?

Just take a voltmeter and single-step through the code with  the debugger. You should see the respective port pins change. And for completeness, you can verify that the sequence matches the datasheet specification.

 * #define EADOGMVDD  5   // 5v LCD Vdd

 

 * //#define EADOGMVDD  3   // 3.3v LCD Vdd

...

#define EADOGMVDD       5        // 5v LCD Vdd

 

Are you sure that works ?

You might need to add level shifters, if the display really needs 5 Volt.

I failed to get a 5V version of a HD44780 display working, so I switched to a 3.3V version.

jj2
Associate II
Posted on November 13, 2012 at 16:27

Responders advice seconded here.  One can never perform enough test/verification.  And indeed - as earlier responder stated - display initialization is most always required!

Usual suspect when no display pixels appear is misadjusted Contrast Voltage.  (often described as Vo)  Modern displays most always can achieve adequate contrast with this Vo voltage adjusted near 0V.  (gnd)  Older displays often required slight negative voltage on Vo - usually -2 to -3V works well.  (''7660'' +5V to -5V ''charge pump'' IC is eased, low-cost -5V generator)

In the case of a 5V HD44780 display - we've always found that a 3V3 MCU can properly drive data and control pins - usual culprit is misadjusted Vo voltage.   Running a 5V display with its power pin @ 3V3 will sometimes work (depends upon exact controller in use) - however the Vo voltage must usually be made negative to accommodate.  (again -2 to -4V should succeed)

frankmeyer9
Associate II
Posted on November 13, 2012 at 16:43

Running a 5V display with its power pin @ 3V3 will sometimes work (depends upon exact controller in use)...

 

That was a mistake on my side, I did not actually intend to run this ''mixture''.

Didn't read the datasheet careful enough.

One can never perform enough test/verification.  And indeed - as earlier responder stated - display initialization is most always required! ...

 

Usual suspect when no display pixels appear is misadjusted Contrast Voltage. ...

 

That is of course true.

But I assume the initial poster to have completed this steps, including 'reading the datasheets really carefully.'.

jj2
Associate II
Posted on November 13, 2012 at 16:53

Have not the faintest doubt that you (and I) really read datasheets.

Detail (really - lack of same) provided by poster led me to believe that any such ''assumption'' may not be, ''safe harbor.''

pranathi1091
Associate II
Posted on November 14, 2012 at 05:14

Thanks fm

GPIO configuration file is missing in the code.

And here is it

void GPIO_Configuration(void)

{

  GPIO_InitTypeDef GPIO_InitStructure;

 

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_Init(GPIOC, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

  GPIO_InitStructure.GPIO_Pin =GPIO_Pin_9|GPIO_Pin_8|GPIO_Pin_7;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_Init(GPIOD, &GPIO_InitStructure); Right now I am using 3.3 Volts.

I will step through the code and get back to you

thanks

frankmeyer9
Associate II
Posted on November 14, 2012 at 09:43

Do you enable the clock for GPIOC and GPIOD somewhere ?

At least not in the code provided.

If not, you won't see anything on the pins.

pranathi1091
Associate II
Posted on November 14, 2012 at 12:08

Yes they are enabled in the code.

Is there any specific delay which i need to set between write operations?

I have set 1 msec delay between all the commands I send.

frankmeyer9
Associate II
Posted on November 14, 2012 at 13:22

Yes they are enabled in the code.

 

 

So you should be able to see HL/LH transitions on the GPIO pins.

 

 

Is there any specific delay which i need to set between write operations?

 

I have set 1 msec delay between all the commands I send.

 

That information should come from the display data sheet.

For a 8 bit interface, I expect delays/stabilization times in the 10 .. 100ns range.

pranathi1091
Associate II
Posted on November 14, 2012 at 13:47

Yes i can see all the GPIOs working fine.

The problem is with my delay i guess. As per the datasheet it should be 20nano seconds which I am not doing.

Il try this and get back if there is any issue

Thanks