Jump to content

gdispFillCircle does not draw correctly


ibelimb

Recommended Posts

Hello,

I am working on uGFX on a STM3240G-EVAL with ILI9325 LCD driver (I did have to modify the driver init registers to get the screen to work properly). I now have the screen working but using gdispFillCircle does not draw properly (regular circles render fine). Is there any reason why this would happen?

Corrupted filled circle:

http://i.imgur.com/X9hQ3f2.jpg

Correctly rendered circle:

http://i.imgur.com/2FNNpAL.jpg

Thanks,

Kenneth

Link to comment
Share on other sites

Hello Kenneth and welcome to the community!

I just verified that the gdispFillCircle() function is working as expected. Therefore, this must be an issue inside the driver that you are using.

As every drawing function in uGFX, the gdispFillCircle() function will try to use hardware acceleration wherever possible. As the ILI9325 doesn't support hardware acceleration for circle drawing, it will rely on using hardware fills (gdisp_lld_fill_area()) or streaming (gdisp_lld_write_xxx()). Looking at the current state of the ILI9325 it seems like it doesn't support hardware filling either. Therefore, the problem must be inside the streaming function. To verify this, you can disable the hardware streaming support in the drivers configuration file (/drivers/gdisp/ILI9325/gdisp_lld_config.h). You should then be able to draw filled circles without any artifacts.

Once you confirmed that that's the problem, the next step will be to figure out whether the problem is inside the actual driver itself or in your board file. As there's not much happening for hardware streaming in the driver itself (it's just wrapping the calls), the problem will be most likely in your board file.

I hope that helps. Please do not hesitate to ask should you have any other questions.

~ Tectu

Link to comment
Share on other sites

Looking at the ILI9325 driver, I suspect that your initialisation sequence is not totally correct as the driver is commonly used and usually works without flaw.

As you needed to alter the initialisation sequence, other than for bus width or scan rate and those sorts of issues, perhaps your device is not really a ILI9325 but a "compatible" chip. Once of the other ILI93XX drivers may then be a better fit for your hardware. This sort of problem is not uncommon.

Another thing to try is - In the gdisp_lld_config.h file in the driver directory try commenting out the following settings...

GDISP_HARDWARE_STREAM_POS and GDISP_HARDWARE_CONTROL

If it works with those settings turned off then it is definitely a chip compatibility issue. If it doesn't work with those settings turned off then it highly likely to be an initialisation problem. In particular look at the scan direction registers as the difference between a circle and a filled circle has to do with setting a single point versus setting a stream of points to form a line. I suspect that your scan direction is reversed.

Link to comment
Share on other sites

I commented out the lines as suggested and the problem persisted so I did some more research and it appears these boards come with two different LCD's, one which uses a ILI9320, and one which uses the ILI9325. Switched to the ILI9320 and everything works perfectly now. Thank you for the help!

Link to comment
Share on other sites

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