Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:24 10 May 2025 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 : uM2: SSD1351 Colour Oled

     Page 1 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 07:17am 15 Oct 2015
Copy link to clipboard 
Print this post

Another loadable driver, this time for the SSD1351 colour OLED. Seen here displaying Geoff's Julia. Support for this display was originally requested by WhiteWizzard
The picture doesn't do the display justice. The colour OLED gives a very bright and vibrant display. This version is again MX170 only. MX470 version by request.






sub mm.startup
dim myaddr%=peek(cfunaddr SSD1351)
dim i%=SSD1351(myaddr%,15,30,11,96,1)'Address of CFunction, DCpin, RSTpin, CSpin, vertical resolution, orientation
end sub
'
' File SSD1351.bas written 23-Sep-2015 10:05:39
'
CFunction SSD1351
00000062
'writeData
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
'writeCommand
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
'main
27BDFFC8 AFBF0034 AFB60030 AFB5002C AFB40028 AFB30024 AFB20020 AFB1001C
AFB00018 00808821 8FA20048 8C530000 3C109D00 8E020090 8CC30000 A043002E
8E020090 8CA30000 A043002C 8E020090 8CE30000 A043002D 8E020090 8FA3004C
8C630000 A0430015 8E020090 A053003C 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 3C020661 3442A053 1082000B 24030050 3C02BF81 8C43F220
7C63D800 3C020660 3442A053 00621826 24020050 2404000C 0083100B 00401821
3C029D00 8C420088 00621821 8C640000 24030064 54830007 00009021 3C03BF80
8C725830 8C745800 8C765840 10000003 3C03BF81 0000A021 3C03BF81 8C65F220
7CA5D800 3C040661 3484A053 10A4000B 24030050 3C03BF81 8C64F220 7C84D800
3C030660 3463A053 00831826 24040050 2405000C 00A3200B 00801821 00621021
8C430000 24020065 10620084 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
8C44FA84 24030001 7C641804 AC44FA84 3C02BF81 8C44FB04 24050003 7CA41804
AC44FB04 3C02BF80 34048060 AC445800 AC435830 24030C00 AC435840 56400005
3C029D00 8C525830 8C545800 8C565840 3C029D00 24420188 3C159D00 26B50AF0
02A2182B 10600004 02A2A823 8E230000 10000003 02A3A821 8E230000 02A3A821
3C039D00 24630D1C 0062202B 10800004 00621023 8E240000 10000003 00448821
8E240000 00448821 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 240400FD 24050001 24060012 0411FE95 00000000
240400FD 24050001 240600B1 0411FE90 00000000 240400AE 0411FE6A 00000000
240400B3 24050001 240600F1 0411FE88 00000000 240400CA 24050001 2406007F
0411FE83 00000000 240400A0 24050001 24060074 0411FE7E 00000000 24040015
24050002 00003021 2407007F 0411FE78 00000000 24040075 24050002 00003021
2407007F 0411FE72 00000000 240400A2 24050001 00003021 0411FE6D 00000000
240400B5 24050001 00003021 0411FE68 00000000 240400AB 24050001 24060001
0411FE63 00000000 240400B1 24050001 24060032 0411FE5E 00000000 240400BE
24050001 24060005 0411FE59 00000000 240400A6 0411FE33 00000000 240200C8
AFA20010 240400C1 24050003 240600C8 24070080 0411FE4E 00000000 240400C7
24050001 2406000F 0411FE49 00000000 24020055 AFA20010 240400B4 24050003
240600A0 240700B5 0411FE41 00000000 240400B6 24050001 24060001 0411FE3C
00000000 240400AF 0411FE16 00000000 2404005C 0411FE13 00000000 8E020090
90420015 30420001 10400007 3C029D00 8C430094 24040080 AC640000 8C420098
10000006 AC530000 8C430098 24040080 AC640000 8C420094 AC530000 3C029D00
8C430048 AC750000 8C43004C AC710000 8C430048 8C440094 8C860000 8C420098
8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809 24E7FFFF
3C02BF80 AC525830 AC545800 AC565840 00001021 00001821 8FBF0034 8FB60030
8FB5002C 8FB40028 8FB30024 8FB20020 8FB1001C 8FB00018 03E00008 27BD0038
'defineregion
27BDFFD0 AFBF002C AFB50028 AFB40024 AFB30020 AFB2001C AFB10018 AFB00014
0080A021 00A09821 00C0A821 3C029D00 8C420090 8050003C 80420015 24030001
14430012 00E09021 240400A1 0411FDCD 00000000 24020060 16020007 00002021
24040060 0411FDA4 00000000 00008821 1000002B 24100074 0411FD9F 00000000
00008821 10000026 24100074 24030004 1443000A 24030002 240400A1 0411FDB9
00000000 00002021 0411FD93 00000000 24110001 1000001A 24100064 14430011
240400A1 0411FDAF 00000000 24020060 16020007 00002021 24040060 0411FD86
00000000 24110001 1000000D 24100076 0411FD81 00000000 24110001 10000008
24100076 0411FD9F 00000000 00002021 0411FD79 00000000 00008821 24100066
36020001 0051800B 240400A0 0411FD95 00000000 320400FF 0411FD6F 00000000
1220001F 24040015 24040075 0411FD8D 00000000 328400FF 0411FD67 00000000
32A400FF 0411FD64 00000000 24040015 0411FD84 00000000 326400FF 0411FD5E
00000000 324400FF 0411FD5B 00000000 2404005C 0411FD7B 00000000 8FBF002C
8FB50028 8FB40024 8FB30020 8FB2001C 8FB10018 8FB00014 03E00008 27BD0030
0411FD70 00000000 328400FF 0411FD4A 00000000 32A400FF 0411FD47 00000000
1000FFE3 24040075
'DrawRectangleSPI
27BDFFC0 AFBF003C AFBE0038 AFB70034 AFB60030 AFB5002C AFB40028 AFB30024
AFB20020 AFB1001C AFB00018 8FA30050 3C02BF80 8C575830 8C5E5800 8C485840
AFA80010 34088060 AC485800 24080001 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
0411FF35 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
'DrawBitmapSPI
27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
AFB20030 AFB1002C AFB00028 0080B821 AFA50054 00C08821 AFA7005C 8FB00060
8FA60064 8FA30068 8FB2006C 3C02BF80 8C475830 AFA70014 8C475800 AFA70018
8C475840 AFA7001C 34078060 AC475800 24070001 AC475830 24070C00 AC475840
7CD61340 00061403 2407FFF8 00471024 02C2B025 32D600FF 7CD520C0 00063143
2402FFE0 00C23024 02A6A825 32B500FF 7C741340 00033403 00C73824 0287A025
329400FF 7C7320C0 00031943 00621024 02629825 327300FF 2486FFFF 8FA20054
2447FFFF 72111002 00463021 8FA2005C 72021802 00673821 0411FEBC 00000000
3C1E9D00 8FC30090 8FC2001C 8064002C 0040F809 24050006 8FC30090 8FC2001C
8064002D 0040F809 24050005 8FA7005C 18E00065 02007021 8FBF0054 00111023
AFA20010 70F1C802 2739FFFF AFB10020 00006821 0000F021 240F0001 3C069D00
10000055 3C04BF80 0442002C 24630001 8CC50094 8CA50000 0045282B 50A00027
24630001 04E20025 24630001 8CC50098 8CA50000 00E5282B 50A00020 24630001
91850000 00AB2824 10A0000F 00000000 AC965820 8C855810 30A50080 10A0FFFD
00000000 8C855820 AC955820 8C855810 30A50080 10A0FFFD 00000000 8C855820
1000000E 24630001 AC945820 8C855810 30A50080 10A0FFFD 00000000 8C855820
AC935820 8C855810 30A50080 10A0FFFD 00000000 8C855820 24630001 1470FFD2
24420001 25080001 2529FFFF 11110010 014E5021 010D1021 24430007 284C0000
006C100B 000260C3 024C6021 000917C3 00021742 01225821 316B0007 01625823
016F5804 01401021 1000FFBF 00001821 27180001 17100004 24E70001 10000007
27DE0001 0000C021 1A20FFF9 02E05021 03204821 1000FFE7 00004021 03EEF821
8FA20010 0322C821 8FA30020 8FA7005C 13C70005 01A36821 1E00FFF2 03E03821
1000FFF6 27DE0001 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006
3C02BF80 8FA30014 AC435830 8FA70018 AC475800 8FA3001C AC435840 8FBF004C
8FBE0048 8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C
8FB00028 03E00008 27BD0050
End CFunction

 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 08:12am 15 Oct 2015
Copy link to clipboard 
Print this post

  matherp said   MX470 version by request . . . .


Do you mean 470 MM+? If so then Yes Please.
As you say, these displays are VERY clear & colourful so any MM+ support for them would certainly be appreciated here!

WW
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 11:11pm 15 Oct 2015
Copy link to clipboard 
Print this post

  Quote  Do you mean 470 MM+? If so then Yes Please.


As requested. This has been tested on the 64-pin but should work on the 100 as well. It uses the standard MM+ pins for a SPI display as per the advanced features manual and is fully compatible with SD card use.


sub mm.startup
dim myaddr%=peek(cfunaddr SSD1351plus)
SSD1351plus(myaddr%,3,2,1,96,1)'Address of CFunction, DCpin, RSTpin, CSpin, vertical resolution, orientation
end sub
'
' File SSD1351plus.bas written 16-Oct-2015 10:05:39
'
CSUB SSD1351plus
00000062
'writeData
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050006 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF001C 8FB10018
8FB00014 03E00008 27BD0020
'writeCommand
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050005 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
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
'main
27BDFFC8 AFBF0034 AFB60030 AFB5002C AFB40028 AFB30024 AFB20020 AFB1001C
AFB00018 00808821 8FA20048 8C530000 3C109D00 8E020090 8CC30000 A043002E
8E020090 8CA30000 A043002C 8E020090 8CE30000 A043002D 8E020090 8FA3004C
8C630000 A0430015 8E020090 A053003C 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
8C43F220 7C63D800 3C020580 3442B053 00621826 24020030 24040014 0083100B
00401821 3C029D00 8C420088 00621821 8C640000 24030064 54830007 00009021
3C03BF80 8C725A30 8C745A00 8C765A40 10000003 3C03BF81 0000A021 3C03BF81
8C64F220 7C84D800 3C030580 3463B053 00831826 24040030 24050014 00A3200B
00821021 8C430000 24020065 1062005A 3C029D00 8C420010 3C03BF81 8C64F220
7C84D800 3C030580 3463B053 00832026 2403000C 24050005 00A4180B 00602021
24050008 0040F809 00003021 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800
3C030580 3463B053 00832026 2403000C 24050005 00A4180B 00602021 24050065
0040F809 00003021 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580
3463B053 00832026 2403000B 2405002F 00A4180B 00602021 24050002 0040F809
00003021 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053
00832026 2403000B 2405002F 00A4180B 00602021 24050065 0040F809 00003021
3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026
2403000A 24050004 00A4180B 00602021 24050008 0040F809 00003021 3C029D00
8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026 2403000A
24050004 00A4180B 00602021 24050065 0040F809 00003021 3C02BF81 8C43F220
7C63D800 3C020580 3442B053 1462000C 3C02BF81 8C43FA90 24040001 7C831804
AC43FA90 3C02BF81 8C43FCA0 24040006 7C831804 AC43FCA0 1000000B 3C02BF80
8C43FA90 24040007 7C831804 AC43FA90 3C02BF81 8C43FC9C 24040006 7C831804
AC43FC9C 3C02BF80 34038060 AC435A00 24030001 AC435A30 24030C00 AC435A40
56400005 3C029D00 8C525A30 8C545A00 8C565A40 3C029D00 24420188 3C159D00
26B50A54 02A2182B 10600004 02A2A823 8E230000 10000003 02A3A821 8E230000
02A3A821 3C039D00 24630C80 0062202B 10800004 00621023 8E240000 10000003
00448821 8E240000 00448821 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 240400FD 24050001 24060012 0411FEBC
00000000 240400FD 24050001 240600B1 0411FEB7 00000000 240400AE 0411FE91
00000000 240400B3 24050001 240600F1 0411FEAF 00000000 240400CA 24050001
2406007F 0411FEAA 00000000 240400A0 24050001 24060074 0411FEA5 00000000
24040015 24050002 00003021 2407007F 0411FE9F 00000000 24040075 24050002
00003021 2407007F 0411FE99 00000000 240400A2 24050001 00003021 0411FE94
00000000 240400B5 24050001 00003021 0411FE8F 00000000 240400AB 24050001
24060001 0411FE8A 00000000 240400B1 24050001 24060032 0411FE85 00000000
240400BE 24050001 24060005 0411FE80 00000000 240400A6 0411FE5A 00000000
240200C8 AFA20010 240400C1 24050003 240600C8 24070080 0411FE75 00000000
240400C7 24050001 2406000F 0411FE70 00000000 24020055 AFA20010 240400B4
24050003 240600A0 240700B5 0411FE68 00000000 240400B6 24050001 24060001
0411FE63 00000000 240400AF 0411FE3D 00000000 2404005C 0411FE3A 00000000
8E020090 90420015 30420001 10400007 3C029D00 8C430094 24040080 AC640000
8C420098 10000006 AC530000 8C430098 24040080 AC640000 8C420094 AC530000
3C029D00 8C430048 AC750000 8C43004C AC710000 8C430048 8C440094 8C860000
8C420098 8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809
24E7FFFF 3C02BF80 AC525A30 AC545A00 AC565A40 00001021 00001821 8FBF0034
8FB60030 8FB5002C 8FB40028 8FB30024 8FB20020 8FB1001C 8FB00018 03E00008
27BD0038
'defineregion
27BDFFD0 AFBF002C AFB50028 AFB40024 AFB30020 AFB2001C AFB10018 AFB00014
0080A021 00A09821 00C0A821 3C029D00 8C420090 8050003C 80420015 24030001
14430012 00E09021 240400A1 0411FDF4 00000000 24020060 16020007 00002021
24040060 0411FDCB 00000000 00008821 1000002B 24100074 0411FDC6 00000000
00008821 10000026 24100074 24030004 1443000A 24030002 240400A1 0411FDE0
00000000 00002021 0411FDBA 00000000 24110001 1000001A 24100064 14430011
240400A1 0411FDD6 00000000 24020060 16020007 00002021 24040060 0411FDAD
00000000 24110001 1000000D 24100076 0411FDA8 00000000 24110001 10000008
24100076 0411FDC6 00000000 00002021 0411FDA0 00000000 00008821 24100066
36020001 0051800B 240400A0 0411FDBC 00000000 320400FF 0411FD96 00000000
1220001F 24040015 24040075 0411FDB4 00000000 328400FF 0411FD8E 00000000
32A400FF 0411FD8B 00000000 24040015 0411FDAB 00000000 326400FF 0411FD85
00000000 324400FF 0411FD82 00000000 2404005C 0411FDA2 00000000 8FBF002C
8FB50028 8FB40024 8FB30020 8FB2001C 8FB10018 8FB00014 03E00008 27BD0030
0411FD97 00000000 328400FF 0411FD71 00000000 32A400FF 0411FD6E 00000000
1000FFE3 24040075
'DrawRectangleSPI
27BDFFC0 AFBF003C AFBE0038 AFB70034 AFB60030 AFB5002C AFB40028 AFB30024
AFB20020 AFB1001C AFB00018 8FA30050 3C02BF80 8C575A30 8C5E5A00 8C485A40
AFA80010 34088060 AC485A00 24080001 AC485A30 24080C00 AC485A40 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
0411FF35 00000000 3C129D00 8E430090 8E42001C 8064002C 0040F809 24050006
8E430090 8E42001C 8064002D 0040F809 24050005 24020001 00539823 0274A021
00552023 00962021 70942002 10800010 2484FFFF 3C02BF80 AC515A20 8C435A10
30630080 1060FFFD 00000000 8C435A20 AC505A20 8C435A10 30630080 1060FFFD
00000000 8C435A20 1480FFF3 2484FFFF 3C029D00 8C430090 8C42001C 8064002D
0040F809 24050006 3C02BF80 AC575A30 AC5E5A00 8FA30010 AC435A40 8FBF003C
8FBE0038 8FB70034 8FB60030 8FB5002C 8FB40028 8FB30024 8FB20020 8FB1001C
8FB00018 03E00008 27BD0040
'DrawBitmapSPI
27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
AFB20030 AFB1002C AFB00028 0080B821 AFA50054 00C08821 AFA7005C 8FB00060
8FA60064 8FA30068 8FB2006C 3C02BF80 8C475A30 AFA70014 8C475A00 AFA70018
8C475A40 AFA7001C 34078060 AC475A00 24070001 AC475A30 24070C00 AC475A40
7CD61340 00061403 2407FFF8 00471024 02C2B025 32D600FF 7CD520C0 00063143
2402FFE0 00C23024 02A6A825 32B500FF 7C741340 00033403 00C73824 0287A025
329400FF 7C7320C0 00031943 00621024 02629825 327300FF 2486FFFF 8FA20054
2447FFFF 72111002 00463021 8FA2005C 72021802 00673821 0411FEBC 00000000
3C1E9D00 8FC30090 8FC2001C 8064002C 0040F809 24050006 8FC30090 8FC2001C
8064002D 0040F809 24050005 8FA7005C 18E00065 02007021 8FBF0054 00111023
AFA20010 70F1C802 2739FFFF AFB10020 00006821 0000F021 240F0001 3C069D00
10000055 3C04BF80 0442002C 24630001 8CC50094 8CA50000 0045282B 50A00027
24630001 04E20025 24630001 8CC50098 8CA50000 00E5282B 50A00020 24630001
91850000 00AB2824 10A0000F 00000000 AC965A20 8C855A10 30A50080 10A0FFFD
00000000 8C855A20 AC955A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20
1000000E 24630001 AC945A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20
AC935A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20 24630001 1470FFD2
24420001 25080001 2529FFFF 11110010 014E5021 010D1021 24430007 284C0000
006C100B 000260C3 024C6021 000917C3 00021742 01225821 316B0007 01625823
016F5804 01401021 1000FFBF 00001821 27180001 17100004 24E70001 10000007
27DE0001 0000C021 1A20FFF9 02E05021 03204821 1000FFE7 00004021 03EEF821
8FA20010 0322C821 8FA30020 8FA7005C 13C70005 01A36821 1E00FFF2 03E03821
1000FFF6 27DE0001 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006
3C02BF80 8FA30014 AC435A30 8FA70018 AC475A00 8FA3001C AC435A40 8FBF004C
8FBE0048 8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C
8FB00028 03E00008 27BD0050
End CSUB
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 02:30am 16 Oct 2015
Copy link to clipboard 
Print this post

Excellent! Thank you Matherp for your hard work on these libraries.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 03:58am 16 Oct 2015
Copy link to clipboard 
Print this post

  Quote  This version is again MX170 only. MX470 version by request.


So what needs to be done differently?
Micromites and Maximites! - Beginning Maximite
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 05:52am 16 Oct 2015
Copy link to clipboard 
Print this post

  Quote  So what needs to be done differently?


Just configuration stuff. MX470 displays use SPI2, MX170 use SPI1. The pins on MX470 don't exist on MX170 (and in the case of the configurable pins, visa versa)

So it needs separate compilation and of course testing. Nothing difficult, just slog work
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 767
Posted: 01:38pm 16 Oct 2015
Copy link to clipboard 
Print this post

Evening Gent's...

@Peter.. I was wondering about those baby bright 2.2" 176x220 units. I was using them for the retro gauge displays in the EIS system. I have a hard prototype built and using it for one of the Rs-485 remote displays. It is using your gauge display code and the C-function driver you created... (nice!)... It's currently running on older 170 core firmware, which is running nicely, but wondering if I should upgrade the core to v4.7b37..? I guess the C-function code would still run ok...

Just wanted to check and see what you thought about it....


' Peter Mather
'
' 1.2.0
' 2015-30-6
'
' 1.1 Scrolling added when optimised pinout used
' 1.1.1 Further performance improvements
' 1.2.0 Specific 44-pin optimised variant removed, all functions available with any pin allocation
' Changed triangle drawing CFunction to accept an array of coordinates
'
' Graphics library with drivers for S6D80164 display
' 8-bit parallel output from Micromite MX170 - flexible pinout


Thanks...!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 04:29am 22 Feb 2016
Copy link to clipboard 
Print this post

@matherp

A quick couple of questions regarding your second post in this thread (i.e. the MX470 SSD1351 code you tested on your 64pinner)

Can I load this code into the Library so that it is 'invisible' to the end-user; and if so, does it then make all the MM+ firmware's 'graphic features' available to the end-user i.e. TEXT, BOX, CIRCLE . . . . .

I am ultimately after all the MMBASIC v5.1 built in TFT features, but on a physically smaller & brighter screen - so this OLED unit is perfect.

If all the above works as I am hoping it will do, will the GUI TEST LCDPANEL command work in the 'normal' way too?

Thanks,
WW
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 06:07am 22 Feb 2016
Copy link to clipboard 
Print this post

  Quote  Can I load this code into the Library so that it is 'invisible' to the end-user; and if so, does it then make all the MM+ firmware's 'graphic features' available to the end-user i.e. TEXT, BOX, CIRCLE . . . . .

Yes
  Quote  If all the above works as I am hoping it will do, will the GUI TEST LCDPANEL command work in the 'normal' way too?

Yes

Just to bring this "older" driver in-line with current approach here is a very slightly amended version.

sub mm.startup
SSD1351plus(27,28,24,96,1)'DCpin, RSTpin, CSpin, vertical resolution, orientation
' Orientation: LANDSCAPE=1,PORTRAIT=2,RLANDSCAPE=3,RPORTRAIT=4
end sub
'
' File SSD1351plus.bas written 22-Feb-2016 15:47:47
'
CSUB SSD1351plus
00000248
'writeData
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050006 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF001C 8FB10018
8FB00014 03E00008 27BD0020
'writeCommand
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050005 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
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 00809821
00A09021 00C0A021 3C029D00 8C420090 8050003C 80420015 24030001 14430010
00E08821 240400A1 0411FFAE 00000000 24020060 16020006 00002021 24040060
0411FF85 00000000 10000026 24100074 0411FF81 00000000 10000022 24100074
24030004 14430009 24030002 240400A1 0411FF9C 00000000 00002021 0411FF76
00000000 1000003A 24100064 1443000F 240400A1 0411FF93 00000000 24020060
56020006 00002021 24040060 0411FF6A 00000000 1000002E 24100076 0411FF66
00000000 1000002A 24100076 0411FF85 00000000 00002021 0411FF5F 00000000
24100066 240400A0 0411FF7E 00000000 02002021 0411FF58 00000000 24040015
0411FF78 00000000 326400FF 0411FF52 00000000 328400FF 0411FF4F 00000000
24040075 0411FF6F 00000000 324400FF 0411FF49 00000000 322400FF 0411FF46
00000000 2404005C 0411FF66 00000000 8FBF0024 8FB40020 8FB3001C 8FB20018
8FB10014 8FB00010 03E00008 27BD0028 240400A0 0411FF5B 00000000 36040001
0411FF35 00000000 24040075 0411FF55 00000000 326400FF 0411FF2F 00000000
328400FF 0411FF2C 00000000 1000FFDD 24040015
'DrawBitmapSPI
27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
AFB20030 AFB1002C AFB00028 0080B821 AFA50054 00C08821 AFA7005C 8FB00060
8FA60064 8FA30068 8FB2006C 3C02BF80 8C475A30 AFA70014 8C475A00 AFA70018
8C475A40 AFA7001C 34078060 AC475A00 24070001 AC475A30 24070C00 AC475A40
7CD61340 00061403 2407FFF8 00471024 02C2B025 32D600FF 7CD520C0 00063143
2402FFE0 00C23024 02A6A825 32B500FF 7C741340 00033403 00C73824 0287A025
329400FF 7C7320C0 00031943 00621024 02629825 327300FF 2486FFFF 8FA20054
2447FFFF 72111002 00463021 8FA2005C 72021802 00673821 0411FF4C 00000000
3C1E9D00 8FC30090 8FC2001C 8064002C 0040F809 24050006 8FC30090 8FC2001C
8064002D 0040F809 24050005 8FA7005C 18E00065 02007021 8FBF0054 00111023
AFA20010 70F1C802 2739FFFF AFB10020 00006821 0000F021 240F0001 3C069D00
10000055 3C04BF80 0442002C 24630001 8CC50094 8CA50000 0045282B 50A00027
24630001 04E20025 24630001 8CC50098 8CA50000 00E5282B 50A00020 24630001
91850000 00AB2824 10A0000F 00000000 AC965A20 8C855A10 30A50080 10A0FFFD
00000000 8C855A20 AC955A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20
1000000E 24630001 AC945A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20
AC935A20 8C855A10 30A50080 10A0FFFD 00000000 8C855A20 24630001 1470FFD2
24420001 25080001 2529FFFF 11110010 014E5021 010D1021 24430007 284C0000
006C100B 000260C3 024C6021 000917C3 00021742 01225821 316B0007 01625823
016F5804 01401021 1000FFBF 00001821 27180001 17100004 24E70001 10000007
27DE0001 0000C021 1A20FFF9 02E05021 03204821 1000FFE7 00004021 03EEF821
8FA20010 0322C821 8FA30020 8FA7005C 13C70005 01A36821 1E00FFF2 03E03821
1000FFF6 27DE0001 3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006
3C02BF80 8FA30014 AC435A30 8FA70018 AC475A00 8FA3001C AC435A40 8FBF004C
8FBE0048 8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C
8FB00028 03E00008 27BD0050
'DrawRectangleSPI
27BDFFC0 AFBF003C AFBE0038 AFB70034 AFB60030 AFB5002C AFB40028 AFB30024
AFB20020 AFB1001C AFB00018 8FA30050 3C02BF80 8C575A30 8C5E5A00 8C485A40
AFA80010 34088060 AC485A00 24080001 AC485A30 24080C00 AC485A40 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
0411FE6F 00000000 3C129D00 8E430090 8E42001C 8064002C 0040F809 24050006
8E430090 8E42001C 8064002D 0040F809 24050005 24020001 00539823 0274A021
00552023 00962021 70942002 10800010 2484FFFF 3C02BF80 AC515A20 8C435A10
30630080 1060FFFD 00000000 8C435A20 AC505A20 8C435A10 30630080 1060FFFD
00000000 8C435A20 1480FFF3 2484FFFF 3C029D00 8C430090 8C42001C 8064002D
0040F809 24050006 3C02BF80 AC575A30 AC5E5A00 8FA30010 AC435A40 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 24A508FC 27A60010
0411FFEF 00000000 8FA40010 3C029D00 8C42002C 0040F809 02042021 8FBF001C
8FB00018 03E00008 27BD0020
'main
27BDFFC0 AFBF003C AFB50038 AFB40034 AFB30030 AFB2002C AFB10028 AFB00024
00809021 00A08821 00C09821 8CF40000 00002021 3C059D00 24A50968 27A60018
0411FFD4 00000000 3C109D00 8E020090 8E230000 A043002E 8E020090 8E430000
A043002C 8E020090 8E630000 A043002D 8E020090 8FA30050 8C630000 A0430015
8E020090 A054003C 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 8C43F220 7C63D800
3C020580 3442B053 00621826 24020030 24040014 0083100B 00401821 3C029D00
8C420088 00621821 8C640000 24030064 54830007 00008821 3C03BF80 8C715A30
8C725A00 8C755A40 10000003 3C03BF81 00009021 3C03BF81 8C64F220 7C84D800
3C030580 3463B053 00831826 24040030 24050014 00A3200B 00821021 8C430000
24020065 1062005A 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580
3463B053 00832026 2403000C 24050005 00A4180B 00602021 24050008 0040F809
00003021 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053
00832026 2403000C 24050005 00A4180B 00602021 24050065 0040F809 00003021
3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026
2403000B 2405002F 00A4180B 00602021 24050002 0040F809 00003021 3C029D00
8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026 2403000B
2405002F 00A4180B 00602021 24050065 0040F809 00003021 3C029D00 8C420010
3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026 2403000A 24050004
00A4180B 00602021 24050008 0040F809 00003021 3C029D00 8C420010 3C03BF81
8C64F220 7C84D800 3C030580 3463B053 00832026 2403000A 24050004 00A4180B
00602021 24050065 0040F809 00003021 3C02BF81 8C43F220 7C63D800 3C020580
3442B053 1462000C 3C02BF81 8C43FA90 24040001 7C831804 AC43FA90 3C02BF81
8C43FCA0 24040006 7C831804 AC43FCA0 1000000B 3C02BF80 8C43FA90 24040007
7C831804 AC43FA90 3C02BF81 8C43FC9C 24040006 7C831804 AC43FC9C 3C02BF80
34038060 AC435A00 24030001 AC435A30 24030C00 AC435A40 16200005 3C109D00
8C515A30 8C525A00 8C555A40 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 240400FD 24050001 24060012 0411FCE6
00000000 240400FD 24050001 240600B1 0411FCE1 00000000 240400AE 0411FCBB
00000000 240400B3 24050001 240600F1 0411FCD9 00000000 240400CA 24050001
2406007F 0411FCD4 00000000 240400A0 24050001 24060074 0411FCCF 00000000
24040015 24050002 00003021 2407007F 0411FCC9 00000000 24040075 24050002
00003021 2407007F 0411FCC3 00000000 240400A2 24050001 00003021 0411FCBE
00000000 240400B5 24050001 00003021 0411FCB9 00000000 240400AB 24050001
24060001 0411FCB4 00000000 240400B1 24050001 24060032 0411FCAF 00000000
240400BE 24050001 24060005 0411FCAA 00000000 240400A6 0411FC84 00000000
240200C8 AFA20010 240400C1 24050003 240600C8 24070080 0411FC9F 00000000
240400C7 24050001 2406000F 0411FC9A 00000000 24020055 AFA20010 240400B4
24050003 240600A0 240700B5 0411FC92 00000000 240400B6 24050001 24060001
0411FC8D 00000000 240400AF 0411FC67 00000000 2404005C 0411FC64 00000000
8E020090 90420015 30420001 10400007 3C029D00 8C430094 24040080 AC640000
8C420098 10000006 AC540000 8C430098 24040080 AC640000 8C420094 AC540000
8FA50018 3C029D00 8C430048 3C049D00 24840688 00852021 AC640000 8FA50018
8C43004C 3C049D00 2484035C 00852021 AC640000 8C430048 8C440094 8C860000
8C420098 8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809
24E7FFFF 3C02BF80 AC515A30 AC525A00 AC555A40 3C049D00 24840FF0 0411FE45
00000000 00001021 00001821 8FBF003C 8FB50038 8FB40034 8FB30030 8FB2002C
8FB10028 8FB00024 03E00008 27BD0040
'.rodata
'startup
31445353 20313533 76697264 6C207265 6564616F 000A0D64
End CSUB


C source for those interested

/*******************************************************************************
*
* Driver for SSD1351 Display written as CFunctions
*
* (c) Peter Mather 2015 with acknowledgements to Peter Carnegie & Geoff Graham
*
*
* This CFunction MUST be compiled with Optimization Level 1, -O1
* -O2,-O3,-Os will compile successfully, but generate exceptions at runtime.
*
* When Generating the CFunction, use MERGE CFunction mode, and name the CFunction
* SSD1351plus
*
* Entry point is function long long main(long long *DC,
* long long *RST,
* long long *CS
* long long *vertical resolution
* long long *orientation)
*
* V1.0 2015-10-15 Peter Mather
* V1.1 2016-02-22 Implement self calculation of address
*

* ******************************************************************************/
#include <stdarg.h>


#define Version 110 //Version 1.10
#define _SUPPRESS_PLIB_WARNING // required for XC1.33 Later compiler versions will need PLIB to be installed
#include <plib.h> // the pre Harmony peripheral libraries


#include "../cfunctions.h"


#define LANDSCAPE 1
#define PORTRAIT 2
#define RLANDSCAPE 3
#define RPORTRAIT 4

// SPI pin numbers and registers
#define SPI_INP_PIN (HAS_100PINS ? 11 : 47)
#define SPI_OUT_PIN (HAS_100PINS ? 12 : 5)
#define SPI_CLK_PIN (HAS_100PINS ? 10 : 4)
#define SPI_PPS_OPEN { if(HAS_100PINS) {PPSInput(2, SDI2, RPG7); PPSOutput(1, RPG8, SDO2); } else {PPSInput(2, SDI2, RPC13); PPSOutput(2, RPG7, SDO2);}}
#define SPICON *(volatile unsigned int *)(0xbf805A00) //SPI status register
#define SPISTAT *(volatile unsigned int *)(0xbf805A10) //SPI status register
#define SPIBUF *(volatile unsigned int *)(0xbf805A20) //SPI output buffer
#define SPIBRG *(volatile unsigned int *)(0xbf805A30) //SPI output buffer
#define SPICON2 *(volatile unsigned int *)(0xbf805A40) //SPI status register
#define REMAP_HORIZONTAL_INCREMENT 0
#define REMAP_VERTICAL_INCREMENT (1<<0)

#define REMAP_COLUMNS_LEFT_TO_RIGHT 0
#define REMAP_COLUMNS_RIGHT_TO_LEFT (1<<1)

#define REMAP_ORDER_BGR 0
#define REMAP_ORDER_RGB (1<<2)

#define REMAP_SCAN_UP_TO_DOWN 0
#define REMAP_SCAN_DOWN_TO_UP (1<<4)

#define REMAP_COM_SPLIT_ODD_EVEN (1<<5)

#define REMAP_COLOR_8BIT 0
#define REMAP_COLOR_RGB565 (1<<6)
#define REMAP_COLOR_18BIT (2<<6)

#define DEFAULT_REMAP_FLAGS ( REMAP_ORDER_RGB \
| REMAP_COM_SPLIT_ODD_EVEN \
| REMAP_COLOR_RGB565 )
#define CMD_COLS 0x15
#define CMD_ROWS 0x75
#define CMD_STARTLINE 0xA1
#define SSD1351_CMD_SETCOLUMN 0x15
#define SSD1351_CMD_SETROW 0x75
#define SSD1351_CMD_WRITERAM 0x5C
#define SSD1351_CMD_READRAM 0x5D
#define SSD1351_CMD_SETREMAP 0xA0
#define SSD1351_CMD_STARTLINE 0xA1
#define SSD1351_CMD_DISPLAYOFFSET 0xA2
#define SSD1351_CMD_DISPLAYALLOFF 0xA4
#define SSD1351_CMD_DISPLAYALLON 0xA5
#define SSD1351_CMD_NORMALDISPLAY 0xA6
#define SSD1351_CMD_INVERTDISPLAY 0xA7
#define SSD1351_CMD_FUNCTIONSELECT 0xAB
#define SSD1351_CMD_DISPLAYOFF 0xAE
#define SSD1351_CMD_DISPLAYON 0xAF
#define SSD1351_CMD_PRECHARGE 0xB1
#define SSD1351_CMD_DISPLAYENHANCE 0xB2
#define SSD1351_CMD_CLOCKDIV 0xB3
#define SSD1351_CMD_SETVSL 0xB4
#define SSD1351_CMD_SETGPIO 0xB5
#define SSD1351_CMD_PRECHARGE2 0xB6
#define SSD1351_CMD_SETGRAY 0xB8
#define SSD1351_CMD_USELUT 0xB9
#define SSD1351_CMD_PRECHARGELEVEL 0xBB
#define SSD1351_CMD_VCOMH 0xBE
#define SSD1351_CMD_CONTRASTABC 0xC1
#define SSD1351_CMD_CONTRASTMASTER 0xC7
#define SSD1351_CMD_MUXRATIO 0xCA
#define SSD1351_CMD_COMMANDLOCK 0xFD
#define SSD1351_CMD_HORIZSCROLL 0x96
#define SSD1351_CMD_STOPSCROLL 0x9E
#define SSD1351_CMD_STARTSCROLL 0x9F
#define SPIsend(a) {int j;SPIBUF=a; while((SPISTAT & 0x80)==0); j=SPIBUF;}
// set the chip select for the SPI to low (enabled)
// if the SPI is currently set to a different mode or baudrate this will change it accordingly
// also, it checks if the chip select pin needs to be changed
// set the chip select for SPI1 to high (disabled)
void writeData(unsigned char data){
PinSetBit(Option->LCD_CD, LATSET);
PinSetBit(Option->LCD_CS, LATCLR);
SPIsend(data);
PinSetBit(Option->LCD_CS, LATSET);
}
void writeCommand(unsigned char data){
PinSetBit(Option->LCD_CD, LATCLR);
PinSetBit(Option->LCD_CS, LATCLR);
SPIsend(data);
PinSetBit(Option->LCD_CS, LATSET);
}
void spi_write_cd(unsigned char command, int data, ...){
int i;
va_list ap;
va_start(ap, data);
writeCommand(command);
for(i = 0; i < data; i++) writeData((char)va_arg(ap, int));
va_end(ap);
}
/*******************************************************************************
*
* defines start/end coordinates for memory access from host to SSD1963
* also maps the start and end points to suit the orientation
*
* This function is a modified version of the function inside the MMBasic Interpreter
* for MM+ on 'MX470 chips
*
*******************************************************************************/
void defineregion(int from_x, int from_y, int to_x, int to_y) {
int remap;
int swap_xy,fill_vertical=0,vres=Option->pins[0];

if(Option->DISPLAY_ORIENTATION == LANDSCAPE) {
remap = DEFAULT_REMAP_FLAGS | REMAP_COLUMNS_LEFT_TO_RIGHT | REMAP_SCAN_DOWN_TO_UP;
swap_xy = 0;
writeCommand(CMD_STARTLINE);
if(vres==96)writeData(96); else writeData(0);
}
else if(Option->DISPLAY_ORIENTATION == RPORTRAIT) {
remap = DEFAULT_REMAP_FLAGS | REMAP_COLUMNS_LEFT_TO_RIGHT | REMAP_SCAN_UP_TO_DOWN;
swap_xy = 1;
writeCommand(CMD_STARTLINE);
writeData(0);
}
else if(Option->DISPLAY_ORIENTATION == PORTRAIT) {
remap = DEFAULT_REMAP_FLAGS | REMAP_COLUMNS_RIGHT_TO_LEFT | REMAP_SCAN_DOWN_TO_UP;
swap_xy = 1;
writeCommand(CMD_STARTLINE);
if(vres==96)writeData(96); else writeData(0);
}
else { // RLANDSCAPE
remap = DEFAULT_REMAP_FLAGS | REMAP_COLUMNS_RIGHT_TO_LEFT | REMAP_SCAN_UP_TO_DOWN;
swap_xy = 0;
writeCommand(CMD_STARTLINE);
writeData(0);
}

if(fill_vertical != swap_xy)
remap |= REMAP_VERTICAL_INCREMENT;
else
remap |= REMAP_HORIZONTAL_INCREMENT;
writeCommand(0xA0);
writeData(remap);


// set columns (normal) or rows (swapped)
writeCommand(swap_xy ? CMD_ROWS : CMD_COLS);
writeData(from_x);
writeData(to_x);

// set rows
writeCommand(swap_xy ? CMD_COLS : CMD_ROWS);
writeData(from_y);
writeData(to_y);

// setWriteRam command
writeCommand(0x5C);
}


//Print the bitmap of a char on the video output
// x, y - the top left of the char
// width, height - size of the char's bitmap
// scale - how much to scale the bitmap
// fc, bc - foreground and background colour
// bitmap - pointer to the butmap
void DrawBitmapSPI(int x1, int y1, int width, int height, int scale, int fc, int bc, unsigned char *bitmap){
int i, j, k, m;
unsigned char fhb, flb, bhb, blb;
unsigned int consave=0,brgsave=0,con2save;
brgsave=SPIBRG; //save any user SPI setup
consave=SPICON;
con2save=SPICON2;
SPICON=0x8060;
SPIBRG=1;
SPICON2=0xC00;
// convert the colours to 565 format
fhb = ((fc >> 16) & 0b11111000) | ((fc >> 13) & 0b00000111);
flb = ((fc >> 5) & 0b11100000) | ((fc >> 3) & 0b00011111);
bhb = ((bc >> 16) & 0b11111000) | ((bc >> 13) & 0b00000111);
blb = ((bc >> 5) & 0b11100000) | ((bc >> 3) & 0b00011111);

defineregion(x1, y1, x1 + (width * scale) - 1, y1 + (height * scale) -1);
PinSetBit(Option->LCD_CD, LATSET); //set CD high
PinSetBit(Option->LCD_CS, LATCLR);
for(i = 0; i < height; i++) { // step thru the font scan line by line
for(j = 0; j < scale; j++) { // repeat lines to scale the font
for(k = 0; k < width; k++) { // step through each bit in a scan line
for(m = 0; m < scale; m++) { // repeat pixels to scale in the x axis
if(x1 + k * scale + m >= 0 && x1 + k * scale + m < HRes && y1 + i * scale + j >= 0 && y1 + i * scale + j < VRes) { // if the coordinates are valid
if((bitmap[((i * width) + k)/8] >> (((height * width) - ((i * width) + k) - 1) %8)) & 1) {
SPIsend(fhb); SPIsend(flb);
} else {
SPIsend(bhb); SPIsend(blb);
}
}
}
}
}
}
PinSetBit(Option->LCD_CS, LATSET);
SPIBRG=brgsave; //restore user (or my) setup
SPICON=consave;
SPICON2=con2save;
}

// Draw a rectangle
// this is the basic drawing primitive used by most drawing routines
// x1, y1, x2, y2 - the coordinates
// c - the colour
void DrawRectangleSPI(int x1, int y1, int x2, int y2, int c){
unsigned int consave=0,brgsave=0,con2save;
int i,t;
unsigned char hb, lb;
brgsave=SPIBRG; //save any user SPI setup
consave=SPICON;
con2save=SPICON2;
SPICON=0x8060;
SPIBRG=1;
SPICON2=0xC00;
// make sure the coordinates are kept within the display area
if(x2 <= x1) { t = x1; x1 = x2; x2 = t; }
if(y2 <= y1) { t = y1; y1 = y2; y2 = t; }
if(x1 < 0) x1 = 0; if(x1 >= HRes) x1 = HRes - 1;
if(x2 < 0) x2 = 0; if(x2 >= HRes) x2 = HRes - 1;
if(y1 < 0) y1 = 0; if(y1 >= VRes) y1 = VRes - 1;
if(y2 < 0) y2 = 0; if(y2 >= VRes) y2 = VRes - 1;

// convert the colours to 565 format
hb = ((c >> 16) & 0b11111000) | ((c >> 13) & 0b00000111);
lb = ((c >> 5) & 0b11100000) | ((c >> 3) & 0b00011111);
defineregion(x1, y1, x2, y2);
PinSetBit(Option->LCD_CD, LATSET); //set CD high
PinSetBit(Option->LCD_CS, LATCLR);
i = x2 - x1 + 1;
i *= (y2 - y1 + 1);
while(i--){
SPIsend(hb);
SPIsend(lb);
}
PinSetBit(Option->LCD_CS, LATSET);
SPIBRG=brgsave; //restore user (or my) setup
SPICON=consave;
SPICON2=con2save;

}

__attribute__((noinline)) void getFPC(void *a, void *b, volatile unsigned int *c)
{
*c = (unsigned int) (__builtin_return_address (0) - (b -a)) ;
}
void pstring(const char *s){
volatile unsigned int libAddr ;
getFPC(NULL,&&getFPCLab,&libAddr) ; // warning can be ignored, stupid editor
getFPCLab: { }
unsigned char * testData = (unsigned char *)((void *)s + libAddr );
MMPrintString(testData);
}

/*******************************************************************************
*
* SSD1351 : Initialise the CFunction Driver Sub-System
*
* Function called to initialise the driver SubSystem
*
* SSD1352 is ALWAYS called from an MMBasic program
* On exit, vectors DrawRectangleVector, and DrawBitmapVector will
* be set to point to the CFunctions DrawRectangleSPI and
* DrawBitmapSPI respectively
*
* Entry point is function long long main(long long *MyAddress,
* long long *DC,
* long long *RST,
* long long *CS,
* long long *vertical resolution,
* long long *orientation)
*
******************************************************************************/
//CFunction Driver_ILI9341
long long main(long long *CD, long long *RST, long long *CS,long long *vres,long long *orientation){
int HorizontalRes=128,VerticalRes=*vres;
unsigned int consave=0,brgsave=0,con2save;
volatile unsigned int libAddr ;
getFPC(NULL,&&getFPCLab,&libAddr) ; // warning can be ignored, stupid editor
getFPCLab: { }
Option->LCD_Reset=*RST;
Option->LCD_CD=*CD;
Option->LCD_CS=*CS;
Option->DISPLAY_ORIENTATION=*orientation;
Option->pins[0]=VerticalRes;
//Option->DISPLAY_TYPE=4;

ExtCfg(Option->LCD_Reset,EXT_DIG_OUT,0);ExtCfg(Option->LCD_Reset,EXT_BOOT_RESERVED,0);
PinSetBit(Option->LCD_Reset, LATSET);
ExtCfg(Option->LCD_CD,EXT_DIG_OUT,0);ExtCfg(Option->LCD_CD,EXT_BOOT_RESERVED,0);
PinSetBit(Option->LCD_CD, LATSET);
ExtCfg(Option->LCD_CS,EXT_DIG_OUT,0);ExtCfg(Option->LCD_CS,EXT_BOOT_RESERVED,0);
PinSetBit(Option->LCD_CS, LATSET);
if(ExtCurrentConfig[SPI_OUT_PIN] == EXT_RESERVED) { //already open
brgsave=SPIBRG;
consave=SPICON;
con2save=SPICON2;
}
if(ExtCurrentConfig[SPI_OUT_PIN] != EXT_BOOT_RESERVED) { //already open
ExtCfg(SPI_OUT_PIN, EXT_DIG_OUT, 0); ExtCfg(SPI_OUT_PIN, EXT_BOOT_RESERVED, 0);
ExtCfg(SPI_INP_PIN, EXT_DIG_IN, 0); ExtCfg(SPI_INP_PIN, EXT_BOOT_RESERVED, 0);
ExtCfg(SPI_CLK_PIN, EXT_DIG_OUT, 0); ExtCfg(SPI_CLK_PIN, EXT_BOOT_RESERVED, 0);
}
SPI_PPS_OPEN;
SPICON=0x8060;
SPIBRG=1;
SPICON2=0xC00;// this is defined in IOPorts.h
if(!brgsave){ //save my settings
brgsave=SPIBRG;
consave=SPICON;
con2save=SPICON2;
}

//Reset the SSD1963
PinSetBit(Option->LCD_Reset,LATSET);
uSec(10000);
PinSetBit(Option->LCD_Reset,LATCLR);
uSec(10000);
PinSetBit(Option->LCD_Reset,LATSET);
uSec(10000);
spi_write_cd(SSD1351_CMD_COMMANDLOCK,1,0x12);
spi_write_cd(SSD1351_CMD_COMMANDLOCK,1,0xB1);
writeCommand(SSD1351_CMD_DISPLAYOFF);
spi_write_cd(SSD1351_CMD_CLOCKDIV,1,0xF1);
spi_write_cd(SSD1351_CMD_MUXRATIO,1,127);
spi_write_cd(SSD1351_CMD_SETREMAP,1,0x74);
spi_write_cd(SSD1351_CMD_SETCOLUMN,2,0x00,0x7F);
spi_write_cd(SSD1351_CMD_SETROW,2,0x00,0x7F);
spi_write_cd(SSD1351_CMD_DISPLAYOFFSET,1,0x0);
spi_write_cd(SSD1351_CMD_SETGPIO,1,0x00);
spi_write_cd(SSD1351_CMD_FUNCTIONSELECT,1,0x01);
spi_write_cd(SSD1351_CMD_PRECHARGE,1,0x32);
spi_write_cd(SSD1351_CMD_VCOMH,1,0x05);
writeCommand(SSD1351_CMD_NORMALDISPLAY);
spi_write_cd(SSD1351_CMD_CONTRASTABC,3,0xC8,0x80,0xC8);
spi_write_cd(SSD1351_CMD_CONTRASTMASTER,1,0x0F);
spi_write_cd(SSD1351_CMD_SETVSL ,3,0xA0,0xB5,0x55);
spi_write_cd(SSD1351_CMD_PRECHARGE2,1,0x01);
writeCommand(SSD1351_CMD_DISPLAYON);
writeCommand(SSD1351_CMD_WRITERAM);

if(Option->DISPLAY_ORIENTATION&1){
HRes=HorizontalRes;
VRes=VerticalRes;
} else {
VRes=HorizontalRes;
HRes=VerticalRes;
}

//Set the DrawRectangle vector to point to our function
DrawRectangleVector= (unsigned int)&DrawRectangleSPI + libAddr;

//Set the DrawBitmap vector to point to our function
DrawBitmapVector=(unsigned int)&DrawBitmapSPI + libAddr;


//CLS
DrawRectangle(0,0,HRes-1,VRes-1,0x000000);
SPIBRG=brgsave; //restore user (or my) setup
SPICON=consave;
SPICON2=con2save;
static const char startup[]="SSD1351 driver loaded\r\n";
pstring(startup);
return 0;

}
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 06:24am 22 Feb 2016
Copy link to clipboard 
Print this post

Thanks Peter,

I just finished trying the original (28pin) code with the 128x96 OLED. I didn't have a MM+ at hand but wanted to check OLED quality & current consumption.

All features work fine (as confirmed by your post) so am well pleased.

Am about to try your 'new' code and assume this is for MM+ only? Out of interest - what has changed from your second post's code in this 'updated code'? Is it speed/features/other?

By the way, with the 28pin code, CLS rgb(white) causes the screen to clear to white, but with noticable flicker. I seem to remember mentioning this before when having issues with TFTs. Have tried CPU SPEEDs from 20 to 48 but seems to have no impact. This is all on 28pin current so will try a E64+ next with your new code to see if this issue goes away (all other colours seem flicker free) . . . .

Will also try a 128x128 to see if different results. Overall image quality is superb, just wished it was slightly higher pixel resolution in same physical size screen.

Will update with progress . . .

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 07:01am 22 Feb 2016
Copy link to clipboard 
Print this post

  Quote  CLS rgb(white) causes the screen to clear to white, but with noticable flicker.


This is nothing to do with the Micromite or the driver code. Must be a function of the screen itself. Once the MM has loaded the pixels data into the screen it has no impact on the appearance.

You do seem sensitive to flicker, I remember you saw flicker in the PWM backlight when the rest of us didn't.

The OLED doesn't have a backlight as the OLED pixels generate the light themselves which is why it is so bright

  Quote  what has changed from your second post's code in this 'updated code'? Is it speed/features/other?

Other - you will see MMSTART no longer needs to calculate and pass the CFunction addressEdited by matherp 2016-02-23
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 07:32am 22 Feb 2016
Copy link to clipboard 
Print this post

@matherp

Using the OLED module's board with a 128x128 OLED screen inserted into the FPC. Changed the setting to reflect 128 pixels as opposed to 96 and all works well.

The flicker has gotten worse over time but only when white filling most of the screen.

I guess it is something to do with the boost circuit to generate the higher voltage as when I touch the passive components involved in the boost circuit, the flicker varies from extremely bad, to hardly at all.

I agree, it is nothing to do with MMBasic - so will work on this tonight to see if it can be eliminated.

Thanks for all your help with generating the SSD1351 code Much appreciated . . .

WW
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 02:00pm 22 Feb 2016
Copy link to clipboard 
Print this post

Maybe a silly question but is there a way to 'dim' OLED displays?

I have not 'Googled' this yet, just am sitting here now in a darkened room with the OLED glowing a bit too bright
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:01pm 22 Feb 2016
Copy link to clipboard 
Print this post

  Quote  Maybe a silly question but is there a way to 'dim' OLED displays?


Yes, command &HC7, see page 36 of the datasheet

would need a tiny stand-alone CFunction
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 11:31am 24 Feb 2016
Copy link to clipboard 
Print this post

@matherp

Something I uncovered with the SSD1968 TFTs during extensive testing was 'noise' when text was scrolled across the screen by using off-screen co-ordinates. As it was considered a bug, Geoff fixed the issue resulting in a 'clean' scroll.

However, when using the same scroll technique with the SSD1351 code (the code posted at the start of this thread) I noticed the noise issue; and also another strange behaviour. This is observed on a 28pinner by the way connected to a 128x96 pixel screen. Not yet tested you most recent code on a MM+.

Simplified example code will show what I mean:

CLS
DO
FOR x = 128 to -150 STEP -1
TEXT x,48,"MicroMite ",lm,8,1,RGB(white)
NEXT x
LOOP


All this is doing is continually scrolling the word 'MicroMite' from right to left; starting off-screen on the right, and going off-screen to the left.

The initial (x-co-ord) starting positioning is effectively off-screen at 128 (TEXT being left justified). Decreasing the x co-ord in a For..Next loop to x=-150 so that it scrolls off to the left.

However, on the right there is noise around the right hand visible character; and on the left, the left most character remains as a whole character at x=0 position . Hopefully you see this clearly if you run the code.

Please, is this something that can be fixed easily in software, or is it a big job (or even something caused by hardware)?

Appreciate your thoughts.

WW

EDIT: Should add that I am using TassyJim's excellent Font Editor app to display GroteskBold 16x32 font (http://www.rinkydinkelectronics.com/r_fonts.php)Edited by WhiteWizzard 2016-02-25
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:10pm 24 Feb 2016
Copy link to clipboard 
Print this post

Please post the complete test code including the font and I'll have a look
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 10:21pm 24 Feb 2016
Copy link to clipboard 
Print this post

  matherp said   Please post the complete test code including the font and I'll have a look


Thanks Peter.

The code above is enough to see the 'issue'.

The font file is here:2016-02-25_082024_PeterM_Font.zip

If you add a PAUSE into the loop (to slow the scrolling) it will help to see the 'left hand issue' easier!

Thanks . . .
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:31pm 24 Feb 2016
Copy link to clipboard 
Print this post

Try this version on the MX170

sub mm.startup
SSD1351(2,3,4,96,1)'DCpin, RSTpin, CSpin, vertical resolution, orientation
' Orientation: LANDSCAPE=1,PORTRAIT=2,RLANDSCAPE=3,RPORTRAIT=4
end sub
'
' File SSD1351.bas written 25-Feb-2016 08:07:16
'
CSUB SSD1351
00000259
'writeData
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
'writeCommand
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 00809821
00A09021 00C0A021 3C029D00 8C420090 8050003C 80420015 24030001 14430010
00E08821 240400A1 0411FFAE 00000000 24020060 16020006 00002021 24040060
0411FF85 00000000 10000026 24100074 0411FF81 00000000 10000022 24100074
24030004 14430009 24030002 240400A1 0411FF9C 00000000 00002021 0411FF76
00000000 1000003A 24100064 1443000F 240400A1 0411FF93 00000000 24020060
56020006 00002021 24040060 0411FF6A 00000000 1000002E 24100076 0411FF66
00000000 1000002A 24100076 0411FF85 00000000 00002021 0411FF5F 00000000
24100066 240400A0 0411FF7E 00000000 02002021 0411FF58 00000000 24040015
0411FF78 00000000 326400FF 0411FF52 00000000 328400FF 0411FF4F 00000000
24040075 0411FF6F 00000000 324400FF 0411FF49 00000000 322400FF 0411FF46
00000000 2404005C 0411FF66 00000000 8FBF0024 8FB40020 8FB3001C 8FB20018
8FB10014 8FB00010 03E00008 27BD0028 240400A0 0411FF5B 00000000 36040001
0411FF35 00000000 24040075 0411FF55 00000000 326400FF 0411FF2F 00000000
328400FF 0411FF2C 00000000 1000FFDD 24040015
'DrawBitmapSPI
27BDFFB8 AFBF0044 AFBE0040 AFB7003C AFB60038 AFB50034 AFB40030 AFB3002C
AFB20028 AFB10024 AFB00020 0080B021 AFA5004C 00C0A021 00E0F021 8FAB005C
8FAA0060 8FB50064 3C02BF80 8C435830 AFA30010 8C475800 AFA70014 8C435840
AFA30018 34038060 AC435800 24030001 AC435830 24030C00 AC435840 8FA7004C
28E50000 0005380B 00E02821 28840000 26C8FFFF 8FA20058 70461802 00684021
3C029D00 8C420094 8C460000 0106482B 24C6FFFF 24E2FFFF 8FA30058 707E3802
00E21021 3C039D00 8C630098 8C630000 0043382B 2463FFFF 7D701340 000B6403
240DFFF8 018D6024 020C8025 321000FF 7D7120C0 000B5943 240CFFE0 016C5824
022B8825 323100FF 7D521340 000A5C03 016D6824 024D9025 325200FF 7D5320C0
000A5143 014C6024 026C9825 327300FF 00005021 02C4500A 01402021 0109300B
0067100A 00403821 0411FF38 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 8FAA0010 AC4A5830 8FA30014 AC435800 8FA70018 AC475840
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 24080001 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
0411FE5E 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 24A50940 27A60010
0411FFEF 00000000 8FA40010 3C029D00 8C42002C 0040F809 02042021 8FBF001C
8FB00018 03E00008 27BD0020
'main
27BDFFC0 AFBF003C AFB50038 AFB40034 AFB30030 AFB2002C AFB10028 AFB00024
00809021 00A08821 00C09821 8CF40000 00002021 3C059D00 24A509AC 27A60018
0411FFD4 00000000 3C109D00 8E020090 8E230000 A043002E 8E020090 8E430000
A043002C 8E020090 8E630000 A043002D 8E020090 8FA30050 8C630000 A0430015
8E020090 A054003C 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
3C020661 3442A053 1082000B 24030050 3C02BF81 8C43F220 7C63D800 3C020660
3442A053 00621826 24020050 2404000C 0083100B 00401821 3C029D00 8C420088
00621821 8C640000 24030064 54830007 00008821 3C03BF80 8C715830 8C725800
8C755840 10000003 3C03BF81 00009021 3C03BF81 8C65F220 7CA5D800 3C040661
3484A053 10A4000B 24030050 3C03BF81 8C64F220 7C84D800 3C030660 3463A053
00831826 24040050 2405000C 00A3200B 00801821 00621021 8C430000 24020065
10620084 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 8C44FA84 24030001
7C641804 AC44FA84 3C02BF81 8C44FB04 24050003 7CA41804 AC44FB04 3C02BF80
34048060 AC445800 AC435830 24030C00 AC435840 16200005 3C109D00 8C515830
8C525800 8C555840 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 240400FD 24050001 24060012 0411FCAE 00000000
240400FD 24050001 240600B1 0411FCA9 00000000 240400AE 0411FC83 00000000
240400B3 24050001 240600F1 0411FCA1 00000000 240400CA 24050001 2406007F
0411FC9C 00000000 240400A0 24050001 24060074 0411FC97 00000000 24040015
24050002 00003021 2407007F 0411FC91 00000000 24040075 24050002 00003021
2407007F 0411FC8B 00000000 240400A2 24050001 00003021 0411FC86 00000000
240400B5 24050001 00003021 0411FC81 00000000 240400AB 24050001 24060001
0411FC7C 00000000 240400B1 24050001 24060032 0411FC77 00000000 240400BE
24050001 24060005 0411FC72 00000000 240400A6 0411FC4C 00000000 240200C8
AFA20010 240400C1 24050003 240600C8 24070080 0411FC67 00000000 240400C7
24050001 2406000F 0411FC62 00000000 24020055 AFA20010 240400B4 24050003
240600A0 240700B5 0411FC5A 00000000 240400B6 24050001 24060001 0411FC55
00000000 240400AF 0411FC2F 00000000 2404005C 0411FC2C 00000000 8E020090
90420015 30420001 10400007 3C029D00 8C430094 24040080 AC640000 8C420098
10000006 AC540000 8C430098 24040080 AC640000 8C420094 AC540000 8FA50018
3C029D00 8C430048 3C049D00 248406CC 00852021 AC640000 8FA50018 8C43004C
3C049D00 2484035C 00852021 AC640000 8C430048 8C440094 8C860000 8C420098
8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809 24E7FFFF
3C02BF80 AC515830 AC525800 AC555840 3C049D00 248410C8 0411FE1E 00000000
8FBF003C 8FB50038 8FB40034 8FB30030 8FB2002C 8FB10028 8FB00024 03E00008
27BD0040
'.rodata
'startup
31445353 20313533 76697264 6C207265 6564616F 000A0D64
End CSUB
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:57pm 24 Feb 2016
Copy link to clipboard 
Print this post

and this version on the MX470


sub mm.startup
SSD1351plus(27,28,24,96,1)'DCpin, RSTpin, CSpin, vertical resolution, orientation
' Orientation: LANDSCAPE=1,PORTRAIT=2,RLANDSCAPE=3,RPORTRAIT=4
end sub
'
' File SSD1351plus.bas written 25-Feb-2016 08:07:16
'
CSUB SSD1351plus
00000259
'writeData
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050006 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
3C029D00 8C430090 8C42001C 8064002D 0040F809 24050006 8FBF001C 8FB10018
8FB00014 03E00008 27BD0020
'writeCommand
27BDFFE0 AFBF001C AFB10018 AFB00014 309100FF 3C109D00 8E030090 8E02001C
8064002C 0040F809 24050005 8E030090 8E02001C 8064002D 0040F809 24050005
3C02BF80 AC515A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20
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 00809821
00A09021 00C0A021 3C029D00 8C420090 8050003C 80420015 24030001 14430010
00E08821 240400A1 0411FFAE 00000000 24020060 16020006 00002021 24040060
0411FF85 00000000 10000026 24100074 0411FF81 00000000 10000022 24100074
24030004 14430009 24030002 240400A1 0411FF9C 00000000 00002021 0411FF76
00000000 1000003A 24100064 1443000F 240400A1 0411FF93 00000000 24020060
56020006 00002021 24040060 0411FF6A 00000000 1000002E 24100076 0411FF66
00000000 1000002A 24100076 0411FF85 00000000 00002021 0411FF5F 00000000
24100066 240400A0 0411FF7E 00000000 02002021 0411FF58 00000000 24040015
0411FF78 00000000 326400FF 0411FF52 00000000 328400FF 0411FF4F 00000000
24040075 0411FF6F 00000000 324400FF 0411FF49 00000000 322400FF 0411FF46
00000000 2404005C 0411FF66 00000000 8FBF0024 8FB40020 8FB3001C 8FB20018
8FB10014 8FB00010 03E00008 27BD0028 240400A0 0411FF5B 00000000 36040001
0411FF35 00000000 24040075 0411FF55 00000000 326400FF 0411FF2F 00000000
328400FF 0411FF2C 00000000 1000FFDD 24040015
'DrawBitmapSPI
27BDFFB8 AFBF0044 AFBE0040 AFB7003C AFB60038 AFB50034 AFB40030 AFB3002C
AFB20028 AFB10024 AFB00020 0080B021 AFA5004C 00C0A021 00E0F021 8FAB005C
8FAA0060 8FB50064 3C02BF80 8C435A30 AFA30010 8C475A00 AFA70014 8C435A40
AFA30018 34038060 AC435A00 24030001 AC435A30 24030C00 AC435A40 8FA7004C
28E50000 0005380B 00E02821 28840000 26C8FFFF 8FA20058 70461802 00684021
3C029D00 8C420094 8C460000 0106482B 24C6FFFF 24E2FFFF 8FA30058 707E3802
00E21021 3C039D00 8C630098 8C630000 0043382B 2463FFFF 7D701340 000B6403
240DFFF8 018D6024 020C8025 321000FF 7D7120C0 000B5943 240CFFE0 016C5824
022B8825 323100FF 7D521340 000A5C03 016D6824 024D9025 325200FF 7D5320C0
000A5143 014C6024 026C9825 327300FF 00005021 02C4500A 01402021 0109300B
0067100A 00403821 0411FF38 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 AC505A20 8C445A10 30840080
1080FFFD 00000000 8C445A20 AC515A20 8C445A10 30840080 1080FFFD 00000000
8C445A20 1000000D 00000000 AC525A20 8C445A10 30840080 1080FFFD 00000000
8C445A20 AC535A20 8C445A10 30840080 1080FFFD 00000000 8C445A20 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 8FAA0010 AC4A5A30 8FA30014 AC435A00 8FA70018 AC475A40
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 8C575A30 8C5E5A00 8C485A40
AFA80010 34088060 AC485A00 24080001 AC485A30 24080C00 AC485A40 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
0411FE5E 00000000 3C129D00 8E430090 8E42001C 8064002C 0040F809 24050006
8E430090 8E42001C 8064002D 0040F809 24050005 24020001 00539823 0274A021
00552023 00962021 70942002 10800010 2484FFFF 3C02BF80 AC515A20 8C435A10
30630080 1060FFFD 00000000 8C435A20 AC505A20 8C435A10 30630080 1060FFFD
00000000 8C435A20 1480FFF3 2484FFFF 3C029D00 8C430090 8C42001C 8064002D
0040F809 24050006 3C02BF80 AC575A30 AC5E5A00 8FA30010 AC435A40 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 24A50940 27A60010
0411FFEF 00000000 8FA40010 3C029D00 8C42002C 0040F809 02042021 8FBF001C
8FB00018 03E00008 27BD0020
'main
27BDFFC0 AFBF003C AFB50038 AFB40034 AFB30030 AFB2002C AFB10028 AFB00024
00809021 00A08821 00C09821 8CF40000 00002021 3C059D00 24A509AC 27A60018
0411FFD4 00000000 3C109D00 8E020090 8E230000 A043002E 8E020090 8E430000
A043002C 8E020090 8E630000 A043002D 8E020090 8FA30050 8C630000 A0430015
8E020090 A054003C 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 8C43F220 7C63D800
3C020580 3442B053 00621826 24020030 24040014 0083100B 00401821 3C029D00
8C420088 00621821 8C640000 24030064 54830007 00008821 3C03BF80 8C715A30
8C725A00 8C755A40 10000003 3C03BF81 00009021 3C03BF81 8C64F220 7C84D800
3C030580 3463B053 00831826 24040030 24050014 00A3200B 00821021 8C430000
24020065 1062005A 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580
3463B053 00832026 2403000C 24050005 00A4180B 00602021 24050008 0040F809
00003021 3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053
00832026 2403000C 24050005 00A4180B 00602021 24050065 0040F809 00003021
3C029D00 8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026
2403000B 2405002F 00A4180B 00602021 24050002 0040F809 00003021 3C029D00
8C420010 3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026 2403000B
2405002F 00A4180B 00602021 24050065 0040F809 00003021 3C029D00 8C420010
3C03BF81 8C64F220 7C84D800 3C030580 3463B053 00832026 2403000A 24050004
00A4180B 00602021 24050008 0040F809 00003021 3C029D00 8C420010 3C03BF81
8C64F220 7C84D800 3C030580 3463B053 00832026 2403000A 24050004 00A4180B
00602021 24050065 0040F809 00003021 3C02BF81 8C43F220 7C63D800 3C020580
3442B053 1462000C 3C02BF81 8C43FA90 24040001 7C831804 AC43FA90 3C02BF81
8C43FCA0 24040006 7C831804 AC43FCA0 1000000B 3C02BF80 8C43FA90 24040007
7C831804 AC43FA90 3C02BF81 8C43FC9C 24040006 7C831804 AC43FC9C 3C02BF80
34038060 AC435A00 24030001 AC435A30 24030C00 AC435A40 16200005 3C109D00
8C515A30 8C525A00 8C555A40 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 240400FD 24050001 24060012 0411FCD5
00000000 240400FD 24050001 240600B1 0411FCD0 00000000 240400AE 0411FCAA
00000000 240400B3 24050001 240600F1 0411FCC8 00000000 240400CA 24050001
2406007F 0411FCC3 00000000 240400A0 24050001 24060074 0411FCBE 00000000
24040015 24050002 00003021 2407007F 0411FCB8 00000000 24040075 24050002
00003021 2407007F 0411FCB2 00000000 240400A2 24050001 00003021 0411FCAD
00000000 240400B5 24050001 00003021 0411FCA8 00000000 240400AB 24050001
24060001 0411FCA3 00000000 240400B1 24050001 24060032 0411FC9E 00000000
240400BE 24050001 24060005 0411FC99 00000000 240400A6 0411FC73 00000000
240200C8 AFA20010 240400C1 24050003 240600C8 24070080 0411FC8E 00000000
240400C7 24050001 2406000F 0411FC89 00000000 24020055 AFA20010 240400B4
24050003 240600A0 240700B5 0411FC81 00000000 240400B6 24050001 24060001
0411FC7C 00000000 240400AF 0411FC56 00000000 2404005C 0411FC53 00000000
8E020090 90420015 30420001 10400007 3C029D00 8C430094 24040080 AC640000
8C420098 10000006 AC540000 8C430098 24040080 AC640000 8C420094 AC540000
8FA50018 3C029D00 8C430048 3C049D00 248406CC 00852021 AC640000 8FA50018
8C43004C 3C049D00 2484035C 00852021 AC640000 8C430048 8C440094 8C860000
8C420098 8C470000 AFA00010 8C620000 00002021 00002821 24C6FFFF 0040F809
24E7FFFF 3C02BF80 AC515A30 AC525A00 AC555A40 3C049D00 24841034 0411FE45
00000000 00001021 00001821 8FBF003C 8FB50038 8FB40034 8FB30030 8FB2002C
8FB10028 8FB00024 03E00008 27BD0040
'.rodata
'startup
31445353 20313533 76697264 6C207265 6564616F 000A0D64
End CSUB

 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 11:12pm 24 Feb 2016
Copy link to clipboard 
Print this post

Thanks Peter. Just back from school run so will try MX170 version now. . . .
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025