2012-11-13 03:30 AM
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-display2012-11-13 04:07 AM
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.
2012-11-13 07:27 AM
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)2012-11-13 07:43 AM
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.'.
2012-11-13 07:53 AM
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.''2012-11-13 08:14 PM
Thanks fm
GPIO configuration file is missing in the code. And here is itvoid 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 thanks2012-11-14 12:43 AM
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.2012-11-14 03:08 AM
2012-11-14 04:22 AM
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.
2012-11-14 04:47 AM