2..4" RED lcd touch screen 9328 calibration....how to do???

Hi

My old 2.4" LCD broke and I got 2 of these instead.

Trouble is that although they look very similar, they have a different controller (9328 I think) and the mcufriend libraries don't seem to work with them.

I have managed to get them to work with the adafruit library, but I cannot find a way to calibrate the the thouch points and they are quite a bit off!

Can anyone here who might know these boards and have them working help me out please?

S.

If the shields are "new" I would be very surprised if they contain an ILI9328.

In fact my MCUFRIEND_kbv Library has never supported 0x9328 because no one has ever asked for it.
Run the LCD_ID_readreg sketch. Copy-paste the output from the Serial Terminal.

David.

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 93 28 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 00 00 00 Status Register
reg(0x000A) 00 00 Get Powsr Mode
reg(0x000C) 00 00 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 00 00 00 00 Display Control
reg(0x00B7) 00 00 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 00 NVM Read
reg(0x00D3) 00 00 00 00 ILI9341, ILI9488
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-P
reg(0x00E1) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-N
reg(0x00EF) 12 31 12 31 12 31 ILI9327
reg(0x00F2) 00 00 00 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

Might be a ili9327? But adafruit id's it as a 9328 ?

Thanks for the reply! :slight_smile:

Woo-hoo. You have an ILI9328.

I will add it to my library. It will be exactly like an ILI9325. Perhaps you could run my graphictest_kbv sketch with tft.begin(0x9325)

Report back if the software scroll does not work. Wrong colours, mirroring, ...

David.

david_prentice:
Woo-hoo. You have an ILI9328.

Is that good or are you being sarcastic? :confused: :confused: :confused:

Anyway, it worked! - I assume that the last page in the test is supposed to be negative? :confused:

But looking at the sketch there is no software scrolling happening. Maybe this controller dsoen't support it?

I did find a problem when I try the calibrate sketch I get.....

Arduino: 1.6.9 (Windows 7), Board: "Arduino/Genuino Uno"

WARNING: Category '' in library Audio is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library UIPEthernet is not valid. Setting to 'Uncategorized'
TouchScreen_Calibr_kbv:74: error: declaration of 'FreeSmallFont' as array of references

 extern uint8_t SmallFont[];

                          ^

exit status 1
declaration of 'FreeSmallFont' as array of references

Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Audio: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Ethernet: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\GSM: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Robot_Control: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Servo: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\WiFi: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Audio: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Ethernet: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\GSM: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Robot_Control: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\Servo: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information
Invalid library found in C:\Users\captain\Documents\Arduino\libraries\WiFi: 'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can you help with this now too please? :slight_smile:

Also, what does 'readPixel() reads as BGR' mean? (maybe blue, green,red)?

S>

No, I was just surprised. Like I was surprised when a real SPFD5408 controller appeared.

Most of these Red 2.4" or Blue 2.8" shields have an ILI9341 or similar controller nowadays.

I pointed you to a ZIP file with version 2.9.0
Your error refers to a Beta version 2.9.1 on GitHub.

Just comment out the extern uint8_t smallFont statement with the v2.9.1. Or use the v2.9.0 ZIP that I suggested. Or the v2.9.0 Release on GitHub.

David.

p.s. I don't have v1.6.9 of the IDE. It looks as if it is fussy about library directory formats. You probably do not need to worry. Those libraries are not being used in this project.
If the libraries are maintained, they will probably get updated to conform to the fussier Arduino library format.

Yes, it is wise to enable verbose compilation. You ignore most of it. Sometimes it is useful to copy-paste the orange messages.

Thank you!

I tried the calibrate_kbv with the font commented out and it compiles and loads, I used....

UTFTGLUE myGLCD(0x9325,A2,A1,A3,A4,A0);

...from the 320x240 utftglue demo settings..... But I only get a white screen. No little crosses to calibrate with.

I am sure you will know how to fix that! :slight_smile:

S>

I am guessing that you are using the Beta from GitHub.

You do realise that you have to force tft.begin(0x9325) whenever it finds an ID of 0x9328. i.e. edit UTFTGLUE.h to force 0x9325 if readID() finds 0x9328.

When I add 0x9328 as a supported chip, it will know what to do by itself.

David.

OK I'll wait till you have done what needs to be done! - Much less chance of me messing it all up! :wink:

I have a question though if I may......

Where does the little penguin image reside and how is it displayed? I am too thick to work it out from your sketch.

FYI the test on the 9328 takes 6.97s - Is that slow?

I'll have to keep checking the web site as this forum won't allow a change in email address to send forum alerts too! :o >:( >:( :confused:

Cheers

S>

I have updated the example UTFTGLUE sketches for SmallFont

I tried the Calibration with the default TouchScreen.h Library. It has an appalling response.
If you edit the TouchScreen.cpp library file for NUMSAMPLES to be 3, there is a dramatic improvement.

I have added instruction to #define NUMSAMPLES in the Calibration instructions.
After Calibration, try the Touch_shield_kbv sketch.

And added support for the ILI9328
So the v2.9.1 Beta on GitHub should work out of the box.

Yes, the Adafruit Tests take about 7 secs on a Uno.
The little Penguin is in the "icons.c" file.

The Colour Band should be evenly graded.
The Penguin should have his scarf on his right. (your left)
The Vertical Scroll UP is to the left in Landscape modes.
The "old" controllers like ILI9328 can only scroll the whole screen
Modern controllers can scroll a small Band.

David.

Thanks for the really fast work on this - top notch! :slight_smile:

The graphic test works OOTB now, but I have an issue with calibration. The touch is working as when I run touchscreen and view it in the serial window I can see the values changing. (seems logarithmic in the x axis!).... But when I run your calibrate, it won't see the initial touch to start the calibration.

The first time I run your calibration I did get some response, but never got to the end of the calibration routine as it always seemed to crash out. What does 'hold' mean in the middle of the screen. Is it hold on while the uno catches up or continue to hold the stylus on the screen longer to get a reading?

david_prentice:
The Colour Band should be evenly graded.

As good as I could expect from a cheapish screen! :wink:

david_prentice:
The Penguin should have his scarf on his right. (your left)

Yup, Penguin scarf is indeed on correct side! :slight_smile:

david_prentice:
The Vertical Scroll UP is to the left in Landscape modes.

This is correct too...

david_prentice:
The "old" controllers like ILI9328 can only scroll the whole screen

Bummer! - What controllers offer the best speed and features? (For the unlikely event that I feel rich in the coming winter and buy some more screens!)....
[/quote]

When you do the Calibration, you can see the individual points on the Serial Terminal.
If the values are not consistent, try again. Quite honestly, your calibration will come out with 150, 920
or 920, 150. i.e. get the directions correct and a rough guess like 150, 920 will be usable.

You can watch the X, Y values vary at the start of the Touch_shield_kbv sketch.

But most importantly, the <TouchScreen.h> library is not very good with its default NUMVALUES. Change from 2 to 3 and everything starts working nicely.

Oh, any of the MIPI controllers are good e.g. ILI9341. The ability to Vertical Scroll a sub area is very useful. e.g. a scrolling barometer graph or sound level (landscape). Or text in portrait.

Some panels are better quality than others. They should all give a crisp bright display. Even the older ones.

David.

NUMVALUES has been changed to 3.

TouchScreen from adafruit works and shows the values. Touch_shield_kbv and TouchScreen_Calibr_kbv do not detect any press on the screen. I even tried to force the lcdbegin to 0x9325 but still no luck.

I do not see individual points on the screen as you first need to 'press' the screen for these to show and it does not detect any presses at that time.

Any ideas? :confused:

UPDATE...touch calibration is working again now, not sure why that is, but it still seems to not see some presses and therefore does not allow completion of the calibration routine. I'll keep trying though.

UPDATE2...TouchScreen now gives....
Found unknown LCD driver
ID=0x9328
Screen is 240x320
Calibration is:
LEFT = 920 RT = 150
TOP = 940 BOT = 120
Wiring is: PORTRAIT
YP=15 XM=16
YM=7 XP=6

So maybe it isn't picking up the correct controller still?

Have you identified which are the XM, XP, YP, YM pins?

Remove the shield. Measure the resistance between pins with a multimeter.
X is generally about 300R. Y is about 500R.

I am sorry that you are having such a struggle. There must be 2.4" red shields with maybe 15 different controllers. There are probably only two schemes for the Touch panel. But X, Y can be swapped. i.e. 4 different combinations. Look at some of the arrangements in Touch_shield_kbv.ino

Before you get too distressed, bear in mind that many Ebay vendors are downright mendacious. Others are just more experienced with lingerie sales. You do not get a lot of help.
Most 'other' libraries only support one or two controllers. And they seldom distinguish themselves from the genuine Adafruit_TFTLCD library.

Please let me know if you succeed. Especially since your ILI9328 shield seems to have come back on the market.

David.

Hello
please add you project and library for ILI9328 here.

The v2.9.1-Beta version of the library supports twenty three 240x320 Shields. ILI9328 is one of them.

I am very surprised to hear that there are shields with ILI9328 in July 2016. When did you buy yours?
Please post a link to where you bought your shield.

No, I am not going to add anything here.

David.

Hi David,

Just wanted to get back to you on this as I now have it working! :slight_smile:

YP = A2;
XM = A3;
YM = 8;
XP = 9;

Calibration is:
LEFT = 207 RT = 887
TOP = 178 BOT = 897
Wiring is: SWAPXY
YP=16 XM=17
YM=8 XP=9

This is the answer! - Easy when you know how! :wink:

Anyway, althought it now can be calibrated to the above values, I get a random colour change on the touchscreen_shield.kbv sketch. If I select a colour and tap on the screen with a stylus, the colours randomly change and occasionally I get several dots appear on the screen at once. Is this due to a cheap/defective panel?

Cheers :slight_smile:

I suggest that you set NUMSAMPLES to 3.

Touch is always going to be a bit subject to ‘noise’. It is worth checking for a stable “touch”.

If you are simulating buttons, you need to take a similar approach to debouncing regular mechanical push-switches.

If you are simulating Michaelangelo, you probably want a fast response.

David.

OK thanks.

Numsamples was at 3. I also tried 2,5,6,9 with not much change.
I also increased MINPRESSURE in stages up to 300 (where it wouldn’t work at all) and now have it set at 260 with MAXPRESSURE still at 1000. Seems to be a little better here, but I wouldn’t trust it in a cockpit! :wink:

Again, thanks for the help in getting this far. I have some more to learn now.

Whilst you are here, can you forsee any problems sharing the SPI between the LCD touch panel and a NRF24L01+ radio trasnciever?

This will be the next thing to try for me, but not until the weekend at the earliest (unless I get some time tomorrow, which I am not expecting at the moment!)…

You have a regular Uno shield with a Resistive Touch Panel.
The microSD uses the SPI pins. If you don't have an SD, there is nothing to interfere with the NRF.

A NRF24L01 is a 3.3V device. As long as you keep the levels correct, it should work fine.
e.g. VCC must be 3.3V but the NRF GPIO pins are 5V tolerant (providing VCC = 3.3V)

I think you will struggle with finding enough pins on a Uno for the NRF. e.g. 4 SPI pins + A5 for the IRQ input.

David.