![]() |
Forum Index : Microcontroller and PC projects : 1.8" TFT ST7735 on MM(170) 28 pin?
Author | Message | ||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Hi, this follows on from the thread started by Grogster Here. I'm looking for a small (say 1.8") colour LCD for a MM170(28pin) project (touch would be nice but is not essential for me). Most/all 1.8" displays appear to use ST7735 controllers which, while supported by MM Plus, do not appear to be supported on a 170. If this is the case what are my options to get a small colour LCD display? Thanks, Andrew |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Well, once again I can answer my own query (and I had spent many hours searching and reading articles on TBS and Geoff's site etc). There in the latest distribution of MMBasic in the Embedded Fonts section is a pdf and .BAS file that does exactly what I need - it is referenced on page 18 of the MM User Manual which I'd searched in vain on "ST7735" (entirely my fault). Thanks to Peter M for writing the driver. I'll now go and buy some 1.8" display(s) and give it a go. Cheers, Andrew |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1965 |
I'll have to take up smoking. ![]() Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Hi again, Well, my 1.8" displays arrived and I plugged one into breadboard connected to an LCD backpack with the 2.8" LCD removed. I edited ST7735-Driver.BAS to include "ST7735 16, 26, 187, 1" and loaded it into the mm, powered down then up etc. The connections are shown on the following picture of the card. I have not connected the pins for the SD card - is this a problem? ![]() After trying most permutations for connections GUI TEST LCDPANEL seemed to work BUT: - from the console CLS only cleared 40% of the screen (the other 60% stayed as the circles) (drawing a black box 128x160 clears the screen) - any Text x, y , "Test" . . . wrote the text in landscape but as a mirror image. (not inverted but mirrored) - I have played with the orientation options - all did as expected except everything was mirrored! Any suggestions? Cheers, Andrew |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10066 |
Try replacing the body of the CFunction with the attached. Sounds like your display isn't keeping up with the data rate so I've slowed it down. Could also be a lead length/crosstalk issue. Also, get rid of the 47 ohm resistor 00000263 'spi_write_data 27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C 8064002C 0040F809 24050006 8E030090 8E02001C 8064002D 0040F809 24050005 3C02BF80 AC515820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C425820 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF001C 8FB10018 8FB00014 03E00008 27BD0020 'spi_write_command 27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C 8064002C 0040F809 24050005 8E030090 8E02001C 8064002D 0040F809 24050005 3C02BF80 AC515820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C425820 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF001C 8FB10018 8FB00014 03E00008 27BD0020 'spi_write_cd 27BDFFD8 AFBF0024 AFB10020 AFB0001C AFA60030 AFA70034 00A08821 27A20030 AFA20010 308400FF 0411FFD2 00000000 1A20000A 00008021 8FA20010 24430004 AFA30010 90440000 0411FFA7 00000000 26100001 1611FFF9 8FA20010 8FBF0024 8FB10020 8FB0001C 03E00008 27BD0028 'DefineRegion 27BDFFD8 AFBF0024 AFB40020 AFB3001C AFB20018 AFB10014 AFB00010 00808821 00A09821 00C09021 00E0A021 3C109D00 8E030090 8E02001C 8064002C 0040F809 24050005 8E030090 8E02001C 8064002D 0040F809 24050005 2403002A 3C02BF80 AC435820 3C03BF80 8C625810 30420080 1040FFFD 3C10BF80 8E025820 3C029D00 8C430090 8C42001C 8064002C 0040F809 24050006 00111203 AE025820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 AC515820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 00121A03 AC435820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 AC525820 3C03BF80 8C625810 30420080 1040FFFD 3C10BF80 8E025820 3C029D00 8C430090 8C42001C 8064002C 0040F809 24050005 2402002B AE025820 3C03BF80 8C625810 30420080 1040FFFD 3C10BF80 8E025820 3C029D00 8C430090 8C42001C 8064002C 0040F809 24050006 00131203 AE025820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 AC535820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 00141A03 AC435820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C435820 AC545820 3C03BF80 8C625810 30420080 1040FFFD 3C10BF80 8E025820 3C029D00 8C430090 8C42001C 8064002C 0040F809 24050005 2402002C AE025820 3C03BF80 8C625810 30420080 1040FFFD 3C02BF80 8C425820 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF0024 8FB40020 8FB3001C 8FB20018 8FB10014 8FB00010 03E00008 27BD0028 'DrawBitmapSPI 27BDFFB8 AFBF0044 AFBE0040 AFB7003C AFB60038 AFB50034 AFB40030 AFB3002C AFB20028 AFB10024 AFB00020 0080B021 AFA5004C 00C0A021 00E0F021 8FA6005C 8FA30060 8FB50064 28A50000 8FA2004C 0005100B 00402821 3C02BF80 8C475830 AFA70010 8C475800 AFA70014 8C475840 AFA70018 34078060 AC475800 24070003 AC475830 24070C00 AC475840 7CD01340 00061403 2407FFF8 00471024 02028025 321000FF 7CD120C0 00063143 2402FFE0 00C23024 02268825 323100FF 7C721340 00033403 00C73824 02479025 325200FF 7C7320C0 00031943 00621024 02629825 327300FF 2486FFFF 24A7FFFF 8FA20058 70541802 00663021 705E1802 00673821 0411FF2E 00000000 3C179D00 8EE30090 8EE2001C 8064002C 0040F809 24050006 8EE30090 8EE2001C 8064002D 0040F809 24050005 0014B823 73D4C002 2718FFFF AFB4001C 8FAE004C 00005821 0000C821 8FAD0058 3C069D00 240C0001 10000052 3C02BF80 25CE0001 25C3FFFF 04600048 00000000 8CC30098 8C630000 006E182B 1460005E 8FBF0044 1E800031 03004821 1000003F 00000000 24630001 2464FFFF 04800024 00000000 8CC40094 8C840000 0083202B 1480001F 00000000 91040000 00872024 1080000F 00000000 AC505820 8C445810 30840080 1080FFFD 00000000 8C445820 AC515820 8C445810 30840080 1080FFFD 00000000 8C445820 1000000D 00000000 AC525820 8C445810 30840080 1080FFFD 00000000 8C445820 AC535820 8C445810 30840080 1080FFFD 00000000 8C445820 5465FFD9 24630001 254A0001 15540005 2529FFFF 10000011 00000000 02C01821 00005021 014B2021 24850007 28880000 00A8200B 000440C3 02A84021 000927C3 00042742 01243821 30E70007 00E43823 00EC3804 1000FFC3 006D2821 55CFFFB5 25CE0001 27390001 0317C021 8FA3001C 01635821 033E182A 10600005 8FA70058 1CE0FFAB 01C77821 1000FFF7 27390001 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 3C02BF80 8FA30010 AC435830 8FA70014 AC475800 8FA30018 AC435840 8FBF0044 8FBE0040 8FB7003C 8FB60038 8FB50034 8FB40030 8FB3002C 8FB20028 8FB10024 8FB00020 03E00008 27BD0048 'DrawRectangleSPI 27BDFFC0 AFBF003C AFBE0038 AFB70034 AFB60030 AFB5002C AFB40028 AFB30024 AFB20020 AFB1001C AFB00018 8FA30050 3C02BF80 8C575830 8C5E5800 8C485840 AFA80010 34088060 AC485800 24080003 AC485830 24080C00 AC485840 0086102A 14400005 00A7102A 00801021 00C02021 00403021 00A7102A 14400004 28930000 00A01021 00E02821 00403821 0013200B 00809821 3C029D00 8C420094 8C420000 0082402B 2444FFFF 0088980A 28D40000 0014300B 00C0A021 00C2202B 2442FFFF 0044A00A 28B50000 0015280B 00A0A821 3C029D00 8C420098 8C420000 00A2282B 2444FFFF 0085A80A 28F60000 0016380B 00E0B021 00E2202B 2442FFFF 0044B00A 7C711340 00032403 2402FFF8 00821024 02228825 323100FF 7C7020C0 00031943 2402FFE0 00621824 02038025 321000FF 02602021 02A02821 02803021 02C03821 0411FE54 00000000 3C129D00 8E430090 8E42001C 8064002C 0040F809 24050006 8E430090 8E42001C 8064002D 0040F809 24050005 24020001 00539823 0274A021 00552023 00962021 70942002 10800010 2484FFFF 3C02BF80 AC515820 8C435810 30630080 1060FFFD 00000000 8C435820 AC505820 8C435810 30630080 1060FFFD 00000000 8C435820 1480FFF3 2484FFFF 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 3C02BF80 AC575830 AC5E5800 8FA30010 AC435840 8FBF003C 8FBE0038 8FB70034 8FB60030 8FB5002C 8FB40028 8FB30024 8FB20020 8FB1001C 8FB00018 03E00008 27BD0040 'getFPC 27BDFFF8 AFBF0004 00852023 03E42021 ACC40000 8FBF0004 03E00008 27BD0008 'pstring 27BDFFE0 AFBF001C AFB00018 00808021 00002021 3C059D00 24A50968 27A60010 0411FFEF 00000000 8FA40010 3C029D00 8C42002C 0040F809 02042021 8FBF001C 8FB00018 03E00008 27BD0020 'main 27BDFF80 AFBF007C AFBE0078 AFB70074 AFB60070 AFB5006C AFB40068 AFB30064 AFB20060 AFB1005C AFB00058 00809021 00A08821 00C09821 00E0A021 00002021 3C059D00 24A509E0 27A60048 0411FFD1 00000000 3C109D00 8E020090 8E230000 A043002E 8E020090 8E430000 A043002C 8E020090 8E630000 A043002D 8E020090 8E830000 A0430015 8E030090 8E020010 8064002E 24050008 0040F809 00003021 8E030090 8E020010 8064002E 24050065 0040F809 00003021 8E030090 8E02001C 8064002E 0040F809 24050006 8E030090 8E020010 8064002C 24050008 0040F809 00003021 8E030090 8E020010 8064002C 24050065 0040F809 00003021 8E030090 8E02001C 8064002C 0040F809 24050006 8E030090 8E020010 8064002D 24050008 0040F809 00003021 8E030090 8E020010 8064002D 24050065 0040F809 00003021 8E030090 8E02001C 8064002D 0040F809 24050006 3C02BF81 8C44F220 7C84D800 3C030661 3463A053 1083000B 24020050 3C02BF81 8C43F220 7C63D800 3C020660 3442A053 00621026 24030050 2404000C 0082180B 00601021 3C039D00 8C630088 00431021 8C430000 24020064 54620008 0000A021 3C02BF80 8C545830 8C435800 AFA30050 8C425840 10000002 AFA20054 AFA00050 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 24040014 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 24030014 24050003 00A4180B 00602021 24050008 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 24040014 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 24030014 24050003 00A4180B 00602021 24050065 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 24040029 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 24030029 2405000E 00A4180B 00602021 24050002 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 24040029 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 24030029 2405000E 00A4180B 00602021 24050065 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 2404000E 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 2403000E 24050019 00A4180B 00602021 24050008 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C65F220 7CA5D800 3C030661 3463A053 10A3000B 2404000E 3C03BF81 8C64F220 7C84D800 3C030660 3463A053 00832026 2403000E 24050019 00A4180B 00602021 24050065 0040F809 00003021 3C02BF81 8C43FA84 24040001 7C831804 AC43FA84 3C02BF81 8C44FB04 24030003 7C641804 AC44FB04 3C02BF80 34048060 AC445800 AC435830 24030C00 AC435840 16800007 3C109D00 8C545830 8C435800 AFA30050 8C425840 AFA20054 3C109D00 8E030090 8E02001C 8064002E 0040F809 24050006 8E020004 0040F809 24042710 8E030090 8E02001C 8064002E 0040F809 24050005 8E020004 0040F809 24042710 8E030090 8E02001C 8064002E 0040F809 24050006 8E020004 0040F809 24042710 24040011 0411FC95 00000000 8E020004 3C040007 0040F809 3484A120 2411002D AFB10010 240400B1 24050003 24060001 2407002C 0411FCAC 00000000 AFB10010 240400B2 24050003 24060001 2407002C 0411FCA5 00000000 AFB10010 24130001 AFB30014 2416002C AFB60018 AFB1001C 240400B3 24050006 24060001 2407002C 0411FC99 00000000 240400B4 24050001 24060007 0411FC94 00000000 24020084 AFA20010 240400C0 24050003 240600A2 24070002 0411FC8C 00000000 240400C1 24050001 240600C5 0411FC87 00000000 240400C2 24050002 2406000A 00003821 0411FC81 00000000 240400C3 24050002 2406008A 2407002A 0411FC7B 00000000 240400C4 24050002 2406008A 240700EE 0411FC75 00000000 240400C5 24050001 2406000E 0411FC70 00000000 24040020 0411FC4A 00000000 24040036 24050001 240600C0 0411FC68 00000000 2404003A 24050001 24060005 0411FC63 00000000 AFA00010 2402007F AFA20014 2404002A 24050004 00003021 00003821 0411FC5A 00000000 AFA00010 2402009F AFA20014 2404002B 24050004 00003021 00003821 0411FC51 00000000 24150007 AFB50010 24020012 AFA20014 24170037 AFB70018 24020032 AFA2001C 24120029 AFB20020 AFB10024 24020025 AFA20028 AFB2002C 2402002B AFA20030 24020039 AFA20034 AFA00038 AFB3003C 24020003 AFA20040 241E0010 AFBE0044 240400E0 24050010 24060002 2407001C 0411FC33 00000000 AFB50010 24020006 AFA20014 2402002E AFA20018 AFB6001C AFB20020 AFB10024 AFA20028 AFA2002C AFB70030 2402003F AFA20034 AFA00038 AFA0003C 24020002 AFA20040 AFBE0044 240400E1 24050010 24060003 2407001D 0411FC1B 00000000 24040013 0411FBF5 00000000 8E020004 0040F809 24042710 24040029 0411FBEF 00000000 8E020090 80420015 14530007 3C029D00 24040036 24050001 240600A0 0411FC09 00000000 3C029D00 8C420090 80430015 24020002 14620007 3C029D00 24040036 24050001 240600C0 0411FBFE 00000000 3C029D00 8C420090 80430015 24020003 14620007 3C029D00 24040036 24050001 24060060 0411FBF3 00000000 3C029D00 8C420090 80430015 24020004 14620007 3C029D00 24040036 24050001 00003021 0411FBE8 00000000 3C029D00 8C420090 90420015 30420001 10400008 3C029D00 8C430098 24040080 AC640000 8C420094 240300A0 10000007 AC430000 8C430094 24040080 AC640000 8C420098 240300A0 AC430000 8FA50048 3C029D00 8C430048 3C049D00 248406F4 00852021 AC640000 8FA50048 8C43004C 3C049D00 248403CC 00852021 AC640000 8C430048 8C440094 8C860000 8C420098 8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809 24E7FFFF 3C02BF80 AC545830 8FA30050 AC435800 8FA30054 AC435840 3C049D00 24841284 0411FDBC 00000000 8FBF007C 8FBE0078 8FB70074 8FB60070 8FB5006C 8FB40068 8FB30064 8FB20060 8FB1005C 8FB00058 03E00008 27BD0080 '.rodata 'startup 37375453 64203533 65766972 6F6C2072 64656461 00000A0D |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Sorry Peter but no change. When it starts up ~40% of the screen is black (ie the section that CLS works on) and 60% is coloured snow. Don't lose any sleep over it but a "Blinding Flash of the Obvious" (BFO) may occur sometime . . . The resistor is gone! Thanks for trying, (you can't support every piece of kit on ebay) Andrew |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
![]() Mind you, Peter is doing a pretty good job of actually doing so . . . |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Yes WW, Peter does a remarkable job! More trials this morning: - CLS only clears 40% of the screen within a program and on MM Edit's chat - a Box with a fill overwrites the whole screen (within the box) - the colours are scrambled, eg . . . rgb(yellow) gives cyan, red gives blue, green is OK, cyan gives yellow and blue gives red - I have two of the LCDs and they each behave the same way. Apart from being mirrored they are nice little displays - just what I needed for a GPS speedometer that fits in my car's instruments (a 2.8" touch is too big). Cheers, Andrew |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Several steps forward but one hurdle still to jump - it won't Autostart (it requires the Console to be connected and a "Run" command). Using the extremely useful program FontTweak by TassieJim I mirrored all my fonts (and set the location for Texting character by character). I now have it working and looking quite nice - and now on its own circuit, without the LCD Backpack. But as I said above, it won't autostart. I've tried: - "Option Autostart On" in the program and/or from the console - Changing the mm.startup line for the driver to be ST7735 16, 23, 18, 1 and changed the connections to suit (ie 23 instead of the original 26) - Deleting the Library and trying again (but I haven't erased the chip or tried a new chip yet). Any suggestions? Andrew (I had to smile when I realised that "WAIT" in normal font is "TIAW" in my mirrored font) |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
Andrew It's AUTORUN Bob |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
OPTION AUTORUN ON and OPTION AUTORUN OFF to disable it (or type NEW) NOTE: When downloading a program from MMEDIT, you will need to re-type OPTION AUTORUN ON again (or at least you do in my 'old' version of MMEDIT) WW |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Thanks but sorry Bob and WW but it is not as simple as that (I wished it were). I have actually been using "Option Autorun On" (but "mis-spoke" above - to quote a former US President). I really do suspect my connections or, most likely, the compatibility of the device. Cheers, Andrew |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
If your program is working fine when you type RUN, but does not work with AUTORUN on, then are there any error messages you are seeing with a console connection (i.e. with AutoRun on)? Also, is it only at POWER UP that it fails to autostart, or also whenever the MM is reset (i.e. power already applied)? IF only at power-up, then there is most likely a timing issue between the hardware. Unless the PIC is corrupt in some way, then I do not see how else the AUTORUN will fail to operate without a message being given on the console. ![]() |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 868 |
Many thanks WW (et Al) There were no error messages etc so I decided to try a new chip (loaded the firmware, Peter M's original driver etc). It worked right away with no mirrored font and no split screen! Only problem was that the flipped fonts I created were now flipped. I've gone back to normal fonts so all should be good with Peter's driver perfect! In summary - a corrupt chip! (In the process I have cooked a SMD resistor on my console connector so I will be grounded till I can get a new one - too much smoke escaped so it stopped working - even turned my PC off) Many thanks to all, Andrew. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |