Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILI9342 driver #150

Open
nbonniere opened this issue May 19, 2021 · 7 comments
Open

ILI9342 driver #150

nbonniere opened this issue May 19, 2021 · 7 comments

Comments

@nbonniere
Copy link

I have been trying to modify the ILI9341 driver to make an ILI9342 driver but I am not successful so far. There is a blank area on the right when in landscape mode and an blank area at the top when rotated 90 deg. Can't seem to find a register that would explain this offset. Would you have time to generate a proper ILI9342 driver ?

@slorquet
Copy link

slorquet commented Jan 26, 2023

Hi,

Where did you find this screen? in the m5stack? I have made a working driver for it. I'll send a pull request.

edit: Sorry I did not find this issue sooner!

@slorquet
Copy link

slorquet commented Jan 26, 2023

Well in fact I did it before and it is still not pushed upstream.

Do you have this problem? #100
Is this what you need? olikraus/Ucglib_Arduino#23

@nbonniere
Copy link
Author

Yes, it was for the M5stack, and yes it was a blank area as problem #100. I managed to eventually modify the ILI9341 driver and create an ILI9342 driver that works.

@nbonniere
Copy link
Author

I updated my fork with my code. Match is very close, except for UCG_VARX and UCG_VARY. Not sure which is right (?)
https://github.com/nbonniere/ucglib

@slorquet
Copy link

slorquet commented Jan 27, 2023

I like the ILI9342 name instead of my use of m5stack. I had doubt the ILI9342 was the chip name for the portrait screen but I see new docs now and it seem to be the right choice.

I had a look at the differences:
For UCG_VARX we do EXACTLY the same:

 me:  UCG_C10(0x02a),	UCG_VARX(8,0x01, 0), UCG_VARX(0,0x0ff, 0), UCG_A2(0x001, 0x03f),		/* set x position */
you:  UCG_C10(0x02a),	UCG_VARX(8,0x01, 0), UCG_VARX(0,0x0ff, 0), UCG_A2(0x001, 0x03f),

But for UCG_VARY:

 me:  UCG_C10(0x02b),	UCG_VARY(8,0x01, 0), UCG_VARY(0,0x0ff, 0), UCG_A2(0x000, 0x0ef),		/* set y position */
you:  UCG_C10(0x02b),	UCG_VARY(0,0x00, 0), UCG_VARY(0,0x0ff, 0), UCG_A2(0x000, 0x0ef),	

I have no idea what the differences are.

These are the definitions from ucg.h

/* access procedures to ucg->arg.pixel.pos.x und ucg->arg.pixel.pos.y */
#define UCG_VARX(s,a,o)				0x0a0 | ((s)&15), (a), (o)
#define UCG_VARY(s,a,o)				0x0b0 | ((s)&15), (a), (o)

I have used the same values in varx and vary by symmetry, what was your reason to use s=0 and a=0 instead?

@nbonniere
Copy link
Author

I reversed what was used in the 9341 since X is swapped with Y in the 9342. Pure guess at this time, and display works OK, so I didn't check further.

  • 9341
    UCG_C10(0x02a), UCG_VARX(0,0x00, 0), UCG_VARX(0,0x0ff, 0), UCG_A2(0x000, 0x0ef), /* set x position /
    UCG_C10(0x02b), UCG_VARY(8,0x01, 0), UCG_VARY(0,0x0ff, 0), UCG_A2(0x001, 0x03f), /
    set y position */
  • 9342
    UCG_C10(0x02a), UCG_VARX(8,0x01, 0), UCG_VARX(0,0x0ff, 0), UCG_A2(0x001, 0x03f), /* set x position /
    UCG_C10(0x02b), UCG_VARY(0,0x00, 0), UCG_VARY(0,0x0ff, 0), UCG_A2(0x000, 0x0ef), /
    set y position */

@slorquet
Copy link

OK, makes sense, and thanks. I hope your driver gets integrated. It is frustrating that this project is not maintained anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants