shilow Posted April 2, 2014 Report Share Posted April 2, 2014 Hi!I try to connect devboard HY-STM32F103VE to µGFX with ChibiOS/RT. This board contains LCD with ILI9325 controller.To some extent, I got it.I use current µGFX from GIT.The Startup logo shows OK, but my graphics and text -- no:documents-export-2013-07-29.zipHY-STM32F103VE.7z[/attachment]What could be the problem? Perhaps there is another controller installed?HY-STM32F103VE.7z Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 2, 2014 Report Share Posted April 2, 2014 This happens sometimes. Please try the following three things in that order: Try all four orientations using gdispSetOrientation(). It already occurred several times that suppliers used different versions of the ILI93xx chip. For example, some claimed to sell ILI9325 displays but what was really delivered was an ILI9320. Please make sure that you got the correct one. You can read out the display controllers revision register (datasheet). Usually you get some demo code shipped with the display. If none of the above lead to a positive result, please swap the initialisation code inside /drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c with the one from the demo code. Look for the gdisp_lld_init() function.One more thing: How does your hardware setup look like? Is it a PCB or some breadboard setup? I'm curious that the filling options appear to work correctly. This could mean that there is noise on the bus. Are you using SPI or FSMC? You could also try to lower your bus frequency should the points above not work.~ Tectu Link to comment Share on other sites More sharing options...
shilow Posted April 4, 2014 Author Report Share Posted April 4, 2014 Hi!Helped: GDISP_REG = 0x0003; GDISP_RAM = 0x1030; // for GDISP_DEFAULT_ORIENTATION == GDISP_ROTATE_PORTRAITimmediately after gfxInit();with GDISP_ROTATE_LANDSCAPE and 0x1038 -- image flipped vertically.This happens sometimes. Please try the following three things in that order: Try all four orientations using gdispSetOrientation().gdispSetOrientation() -- spoils the image It already occurred several times that suppliers used different versions of the ILI93xx chip. For example, some claimed to sell ILI9325 displays but what was really delivered was an ILI9320. Please make sure that you got the correct one. You can read out the display controllers revision register (datasheet).it really ili9325 Usually you get some demo code shipped with the display. If none of the above lead to a positive result, please swap the initialisation code inside /drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c with the one from the demo code. Look for the gdisp_lld_init() function.initialisation code the same -- one to one.One more thing: How does your hardware setup look like? Is it a PCB or some breadboard setup? I'm curious that the filling options appear to work correctly. This could mean that there is noise on the bus. Are you using SPI or FSMC? You could also try to lower your bus frequency should the points above not work.~ Tectumy board HY-STM32 -- its a development board, display connetcted via FSMC. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 7, 2014 Report Share Posted April 7, 2014 Helped: GDISP_REG = 0x0003; GDISP_RAM = 0x1030; // for GDISP_DEFAULT_ORIENTATION == GDISP_ROTATE_PORTRAITimmediately after gfxInit();with GDISP_ROTATE_LANDSCAPE and 0x1038 -- image flipped vertically.I'm a bit confused - Does this mean that you got it working?~ Tectu Link to comment Share on other sites More sharing options...
shilow Posted April 7, 2014 Author Report Share Posted April 7, 2014 I'm a bit confused - Does this mean that you got it working?Yes, in portrait mode, it works.In landscape mode also works, but the image is upside down.Did you suggest what else can I try? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 7, 2014 Report Share Posted April 7, 2014 There are two bits (AM and I/D) which control the orientation of the display. You can find them in the datasheet (PDF) on page 54.It looks like they have not been set correctly. Can you please change them and report the correct settings back to us / pull request a patch?Edit: Have you seen this?~ Tectu Link to comment Share on other sites More sharing options...
shilow Posted April 7, 2014 Author Report Share Posted April 7, 2014 I think I found the reason.Revised driver: Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 7, 2014 Report Share Posted April 7, 2014 I sadly don't have any ILI9325 display myself. I'll PM the guy from the other thread so he can give your reworked driver a try. If it doesn't work for him, we'll have to create two drivers as you suggested.Thank you very much for your contribution!~ Tectu Link to comment Share on other sites More sharing options...
xlh1460 Posted April 8, 2014 Report Share Posted April 8, 2014 I was unable to reply to your PM.I should be able to try the driver in the morning. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 8, 2014 Report Share Posted April 8, 2014 What exactly was the issue with the PM?Thank you very much for trying the driven is advance.~ Tectu Link to comment Share on other sites More sharing options...
xlh1460 Posted April 8, 2014 Report Share Posted April 8, 2014 When I checked last night there was no button to reply and when I tried to compose a new PM I got a message saying that I wasn't allowed.It seems to be working now.I may need some help getting a project set up to test this.I downloaded the driver but when I tried to use it in one of my existing projects I get the following:Compiling gdisp_lld_ILI9325.c../../ext/ugfx/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c:23:52: fatal error: drivers/gdisp/ILI9325/gdisp_lld_config.h: No such file or directorycompilation terminated.make: *** [build/obj/gdisp_lld_ILI9325.o] Error 1I don't really want to start messing around with the driver itself so I may need to adjust the paths that I am using.My projects are all in subdirectories under the $(CHIBIOS)/demos directory. Link to comment Share on other sites More sharing options...
xlh1460 Posted April 8, 2014 Report Share Posted April 8, 2014 If I replace#include "drivers/gdisp/ILI9325/gdisp_lld_config.h"with#include "gdisp_lld_config.h"I getCompiling gdisp_lld_ILI9325.c../../ext/ugfx/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c:25:30: fatal error: src/gdisp/driver.h: No such file or directorycompilation terminated.make: *** [build/obj/gdisp_lld_ILI9325.o] Error 1I can't find a file called driver.h anywhere.I can't test a driver that I can't compile. :cry: Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 8, 2014 Report Share Posted April 8, 2014 You should take your current working project and just replace the gdisp_lld_ILI9325.c file inside /drivers/gdisp/ILI9325 (You should back up your current one). Everything should compile just fine then assuming that your current project with the current driver compiles as well (Is that the case?).I'm currently not able to test it. Probably shilow can help.Thank you very much for your time guys. It helps us a lot to improve the quality of the project.~ Tectu Link to comment Share on other sites More sharing options...
xlh1460 Posted April 9, 2014 Report Share Posted April 9, 2014 Yes that is what I expected. I replace my existing driver with the one that shilow provided.I had some issues getting that to compile.I needed to adjust some of the include statements for incorrect path and non-existent header files (driver.h)I also needed to replace gdispColor2Native() and gdispNative2Color() with COLOR2NATIVE() and NATIVE2COLOR().Now it compiles fine but it doesn't seem to initialize my display correctly.p.s. The "good news" is that it turns out that my "working" ILI9325 driver has the same issue as shilow is having. Anything other than GDISP_ROTATE_0 doesn't display correctly. It's good news because now I am more motivated to fix the damn thing. The only problem is that I am not sure how much time I can devote to this issue. Link to comment Share on other sites More sharing options...
shilow Posted April 9, 2014 Author Report Share Posted April 9, 2014 I needed to adjust some of the include statements for incorrect path and non-existent header files (driver.h)it is standart include in gdisp_lld_ILI9325.c#include "src/gdisp/driver.h"that refers to the file in ugfx/src/gdisp/ Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 9, 2014 Report Share Posted April 9, 2014 I don't understand why it doesn't compile for you either as the file includes the same headers. I'm sadly not able to compile it myself before the weekend and I still couldn't try it as I don't have such a display.However, when I understand you guys correctly - we need two separate drivers?~ Tectu Link to comment Share on other sites More sharing options...
xlh1460 Posted April 9, 2014 Report Share Posted April 9, 2014 I fought with this most of the day and I think I may have it worked out.I started with the driver that shilow had provided it and "fiddled" until it seemed to work for all four orientations.I have tested this on two boards and three displays and it seems OK. STM3241G-EVAL -> FSMC Interface -> Built-in 3.2" display with 9325 chip. Tested OKSTM32F4-Discovery -> SPI Interface -> HY28B display with 9325 chip (X2) Tested OK.STM32F4-Discovery -> SPI Interface -> HY28B display with 9328 chip. Not working.I am pretty sure that my old driver worked on both the 9325 and the 9328 chips before so I need to dig further into that issue.The code could stand some cleanup and more testing but I am much happier now.ILI9325.zip Link to comment Share on other sites More sharing options...
xlh1460 Posted April 9, 2014 Report Share Posted April 9, 2014 STM32F4-Discovery -> SPI Interface -> HY28B display with 9328 chip. Not working.This is working now, sort of. I think I am having wiring or timing issues on the SPI.Stepping through the code, the chip id is now being read as 9329, not 9328.Whatever is causing that apparently didn't mess with the 9325 id because it's LSB is set anyway.The driver appears to be fine. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 10, 2014 Report Share Posted April 10, 2014 Glad to hear that you got it working! Shilow, could you give the driver attached in xlh1460s post a final try? We'll replace the one in the repository then.~ Tectu Link to comment Share on other sites More sharing options...
shilow Posted April 10, 2014 Author Report Share Posted April 10, 2014 Glad to hear that you got it working! Shilow, could you give the driver attached in xlh1460s post a final try? We'll replace the one in the repository then.Yes, I'll check it out today. Link to comment Share on other sites More sharing options...
shilow Posted April 10, 2014 Author Report Share Posted April 10, 2014 Glad to hear that you got it working! Shilow, could you give the driver attached in xlh1460s post a final try? We'll replace the one in the repository then.to successfully launch I had to change the reset procedure and add the initialization section for "Devicecode == 4532"screen rotation function did not work correctlyimage has been mirroredI attach a simple demonstration project with a working driver for my LCD. Link to comment Share on other sites More sharing options...
xlh1460 Posted April 10, 2014 Report Share Posted April 10, 2014 It sounds like it should be a separate driver for the 3 reasons you listed:- device code is not 9325- initialization sequence is different- screen is mirrored Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 11, 2014 Report Share Posted April 11, 2014 If it's only about a few register values due to different revisions of the chip, we can also just read out the chip ID and handle it differently. Here's an an example.~ Tectu Link to comment Share on other sites More sharing options...
shilow Posted April 11, 2014 Author Report Share Posted April 11, 2014 changes are needed not only in the initialization procedure, but also in the functions to rotate the screen.variable Devicecode need to do a global?in any case, it should make the programmer, not the hobbyist :-) Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted April 11, 2014 Report Share Posted April 11, 2014 Well in that case we're going to need two separate drivers indeed. Could you guys provide a working drives which works correctly in all four orientations so they can be added to the repository? Please find out the correct controller name and revision.~ Tectu Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now