• Welcome to Andy's Workshop Forums. Please login or sign up.
 
March 28, 2024, 05:16:45 am

News:

SMF - Just Installed!


Interfacing the STM32f4 with the HX8352a

Started by kdgwill, April 15, 2015, 07:36:23 pm

Previous topic - Next topic

kdgwill

April 15, 2015, 07:36:23 pm Last Edit: April 19, 2015, 04:25:23 pm by Kyle D. Williams
I have started a hardware project in which I am attempting to connect an LCD to the STM32F407 board. The display controller is an HX8352a.I've been having difficulty producing anything worthwhile on the screen however. I've tried converting a handful of arduino code to the board but it seems the lcd screen responds to nothing besides switching the backlight on or off, does anyone have any suggestions on anything i can do to get some event from the screen?

Andy Brown

Quote from: Kyle D. Williams on April 15, 2015, 07:36:23 pm
I've started a hardware project in which I'm attempting to connect an LCD to the STM32F407 board. The display controller is an HX8352a.I've had been having difficulty producing anything worthwhile on the screen however. I have also seen on a lot of sites that the ports being used on the discovery board seem to vary. Can I ask if their is any reasoning to not simply have all of the data pins on the same port? Also I've tried converting a handful of arduino code to the board but it seems the lcd screen responds to nothing besides switching the backlight on or off, does anyone have any suggestions on anything i can do to get some event from the screen?


Hi Kyle, The HX8352A is a controller that I have used in the past and I know that it can be driven by the F4 Discovery board. If you've read my article on the LG KF700 then you will have seen the video of it running on the F4 Discovery.

Are you using my stm32plus driver (see example)? If so then what are you seeing? How are you powering the board? The discovery has a maximum current limit of 100mA (see section 4.3 of UM1472). If your particular board is powering the backlight as well as the logic then you may be close to that limit.
It's worse than that, it's physics Jim!

kdgwill

Thank you Andy for the direction, I was originally attempting to use GPIO; however after finding your examples I have found FSMC to work well with my project. I've been able to get up and running using your well documented code. Everything seems to work okay; however, it seems when I run the original test code it halts somewhere inside of the textTest code. Also the screen's quality seems to be of poor quality compared to the ones in the example; I originally thought it to be an issue of the screen; however, on the arduino the screen looks a lot better. Are their any possible suggestions regarding quality?

Andy Brown

Quote from: Kyle D. Williams on April 19, 2015, 04:32:30 pm
Are their any possible suggestions regarding quality?


This could be the gamma or it could be one of the register settings that control the panel power and driving levels. It's easiest to try the gamma first. If your ST code has these two lines then simply delete them. Gamma settings are unique to the panel and it may be that yours has perfectly good default settings.

If that doesn't work we need to look at the driving settings. The settings I used were designed to be correct for the LG-KF700 phone and are in the initialise() method starting here. If you review the register values being set and compare them to those set by the Arduino initialiser then you should be able to spot where your panel is different.

As you can see from the interface definitions it is easy to create your own panel traits class with an initialise() method and declare a type to use it.
It's worse than that, it's physics Jim!

kdgwill

April 22, 2015, 03:47:12 pm #4 Last Edit: April 22, 2015, 04:05:18 pm by Devon Guyden
Thank you for creating such a detailed explanation of the problem and a great library. After going through the startup code that I had working on the arduino and testing it with the code for the LG_KF700 i have come to find that it is completely different.  I made a few changes and it worked immediately, including all of the tests (except for sleep which for some reason seems to permanently vertically flip the lzg tests and breaks the other ones, but not really an issue). Thank you for the help 

I have realised their was very little on the
tm032ldh05 using the HX8352 in either of the manuals about these values and even less about the steps required. Can I ask where does one normally find such information?


Andy Brown

Quote from: Devon Guyden on April 22, 2015, 03:47:12 pm
Thank you for creating such a detailed explanation of the problem and a great library. After going through the startup code that I had working on the arduino and testing it with the code for the LG_KF700 i have come to find that it is completely different.  I made a few changes and it worked immediately, including all of the tests (except for sleep which for some reason seems to permanently vertically flip the lzg tests and breaks the other ones, but not really an issue). Thank you for the help 


The sleep/wake issue is likely to be because some of the register contents are lost during the low power mode. It should be a simple enough job to reset them to their correct settings.

If you have a working initialise() method for your panel then I'd be happy to integrate into the library - feel free to post the modified code here and I'll work on the integration steps.

Quote
I have realised their was very little on the
tm032ldh05 using the HX8352 in either of the manuals about these values and even less about the steps required. Can I ask where does one normally find such information?


Finding complete panel information is much harder than finding the controller datasheet, as you've discovered. And often when you do find something it will be a badly photocopied paper sheet only partially translated from Chinese to English. I normally look for working sample code that shows the reset-initialise sequence. If you've got that then the rest usually falls into place.
It's worse than that, it's physics Jim!

kdgwill

Attached is the working initialise() method for the tm032ldh05 panel. I hope it's useful and I set it up in a way that should be easy to integrate into the stm32plus feel free to use it however you see fit. One note is that i included the gamma code into the initialise method, I did this only because the initial issue I had was with gamma. 

Andy Brown

Thanks very much Kyle, I appreciate that. It's now been integrated into the library and released in version 4.0.2.
It's worse than that, it's physics Jim!

kdgwill

It works great, I may have more to contribute, if acceptable, but at a later time.