Jump to content

Recommended Posts

Posted

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

Posted

Hi!

Helped:

GDISP_REG = 0x0003;

GDISP_RAM = 0x1030; // for GDISP_DEFAULT_ORIENTATION == GDISP_ROTATE_PORTRAIT

immediately 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.

~ Tectu

my board HY-STM32 -- its a development board, display connetcted via FSMC.

Posted
Helped:

GDISP_REG = 0x0003;

GDISP_RAM = 0x1030; // for GDISP_DEFAULT_ORIENTATION == GDISP_ROTATE_PORTRAIT

immediately 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

Posted
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?

Posted

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

Posted

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 directory
compilation terminated.
make: *** [build/obj/gdisp_lld_ILI9325.o] Error 1

I 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.

Posted

If I replace

#include "drivers/gdisp/ILI9325/gdisp_lld_config.h"

with

#include "gdisp_lld_config.h"

I get

Compiling 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 directory
compilation terminated.
make: *** [build/obj/gdisp_lld_ILI9325.o] Error 1

I can't find a file called driver.h anywhere.

I can't test a driver that I can't compile. :cry:

Posted

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

Posted

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. :D The only problem is that I am not sure how much time I can devote to this issue.

Posted
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/

Posted

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

Posted

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 OK

STM32F4-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

Posted
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.

Posted
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.

Posted
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 correctly

image has been mirrored

I attach a simple demonstration project with a working driver for my LCD.

Posted

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

Posted

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 :-)

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...