Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:46 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : ILI9341 3.2" LCD 16bit drivers for MM+

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 02:20am 01 Apr 2020
Copy link to clipboard 
Print this post

I have a matherp 470Backpack PCB with the 2x20 pin SSD1963 style LCD interface. I would like to try an ILI9341 3.2" LCD in 16 bit mode on that platform but can not find any 16bit drivers (or CFunction) - found an 8 bit CFunction but I would like to use the LCD in its default 16bit mode.

Can anyone point me to a 16 bit driver/CFunction for the ILI9341 3.2" LCD please?

Thanks,
panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 839
Posted: 04:57am 01 Apr 2020
Copy link to clipboard 
Print this post

Hi Panky,
I have one I wrote some time ago. I ran extra wires on  peters M70 backpack as shown below.



This shows the pins I used for B8-B15

#ifdef MX470
Option->LCD_Reset=28;
p[0]=60;
p[1]=61;
p[2]=62;
p[3]=63;
p[4]=64;
p[5]=1;
p[6]=2;
p[7]=3;
p[8]=14;
p[9]=13;
p[10]=12;
p[11]=11;
p[12]=17;
p[13]=18;
p[14]=21;
p[15]=22;


I will post it up if this is what you are doing. I have this board setup to get any P16 LCD working first before I try to configure as 8 bit.

Most can be converted to 8 bit with a bit of hacking. See this thread.
8 bit conversion

Regards
Gerry
Latest F4 Latest H7
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 02:58am 02 Apr 2020
Copy link to clipboard 
Print this post

Gerry,

I decided to go the 8 bit route initially before modifying the matherp backpack.

To that end, I moved the resister on the display as indicated and I have downloaded your 8bit CFunction.

Can you outline the sequence of loading and initialising this driver (I have loaded the ILI9341_p8 CFunction into the MM+ but am unsure as what do do to enable it and have it functional)

Thanks,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 839
Posted: 03:47am 02 Apr 2020
Copy link to clipboard 
Print this post

Hi Doug,
Put it in the mm.startup sub, create it if you don't have one.
You may have to set the RD pin high.
Also I think pin 54 is used to control the backlight on peters board, so setting it high might  be required as well.





sub mm.startup

   ILI9341_P8(1)          '8 bit ILI9341 in landscape
'   SETPIN 55 ,DOUT    'RD PIN
'   PIN(55)=1
'   SETPIN 54 ,DOUT    'F_CS PIN
'   PIN(54)=1

end sub



I have recompiled the driver to include the following addition required in later
MMbasic. Have not tested but will if you have problems.

V1.01 2020-04-01 Added DisplayType=20 required by later software.

Regards
Gerry


'  File ILI9341_P8.bas  written 02-Apr-2020  14:43:11
'
CSub ILI9341_P8
   0000014A
   'getFPC
   27BDFFF8 AFBF0004 00852023 03E42021 ACC40000 8FBF0004 03E00008 27BD0008
   'write_command_data
   27BDFFF8 AFA60010 AFA70014 3C02BF88 34038000 AC436138 24031000 AC436134
   27A60010 AFA60000 308400FF 34840800 AC446430 24040800 AC446134 AC446138
   AC436138 18A0000D 8FA40000 00001821 24060800 24870004 AFA70000 80840000
   34841800 AC446430 AC466134 AC466138 24630001 1465FFF7 8FA40000 03E00008
   27BD0008
   'defineregion
   27BDFFD8 AFBF0024 AFB10020 AFB0001C 00801021 00A08021 2483FFFF 00661821
   24B1FFFF 02278821 00032202 AFA40010 AFA30014 2404002A 24050004 00023202
   00403821 0411FFCD 00000000 00111202 AFA20010 AFB10014 2404002B 24050004
   00103202 02003821 0411FFC4 00000000 8FBF0024 8FB10020 8FB0001C 03E00008
   27BD0028
   'DrawBitmap_ILI9341
   27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
   AFB20030 AFB1002C AFB00028 AFA40050 00A0F021 00C09021 AFA7005C 8FB00060
   8FA30064 8FA20068 8FB3006C 3C069D00 8CC70094 8CF10000 8CC60098 8CC60000
   AFA60014 0003BC03 32F700F8 7C661340 02E6B825 36F71800 0003A943 32B500E0
   7C6320C0 02A3A825 36B51800 0002B403 32D600F8 7C431340 02C3B025 36D61800
   0002A143 329400E0 7C4220C0 0282A025 36941800 72123002 8FA2005C 72023802
   0411FFAE 00000000 2404002C 00002821 0411FF89 00000000 24031000 3C02BF88
   AC436138 8FA3005C 18600061 0017B880 32F703FC 0016B080 32D603FC 0200C021
   AFBE0018 00121023 AFA20020 70721002 2442FFFF AFA20010 AFB20024 00007821
   AFA0001C 24190001 3C05BF88 240E03FC 1000004B 240B0800 04400017 0051202B
   50800016 24630001 05020014 24630001 51400012 24630001 91A40000 008C2024
   10800008 00000000 ACAE6134 ACB76138 ACB56430 ACAB6134 ACAB6138 10000007
   24630001 ACAE6134 ACB66138 ACB46430 ACAB6134 ACAB6138 24630001 1470FFE6
   24420001 24C60001 24E7FFFF 10D20010 01384821 00CF1021 24430007 284D0000
   006D100B 000268C3 026D6821 000717C3 00021742 00E26021 318C0007 01826023
   01996004 01201021 1000FFD3 00001821 27DE0001 17D00004 25080001 10000009
   8FA3001C 0000F021 1A40FFF9 8FA90050 8FA70010 00003021 8FA20014 1000FFE5
   0102502B 24630001 AFA3001C 8FA20018 00581021 AFA20018 8FA30010 8FA20020
   00621821 AFA30010 8FA30024 01E37821 8FA2001C 8FA3005C 10430006 8FBF004C
   1E00FFE8 8FA80018 1000FFEE 8FA3001C 8FBF004C 8FBE0048 8FB70044 8FB60040
   8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C 8FB00028 03E00008 27BD0050
   'DrawRectangle_ILI9341
   27BDFFE0 AFBF001C AFB10018 AFB00014 0086102A 14400004 8FB00030 00801021
   00C02021 00403021 00A7102A 14400005 28820000 00A01021 00E02821 00403821
   28820000 0002200B 3C029D00 8C420094 8C420000 0082402B 2443FFFF 0068200A
   28C30000 0003300B 00C2182B 2442FFFF 0043300A 28A20000 0002280B 3C029D00
   8C420098 8C430000 00A3402B 2462FFFF 0048280A 28E20000 0002380B 00E01021
   00E3382B 2463FFFF 0067100A 24070001 00E41823 00663021 00E53823 00E23821
   70E68802 0411FF05 00000000 2404002C 00002821 0411FEE0 00000000 3C02BF88
   24031000 AC436138 34038000 AC436138 00102143 308400E0 7E0320C0 00832025
   34841800 240303FC AC436134 00101C03 306300F8 7E101340 00708025 00108080
   AC506138 12200009 2631FFFF 24030800 2405FFFF AC446430 AC436134 AC436138
   2631FFFF 1625FFFB 00000000 8FBF001C 8FB10018 8FB00014 03E00008 27BD0020
   'main
   27BDFF88 AFBF0074 AFB30070 AFB2006C AFB10068 AFB00064 00809821 00002021
   3C059D00 24A5055C 27A60058 0411FEAA 00000000 3C029D00 8C430090 8E640000
   A0640015 8C430090 24040014 A0640014 8C420090 2403001C A043002E 2402003C
   AFA20018 2402003D AFA2001C 2402003E AFA20020 2402003F AFA20024 24020040
   AFA20028 24020001 AFA2002C 24020002 AFA20030 24020003 AFA20034 2402000E
   AFA20038 2402000D AFA2003C 2402000C AFA20040 2402000B AFA20044 24020011
   AFA20048 24020012 AFA2004C 24020015 AFA20050 24020016 AFA20054 00008821
   3C109D00 24120010 8E020010 27A40018 24050008 0040F809 00003021 8E020010
   27A40018 24050065 0040F809 00003021 8E02001C 27A40018 0040F809 24050005
   26310001 5632FFF1 8E020010 3C109D00 8E020010 2404001B 24050008 0040F809
   00003021 8E020010 2404001B 24050065 0040F809 00003021 3C12BF88 24021000
   AE426138 8E020010 24040018 24050008 0040F809 00003021 8E020010 24040018
   24050065 0040F809 00003021 24020800 AE426138 8E030090 8E020010 8064002E
   24050008 0040F809 00003021 8E030090 8E020010 8064002E 24050065 0040F809
   00003021 8E030090 8E02001C 8064002E 0040F809 24050006 8E030090 8E02001C
   8064002E 0040F809 24050006 8E020004 0040F809 3404C350 8E030090 8E02001C
   8064002E 0040F809 24050005 8E020004 0040F809 3404C350 8E030090 8E02001C
   8064002E 0040F809 24050006 8E020004 0040F809 3404C350 24040001 00002821
   0411FE2D 00000000 8E020004 3C120001 0040F809 364486A0 24040028 00002821
   0411FE25 00000000 240400C0 24050001 24060023 0411FE20 00000000 240400C1
   24050001 24060010 0411FE1B 00000000 240400C5 24050002 2406002B 2407002B
   0411FE15 00000000 240400C7 24050001 240600C0 0411FE10 00000000 24040036
   24050001 24060028 0411FE0B 00000000 24040001 00002821 0411FE07 00000000
   8E020004 0040F809 364486A0 2404003A 24050001 24060055 0411FDFF 00000000
   240400B1 24050002 00003021 2407001B 0411FDF9 00000000 240400B7 24050001
   24060007 0411FDF4 00000000 24040011 00002821 0411FDF0 00000000 8E020004
   3C040002 0040F809 248449F0 24040013 00002821 0411FDE8 00000000 24040029
   00002821 0411FDE4 00000000 8E020004 3C040007 0040F809 3484A120 8E620000
   24040001 14440003 8E630004 5060000C 24110028 24040002 14440003 24040003
   5060000B 24110048 14440006 24040004 50600007 241100E8 10000002 00000000
   24040004 14440002 24020088 0043880A 24040036 24050001 02203021 0411FDC6
   00000000 3C029D00 8C420090 90420015 30420001 10400008 3C029D00 8C430094
   24040140 AC640000 8C420098 240300F0 10000007 AC430000 8C430098 24040140
   AC640000 8C420094 240300F0 AC430000 8FA50058 3C029D00 8C430048 3C049D00
   248403C8 00852021 AC640000 8FA50058 8C43004C 3C049D00 24840128 00852021
   AC640000 8C430048 8C440094 8C860000 8C420098 8C470000 AFA00010 8C620000
   00002021 00002821 24C6FFFF 0040F809 24E7FFFF 8FBF0074 8FB30070 8FB2006C
   8FB10068 8FB00064 03E00008 27BD0078
End CSub




Latest F4 Latest H7
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 05:59am 03 Apr 2020
Copy link to clipboard 
Print this post

Gerry,

I get the following error after a restart -

> mm.startup
[LIBRARY] ILI9341_P8(1)
Error: Pin -1610483192 is invalid
>

Regards,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 09:07am 03 Apr 2020
Copy link to clipboard 
Print this post

  panky said  Gerry,
[LIBRARY] ILI9341_P8(1)
Error: Pin -1610483192 is invalid


it is normal, on mx470 there is only 1612483191 pins aviable

 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 839
Posted: 12:31pm 03 Apr 2020
Copy link to clipboard 
Print this post

Try this one.





'  File ILI9341_P8.bas  written 03-Apr-2020  23:19:09
'
CSub ILI9341_P8
   00000148
   'getFPC
   27BDFFF8 AFBF0004 00852023 03E42021 ACC40000 8FBF0004 03E00008 27BD0008
   'write_command_data
   27BDFFF8 AFA60010 AFA70014 3C02BF88 34038000 AC436138 24031000 AC436134
   27A60010 AFA60000 308400FF 34840800 AC446430 24040800 AC446134 AC446138
   AC436138 18A0000D 8FA40000 00001821 24060800 24870004 AFA70000 80840000
   34841800 AC446430 AC466134 AC466138 24630001 1465FFF7 8FA40000 03E00008
   27BD0008
   'defineregion
   27BDFFD8 AFBF0024 AFB10020 AFB0001C 00801021 00A08021 2483FFFF 00661821
   24B1FFFF 02278821 00032202 AFA40010 AFA30014 2404002A 24050004 00023202
   00403821 0411FFCD 00000000 00111202 AFA20010 AFB10014 2404002B 24050004
   00103202 02003821 0411FFC4 00000000 8FBF0024 8FB10020 8FB0001C 03E00008
   27BD0028
   'DrawBitmap_ILI9341
   27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
   AFB20030 AFB1002C AFB00028 AFA40050 00A0F021 00C09021 AFA7005C 8FB00060
   8FA30064 8FA20068 8FB3006C 3C069D00 8CC70094 8CF10000 8CC60098 8CC60000
   AFA60010 0003BC03 32F700F8 7C661340 02E6B825 36F71800 0003B143 32D600E0
   7C6320C0 02C3B025 36D61800 0002AC03 32B500F8 7C431340 02A3A825 36B51800
   0002A143 329400E0 7C4220C0 0282A025 36941800 72123002 8FA2005C 72023802
   0411FFAE 00000000 2404002C 00002821 0411FF89 00000000 24031000 3C02BF88
   AC436138 8FA3005C 1860005B 02007821 AFBE0014 00121023 AFA2001C 7072F002
   27DEFFFF AFB20020 00007021 AFA00018 24180001 3C05BF88 1000004B 24060800
   04400019 0051202B 50800018 24630001 05220016 24630001 51600014 24630001
   91A40000 008C2024 10800009 00000000 ACB76430 ACA66134 ACA66138 ACB66430
   ACA66134 ACA66138 10000008 24630001 ACB56430 ACA66134 ACA66138 ACB46430
   ACA66134 ACA66138 24630001 1470FFE4 24420001 24E70001 2508FFFF 10F20010
   014F5021 00EE1021 24430007 284D0000 006D100B 000268C3 026D6821 000817C3
   00021742 01026021 318C0007 01826023 01986004 01401021 1000FFD1 00001821
   27390001 17300004 25290001 10000009 8FA30018 0000C821 1A40FFF9 8FAA0050
   03C04021 00003821 8FA20010 1000FFE5 0122582B 24630001 AFA30018 8FA20014
   004F1021 AFA20014 8FA3001C 03C3F021 8FA20020 01C27021 8FA30018 8FA2005C
   10620006 8FBF004C 1E00FFEA 8FA90014 1000FFF0 8FA30018 8FBF004C 8FBE0048
   8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C 8FB00028
   03E00008 27BD0050
   'DrawRectangle_ILI9341
   27BDFFE0 AFBF001C AFB10018 AFB00014 0086102A 14400004 8FB00030 00801021
   00C02021 00403021 00A7102A 14400005 28820000 00A01021 00E02821 00403821
   28820000 0002200B 3C029D00 8C420094 8C420000 0082402B 2443FFFF 0068200A
   28C30000 0003300B 00C2182B 2442FFFF 0043300A 28A20000 0002280B 3C029D00
   8C420098 8C430000 00A3402B 2462FFFF 0048280A 28E20000 0002380B 00E01021
   00E3382B 2463FFFF 0067100A 24070001 00E41823 00663021 00E53823 00E23821
   70E68802 0411FF0B 00000000 2404002C 00002821 0411FEE6 00000000 3C02BF88
   24031000 AC436138 34038000 AC436138 00101C03 306300F8 7E041340 00641825
   00102143 308400E0 7E1020C0 00908025 36101800 240403FC AC446134 34641800
   00031880 AC436138 1220000C 2631FFFF 24030800 2405FFFF AC446430 AC436134
   AC436138 AC506430 AC436134 AC436138 2631FFFF 1625FFF8 00000000 8FBF001C
   8FB10018 8FB00014 03E00008 27BD0020
   'main
   27BDFF88 AFBF0074 AFB40070 AFB3006C AFB20068 AFB10064 AFB00060 0080A021
   00002021 3C059D00 24A50558 27A60058 0411FEAB 00000000 3C029D00 8C430090
   8E840000 A0640015 8C430090 24040014 A0640014 8C420090 2403001C A043002E
   2402003C AFA20018 2402003D AFA2001C 2402003E AFA20020 2402003F AFA20024
   24020040 AFA20028 24020001 AFA2002C 24020002 AFA20030 24020003 AFA20034
   2402000E AFA20038 2402000D AFA2003C 2402000C AFA20040 2402000B AFA20044
   24020011 AFA20048 24020012 AFA2004C 24020015 AFA20050 24020016 AFA20054
   27B20018 27B30038 3C109D00 8E510000 8E020010 02202021 24050008 0040F809
   00003021 8E020010 02202021 24050065 0040F809 00003021 8E02001C 02202021
   0040F809 24050005 26520004 5653FFF0 8E510000 3C109D00 8E020010 2404001B
   24050008 0040F809 00003021 8E020010 2404001B 24050065 0040F809 00003021
   3C11BF88 24021000 AE226138 8E020010 24040018 24050008 0040F809 00003021
   8E020010 24040018 24050065 0040F809 00003021 24020800 AE226138 8E030090
   8E020010 8064002E 24050008 0040F809 00003021 8E030090 8E020010 8064002E
   24050065 0040F809 00003021 8E030090 8E02001C 8064002E 0040F809 24050006
   8E030090 8E02001C 8064002E 0040F809 24050006 8E020004 0040F809 3404C350
   8E030090 8E02001C 8064002E 0040F809 24050005 8E020004 0040F809 3404C350
   8E030090 8E02001C 8064002E 0040F809 24050006 8E020004 0040F809 3404C350
   24040001 00002821 0411FE2D 00000000 8E020004 3C110001 0040F809 362486A0
   24040028 00002821 0411FE25 00000000 240400C0 24050001 24060023 0411FE20
   00000000 240400C1 24050001 24060010 0411FE1B 00000000 240400C5 24050002
   2406002B 2407002B 0411FE15 00000000 240400C7 24050001 240600C0 0411FE10
   00000000 24040036 24050001 24060028 0411FE0B 00000000 24040001 00002821
   0411FE07 00000000 8E020004 0040F809 362486A0 2404003A 24050001 24060055
   0411FDFF 00000000 240400B1 24050002 00003021 2407001B 0411FDF9 00000000
   240400B7 24050001 24060007 0411FDF4 00000000 24040011 00002821 0411FDF0
   00000000 8E020004 3C040002 0040F809 248449F0 24040013 00002821 0411FDE8
   00000000 24040029 00002821 0411FDE4 00000000 8E020004 3C040007 0040F809
   3484A120 8E820000 24040001 14440003 8E830004 1060000C 24060028 24040002
   14440004 24040003 1060000B 24060048 24040003 14440004 24060008 10600006
   240600E8 24060008 24040004 14440002 24020088 0043300A 24040036 24050001
   0411FDC7 00000000 3C029D00 8C420090 90420015 30420001 10400008 3C029D00
   8C430094 24040140 AC640000 8C420098 240300F0 10000007 AC430000 8C430098
   24040140 AC640000 8C420094 240300F0 AC430000 8FA50058 3C029D00 8C430048
   3C049D00 248403B0 00852021 AC640000 8FA50058 8C43004C 3C049D00 24840128
   00852021 AC640000 8C430048 8C440094 8C860000 8C420098 8C470000 AFA00010
   8C620000 00002021 00002821 24C6FFFF 0040F809 24E7FFFF 8FBF0074 8FB40070
   8FB3006C 8FB20068 8FB10064 8FB00060 03E00008 27BD0078
End CSub



Latest F4 Latest H7
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 11:52pm 03 Apr 2020
Copy link to clipboard 
Print this post

Hi Gerry,

Good news and bad news - display worked with the new software until I managed to short out some pins and let the smoke out! Unless I can repair, I will need to order a new display  

Thanks for all your assistance,
Regards,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 839
Posted: 01:57am 04 Apr 2020
Copy link to clipboard 
Print this post

Hi Doug,
That is no good. It could take a while to come these days. You would think the high risk part was moving R1 to R2 in the 8 bit conversion, very tiny and a bit difficult to see from what I remember.

Regards
Gerry
Latest F4 Latest H7
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024