Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:45 29 Apr 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 : MM2: Update graphics routines

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 02:04am 28 Jun 2015
Copy link to clipboard 
Print this post

I've been previously requested (several times!!!) to create a thread in which the most up-to-date versions of my various graphics routines are posted - so here it is.

I had previously held off on doing this as I knew Geoff was going to include support for the SPI-connected ST7735, ILI9341 and ILI9163 displays in the MM2 firmware V4.7 and also that that would effectively standardise the various calls: BOX, CIRCLE etc. as well as the format for colour codes (RGB888)

However, the MM2 firmware for the MX170 doesn't and won't support the various parallel connect displays such as the SSD1963 (4.3", 5", and 7") and SSD1289 (3.2"). These not only have greater screen space and resolution than the SPI connected displays but update considerably faster.

I have tried to make the drawing routines in my programs as similar as possible to the in-built routines and will maintain this calling sequence for all routines going forward. So for example Geoff uses:

BOX X, Y, W, H, [LW], [EDGECOLOUR], [FILLCOLOUR]

My routine for the SSD1963 now is:

S1963.BOX(X, Y, W, H, EDGECOLOUR, [FILLCOLOUR])

Note, that as a true subroutine, the parameters must be enclosed in brackets. There is no mechanism of supporting optional parameters in the middle of the list so only trailing parameters may be optional. I have not implemented line width in any of the calls as this just adds unnecessary complexity, particularly as the LW parameter always appears in the middle of the parameter list and is always optional. However, is easy to mimic the effect yourself.

My routines support rotation at any time allowing you to write text in any orientation although you will have to do the coordinate calculations yourself as the 0,0 position moves with the orientation.

In addition my routines include a TRIANGLE command and also for the SSD1963, when wired in a specific way, they support scrolling of any sub-region of the screen.

I'd like to thank Peter Carnegie (G8JCF) for helping me to convert my "hacker" coding style into something more professional, something I'll try and maintain going forward.

The full function list including support for touch input is given below; all future routines will maintain this structure and calling sequence:


Define pin usage for the display:
Sub S1963.PinDefs(D0,D1,D2,D3,D4,D5,D6,D7,D8,D9,RS,RD,WR,RST)

Call S1963.PinDefs BEFORE calling anything else in S1963
D0-D9 Pins used for DB0-DB9 see notes below about optimisation
RS Pin used for RS
RD Pin used for RD
WR Pin used for WR
RST Pin used to generate Reset signal to display controller
For optimised update and scroll functionality, otherwise any valid pin
D0, Use 25
D1, Use 26
D2, Use 27
D3, Use 36
D4, Use 37
D5, Use 38
D6, Use 2
D7, Use 3
D8, Use 4
D9, Use 5


initialise display:
SUB S1963.init(size)
display size in inches, can be 4.3, 5, or 7

clear screen:
SUB S1963.CLS(colour)
clear the screen to the colour specified
if the colour is omitted the screen is cleared to black

set screen orientation:
SUB S1963.ROTATE(orientation)
valid values are PORTRAIT:0, RPORTRAIT:1, LANDSCAPE:2, RLANDSCAPE:3

plot PIXEL:
SUB S1963.PIXEL(x, y, c)
x, y coordinates of PIXEL, colour

draw circle:
SUB S1963.CIRCLE(x, y, r, c, f)
x, y coordinates of centre, radius, colour of outline, colour to fill
if colour to fill is omitted an outline only is drawn
to fill with black use the special function S1963.BLACK() as the colour
to generate a circle in a single solid colour use the same colour for the outline and the fill

draw triangle:
SUB S1963.TRIANGLE(x0, y0, x1, y1, x2, y2, c, f)
three coordinate pairs, colour of outline, colour to fill
if colour to fill is omitted an outline only is drawn
to fill with black use the special function S1963.BLACK() as the colour
to generate a triangle in a single solid colour use the same colour for the outline and the fill

print text:
SUB S1963.TEXT(x, y, text$, font, size, forecolour, backcolour)
x, y coordinates of top left of first character, font number, text string, size, c, foreground colour, background colour
if the background colour is omitted black will be used

print bitmap:
SUB S1963.BITMAP(x, y, bitmap, width, height, scale, forecolour, backcolour)
x, y coordinates of top left of the bitmap, bitmap, size, character orientation, foreground colour, background colour
the bitmap must be specifed as an array of integers
to output bitmap contained within a single integer use array size 1 and allocate the bimap to element 0

draw line:
SUB S1963.LINE(x0, y0, x1, y1, colour)
x, y of start line, x, y of end line, foreground colour, background colour

draw rectangle:
SUB S1963.BOX(x, y, w, h, c, f)
x, y coordinate of top left, width, height, colour of outline, colour to fill
if colour to fill is omitted an outline only is drawn
to fill with black use the special function S1963.BLACK() as the colour
to generate a rectangle in a single solid colour use the same colour for the outline and the fill

draw rounded rectangle:
SUB S1963.RBOX(x, y, w, h, r, c, f)
x, y coordinates of top left, width, height, radius of corner, colour of outline, colour to fill
if colour to fill is omitted an outline only is drawn
to fill with black use the special function S1963.BLACK() as the colour
to generate a rounded rectangle in a single solid colour use the same colour for the outline and the fill

scroll region:
SUB S1963.SCROLL(x ,y, w, h)
x, y coordinate of top left, width, height of scroll area

screen horizontal resolution in default orientation: S1963.MM.HRES.DEFAULT.DEFAULT
screen vertical resolution in default orientation: S1963.MM.VRES.DEFAULT.DEFAULT
screen horizontal resolution in current orientation: S1963.MM.HRES.DEFAULT
screen vertical resolution in current orientation: S1963.MM.VRES.DEFAULT


Touch input routines

initialise touch:
SUB XPT.init(IRQ,CSxl%, xr%, yt%, yb%, xs%, ys%, n%)
calibration parameters for the touch screen, if not specified will automatically call XPT.CALIBRATE
number of samples at each touch to minimise noise, defaults to 5
CS: chip select pin for XPT touch controller, any valid pin
IRQ: interrupt pin for XPT touch controller, any valid pin
S1963_default_rotation: default screen orientation for this display type, in the case of the S1963 this is LANDSCAPE:2

rotate screen keeping touch input correct :
SUB XPT.ROTATE(N)
valid values for N are PORTRAIT:0, RPORTRAIT:1, LANDSCAPE:2, RLANDSCAPE:3
note if S1963.ROTATE is used rather than XPT.ROTATE when touch is active subsequent touch coordinates will be incorrect

calibrate touch:
SUB XPT.CALIBRATE
no parameters
sets and prints the following values
XPT.XSAMPLE0, XPT.YSAMPLE0, XPT.XLEFT0, XPT.XRIGHT0, XPT.YTOP0, XPT.YBOTTOM0
for any given display these will be fixed so can be set as constants for future use
this allows the calibrate routine to be removed for working systems
the related variables XPT.XSAMPLE, XPT.YSAMPLE, XPT.XLEFT, XPT.XRIGHT, XPT.YTOP, XPT.YBOTTOM are set for the default orientation
these are changed by XPT.ROTATE from the values stored in XPT.XSAMPLE0 etc.

get touch coordinates:
FUNCTION XPT.SCREENPOS(x, y, t)
returns true if a touch has occured within the timeout period
returns false if the timeout has occured
if true, x and y coordinates of position touched
timeout after which a false return will occur if no touch




 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 02:07am 28 Jun 2015
Copy link to clipboard 
Print this post

SSD1963 V3.0.1

2015-06-28_120718_ssd1963-flex-touch-scroll.zip

SSD1289 V3.0

2015-06-28_143729_ssd1289-flex-touch.zip

Edited by matherp 2015-06-29
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 07:29am 28 Jun 2015
Copy link to clipboard 
Print this post

Peter, sorry for asking this if it has been mentioned before.
You have done huge amount of work on displays, but I can't seem to find anywhere some relatively clear document putting all of it together with some description. Is there anything like that?

Thanks,
Konstantin


http://rittle.org

--------------
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 08:35am 28 Jun 2015
Copy link to clipboard 
Print this post

The documentation is in the code. There is a complete description of all of the routines and the pin connections required. There is also an example program that demonstrates all of the routines. The intention of this thread is that you always know where to go to get the latest version of the code for any given display controller. I'm afraid that is all you get.

Here is a new display:

S6D1064 176x220 TFT display V1.0



Very cheap - e.g. this one

It is based on the S6D0164 controller and it needs a full 16-bit interface so why is it interesting?

Largely because it is by far the brightest and clearest TFT display I have found. For many applications you don't need the size and resolution of the bigger displays but you do need it to be visible. This one should be OK in even bright lighting conditions. It is, of course, very fast given a 16-bit interface and low resolution - a complete screen refresh takes just 22msec.

Full code, with description and comprehensive example, is in the ZIP

2015-06-28_183136_s6d0164.zip Edited by matherp 2015-06-29
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 11:15am 28 Jun 2015
Copy link to clipboard 
Print this post

Sweet..!

I just ordered 10 of the 2.2" units... I would love to find some "daylight readable" and I hope this one counts as one of them... Thanks Peter... These units look awesome...
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 03:37am 29 Jun 2015
Copy link to clipboard 
Print this post

  Quote  I just ordered 10 of the 2.2" units


You need to set the display to either 8 or 16-bit operation. This is done with the shorting jumper J2. Open is 8=bit, closed is 16-bit. Also I make the J1 jumper to bypass the regulator as we are running 3.3V for the Micromite




Here is a version of the code that will run in 8-bit mode. Please note that in 8-bit mode you must use connections DB8-DB15 and not the lower inputs which you may expect. With only an 8-bit databus this version will run easily on the 28-pin part with completely flexible pin allocation but it also contains optimisations that will automatically let it run faster on the 44-pin Micromite using pins 26,26,27,36,37,37,2,3 for DB8-DB15 respectively. If these pins are used the code also supports fully flexible scrolling of a sub area of the screen. Pins 4 and 5 may not be used if the 44-pin processor is wired for the optimised pinout.

S6D0164 8-bit V1.1

2015-06-29_181001_s6d0164-8.zip




Edited by matherp 2015-06-30
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 04:52pm 29 Jun 2015
Copy link to clipboard 
Print this post

You Da MAN Peter..!

Thanks for the solder blop info on these units.. I didn't see much at the website so it is a BIG help to get things wired up correctly..! I can use a LCDuMite board and try running the "big" bus... Planing on doing the same thing with the 7" unit...

P.S. - Just got the breakout boards for the DS1682 "Hobbs Meter" IC (SIOC-8) and the MAX9042 dual comparator (uMax-8) to handle incoming RPM pulses from the "tickle wire" on a spark plug... Yikes...! So much fun... So little time after work...

Anyway, a big THANK YOU Peter for your work and fine display selections..!!
Edited by Zonker 2015-07-01
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 04:42am 30 Jun 2015
Copy link to clipboard 
Print this post

SSD1963 V4.0

Significant performance enhancements
Colour palette changed to RGB888
Bus reduced to 8-bit + 3 control pins making code easier to use on 28-pin part
RS, any valid pin
RD, any valid pin, set to zero if tied high, scroll functionality not available if zero
WR, any valid pin
DB0, Use 25 for optimised update and scroll functionality, otherwise any valid pin
DB1, Use 26 for optimised update and scroll functionality, otherwise any valid pin
DB2, Use 27 for optimised update and scroll functionality, otherwise any valid pin
DB3, Use 36 for optimised update and scroll functionality, otherwise any valid pin
DB4, Use 37 for optimised update and scroll functionality, otherwise any valid pin
DB5, Use 38 for optimised update and scroll functionality, otherwise any valid pin
DB6, Use 2 for optimised update and scroll functionality, otherwise any valid pin
DB7, Use 3 for optimised update and scroll functionality, otherwise any valid pin
RST, any valid pin

NOTE: for optimised use pins 4 and 5 cannot be used

2015-06-30_144201_ssd1963-flex-touch-scroll.zip
Edited by matherp 2015-07-01
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 07:04am 01 Jul 2015
Copy link to clipboard 
Print this post

S6D0164 8-bit V1.2

I really like this display, it is so much brighter than any of the others I've tried, ideal for all sorts of instrumentation.

In this release I have removed the restrictions of pin usage so all functionality will now work irrespective of the pins used to connect to the processor. This means it will work as well on the 28-pin MM2 as the 44-pin. The absolute speed of update is slightly reduced but because the display is relatively low resolution the usability is not impacted.

The parameters to the triangle drawing routine remain unchanged, however, I have changed the triangle drawing Cfunction to accept an array of coordinates. This allows the routine to be used for drawing the gauge with the needle updating smoothly. The gauge code is now included in the demo as well as the scrolling multi-line plot




The code is attached:

2015-07-02_073225_s6d0164-8.zip

Please note I don't intend to further develop the 16-bit parallel bus routines for this display. It works perfectly well with an 8-bit bus and the reduced pin count makes it much more usable in many applications

If you really need more speed then just replace the Cfunction with the version below. Note in this case you must use a 44-pin MM2 and pins 25,26,27,36,37,38,2,3 connected to DB8-DB15. In this case pins 4 and 5 may not be used.


CFunction S6D8
00000600
'writeRegister
8cc20090 8c430004 8c460008 ac660000 00043202 3c03bf88 ac666230 8c460010
8c470014 acc70000 8c46000c 8c470014 acc70000 ac646230 8c440010 8c460014
ac860000 8c44000c 8c460014 ac860000 8c440000 8c460008 ac860000 00052202
ac646230 8c440010 8c460014 ac860000 8c44000c 8c460014 ac860000 ac656230
8c430010 8c440014 ac640000 8c43000c 8c420014 ac620000 03e00008 00000000

'initdisplay
27bdffc8 afbf0034 afb70030 afb6002c afb50028 afb40024 afb30020 afb2001c
afb10018 afb00014 0080a021 3c109d00 8e02003c 0040f809 24040200 0040b821
8e02003c 0040f809 24040294 ae8200a0 000217c3 ae8200a4 8e020024 8e840038
0040f809 24050006 aee20000 8e020024 8e840038 0040f809 24050005 aee20004
8e020028 0040f809 8e840038 24110001 00511004 aee20008 8e020024 8e840040
0040f809 24050006 aee2000c 8e020024 8e840040 0040f809 24050005 aee20010
8e020028 0040f809 8e840040 00511004 aee20014 8e840088 8e82008c 00821025
1040000a 02809821 8e020010 24050008 0040f809 00003021 8e02001c 8e840088
0040f809 24050006 02809821 26f10024 26f50044 02809021 3c109d00 24160001
8e020028 0040f809 8e440048 00561004 ae220000 8e020024 8e440048 0040f809
2405ffff ae220040 8e020024 8e440048 0040f809 24050007 ae220020 8e020024
8e440048 0040f809 00002821 ae220060 26310004 1635ffea 26520008 24110007
3c109d00 24120011 8e020010 8e640038 24050008 0040f809 00003021 8e02001c
8e640038 0040f809 24050005 26310001 1632fff5 26730008 3c109d00 8e02001c
8e840038 0040f809 24050006 8e02001c 8e840040 0040f809 24050006 00001021
00001821 ae820030 ae830034 02e01021 00001821 8fbf0034 8fb70030 8fb6002c
8fb50028 8fb40024 8fb30020 8fb2001c 8fb10018 8fb00014 03e00008 27bd0038

'defineregion
27bdffd0 afbf002c afb60028 afb50024 afb40020 afb3001c afb20018 afb10014
afb00010 8fb10040 2483ffff 00661821 24a6ffff 00c73021 8e280010 8e290000
8e270008 15000008 8e300090 00809821 00601021 00a0a021 00c09021 00a0b021
1000001a 0080a821 240a0001 150a000c 240a0002 00031827 00699821 00041027
00491021 00063027 00c7a021 00059027 02479021 0240b021 10000016 0040a821
550a000b 24090003 01263023 24d3ffff 00051027 00491021 0080a021 00609021
0080b021 1000000b 0040a821 24090003 15090008 00031827 00a09821 00c01021
0067a021 00049027 02479021 0240b021 00a0a821 24040036 00402821 02203021
0411FF0F 00000000 24040037 02602821 02203021 0411FF0A 00000000 24040038
02402821 02203021 0411FF05 00000000 24040039 02802821 02203021 0411FF00
00000000 24040020 02a02821 02203021 0411FEFB 00000000 24040021 02c02821
02203021 0411FEF6 00000000 8e020004 8e030008 ac430000 3c02bf88 ac406230
8e030010 8e040014 ac640000 8e03000c 8e040014 ac640000 24030022 ac436230
8e020010 8e030014 ac430000 8e02000c 8e030014 ac430000 8e020000 8e030008
ac430000 8fbf002c 8fb60028 8fb50024 8fb40020 8fb3001c 8fb20018 8fb10014
8fb00010 03e00008 27bd0030

'localfastfillrect
27bdffc0 afbf003c afbe0038 afb70034 afb60030 afb5002c afb40028 afb30024
afb20020 afb1001c afb00018 0080b821 8fa20050 8fa30054 8c740090 26920010
8e960010 2691000c 8e95000c 8e930014 7047f002 afa30010 00a02021 00c02821
00e03021 00403821 0411FF6A 00000000 7ee320c0 00171203 3042f800 00621025
0017b943 32f707e0 0057b825 00172a02 30a300ff 32e200ff 10620018 26900014
13c00030 27deffff 3c02bf88 2406ffff ac456230 8e430000 8e040000 ac640000
8e230000 8e040000 ac640000 ac576230 8e430000 8e040000 ac640000 8e230000
8e040000 ac640000 27deffff 17c6fff0 8fbf003c 1000001d 8fbe0038 3c02bf88
ac456230 8e830010 8e840014 ac640000 8e83000c 8e840014 ac640000 ac576230
8e820010 8e830014 ac430000 8e82000c 8e830014 ac430000 27deffff 13c00009
27deffff 2402ffff aed30000 aeb30000 aed30000 aeb30000 27deffff 17c2fffa
00000000 8fbf003c 8fbe0038 8fb70034 8fb60030 8fb5002c 8fb40028 8fb30024
8fb20020 8fb1001c 8fb00018 03e00008 27bd0040

'pixel
27bdffd8 afbf0024 afb10020 afb0001c 00808821 8cf00090 afa70010 00a02021
00c02821 24060001 24070001 0411FF14 00000000 7e2320c0 00111203 3042f800
00621025 00118943 323107e0 00518825 00111a02 3c02bf88 ac436230 8e030010
8e040014 ac640000 8e03000c 8e040014 ac640000 ac516230 8e020010 8e030014
ac430000 8e02000c 8e030014 ac430000 8fbf0024 8fb10020 8fb0001c 03e00008
27bd0028

'scroll
27bdffa0 afbf005c afbe0058 afb70054 afb60050 afb5004c afb40048 afb30044
afb20040 afb1003c afb00038 00809821 afa50064 afa7006c 24b7ffff 02e7b821
2482ffff 00461021 afa2002c 00008821 8fa20070 8c540090 02808021 8c5500a0
3c129d00 8e420028 8fa30070 0040f809 8c640088 24030001 00431804 afa30024
8e420024 8fa50070 8ca40088 0040f809 24050005 afa20018 8e420024 8fa30070
8c640088 0040f809 24050006 0040f021 26730001 afb30020 8fa4002c 0093102a
14400065 8fa5006c 00052840 afa5001c 26820064 afa20028 26940084 8fb60024
3c13bf81 8fa30064 0077182a afa30030 8fa40070 afa40010 8fa40020 8fa50064
24060001 8fa7006c 0411FEB4 00000000 8fa20028 00401821 8c640000 8c65ffc0
ac850000 24630004 5474fffc 8c640000 8fa30024 8fa50018 aca30000 8e63f220
8fa40024 afc40000 8e63f220 aca40000 8e63f220 afc40000 8e63f220 00001821
8fa50018 acb60000 8e64f220 afd60000 8e64f220 8e040084 8c850000 00752021
a0850000 24630001 8fa5001c 0065202a 1480fff3 02a09021 8c430000 8c44ffc0
ac640000 24420004 5682fffc 8c430000 8fa20070 afa20010 8fa30020 2464ffff
8fa50064 24060001 8fa7006c 0411FE83 00000000 8fa40030 10800018 8fa20064
3c03bf88 92440000 7c917a04 92440001 7c913804 00112202 ac646230 8e040010
8e050014 ac850000 8e04000c 8e050014 ac850000 ac716230 8e040010 8e050014
ac850000 8e04000c 8e050014 ac850000 24420001 1457ffeb 26520002 8fa50020
24a50001 afa50020 8fa3002c 0065102a 1040ffa8 8fa40070 8fbf005c 8fbe0058
8fb70054 8fb60050 8fb5004c 8fb40048 8fb30044 8fb20040 8fb1003c 8fb00038
03e00008 27bd0060

'DBitmap
27bdffa8 afbf0054 afbe0050 afb7004c afb60048 afb50044 afb40040 afb3003c
afb20038 afb10034 afb00030 afa40058 00a0f021 00c09821 afa70064 8fb10068
8fa4006c 8fa30070 8fb40074 8fa20078 8c450010 2ca50002 10a00005 8c500090
8c520000 8c450008 10000004 afa5001c 8c520008 8c450000 afa5001c 7c9520c0
00042a03 30a5f800 02a5a825 00042143 308407e0 02a4a825 7c7620c0 00032203
3084f800 02c4b025 00031943 306307e0 02c3b025 afa20010 8fa40058 03c02821
72333002 8fa20064 72223802 0411FE21 00000000 8fa30064 1860006e 0015ba02
0016ca02 02207821 afbe0020 00132823 afa50028 70731002 2442ffff afa20018
afb3002c 00007021 afa00024 24180001 1000005c 3c09bf88 04400029 0052602b
51800028 24630001 04c20026 24630001 51000024 24630001 916c0000 018a6024
11800011 00000000 ad376230 8e0c0010 8e0d0014 ad8d0000 8e0c000c 8e0d0014
ad8d0000 ad356230 8e0c0010 8e0d0014 ad8d0000 8e0c000c 8e0d0014 ad8d0000
10000010 24630001 ad396230 8e0c0010 8e0d0014 ad8d0000 8e0c000c 8e0d0014
ad8d0000 ad366230 8e0c0010 8e0d0014 ad8d0000 8e0c000c 8e0d0014 ad8d0000
24630001 1471ffd4 24420001 24840001 24a5ffff 10930010 00ef3821 008e1021
24430007 284b0000 006b100b 000258c3 028b5821 000517c3 00021742 00a25021
314a0007 01425023 01585004 00e01021 1000ffc1 00001821 27de0001 17d10004
24c60001 10000009 8fa30024 0000f021 1a60fff9 8fa70058 8fa50018 00002021
8fa2001c 1000ffe5 00c2402b 24630001 afa30024 8fa50020 00af2821 afa50020
8fa20018 8fa30028 00431021 afa20018 8fa5002c 8fa20024 8fa30064 10430005
01c57021 1e20ffe9 8fa60020 1000ffef 8fa30024 8fbf0054 8fbe0050 8fb7004c
8fb60048 8fb50044 8fb40040 8fb3003c 8fb20038 8fb10034 8fb00030 03e00008
27bd0058

'swap
8c820000 8ca30000 ac830000 03e00008 aca20000

'drawline
27bdffc8 afbf0034 afb60030 afb5002c afb40028 afb30024 afb20020 afb1001c
afb00018 00809821 afa5003c afa60040 afa70044 8fa20048 14c20016 8fb4004c
00e5102a 10400006 8fa2003c 27a4003c 27a50044 0411FFE5 00000000 8fa2003c
8fa70044 24e70001 24030001 afa30010 afb40014 02602021 00402821 8fa60040
00e23823 0411FDF8 00000000 10000046 8fbf0034 8fb5003c 8fa30044 16a30015
00759023 0046102a 10400006 8fa60040 27a40040 27a50048 0411FFCC 00000000
8fa60040 8fa20048 24420001 00461023 afa20010 afb40014 02602021 8fa5003c
24070001 0411FDE0 00000000 1000002e 8fbf0034 001227c3 00929026 02449023
02a3a82a 24040001 2405ffff 00b5200a 0080a821 00468823 00111fc3 00718826
00718823 00c2b02a 24030001 2404ffff 0096180a 0060b021 02328021 02602021
8fa5003c 8fa60040 02803821 0411FE2B 00000000 00101040 0051182a 54600008
0242102a 8fa3003c 8fa40044 1064000d 02118021 02a31821 afa3003c 0242102a
1440ffef 02602021 8fa20040 8fa30048 10430004 02128021 02c21021 1000ffe8
afa20040 8fbf0034 8fb60030 8fb5002c 8fb40028 8fb30024 8fb20020 8fb1001c
8fb00018 03e00008 27bd0038

'drawchar
27bdffd0 afbf002c 8faa0040 8fa90044 8fa20048 8fab004c 7c042420 3c039d00
8c630054 00052880 00a31821 8c650000 90a80001 90ac0002 008c682a 15a00019
90a30000 90ad0003 01ac6821 008d682a 51a00015 71024002 afa20010 afa60014
afa70018 71031002 000210c3 008c6023 704c2002 24840004 00a42821 afa5001c
afab0020 01402021 01202821 00603021 01003821 0411FEB1 00000000 1000000b
8fbf002c 71024002 afa80010 afab0014 00e02021 01402821 01203021 70623802
0411FD76 00000000 8fbf002c 03e00008 27bd0030

'testchar
8fa30010 8c680010 8c690000 70e61002 00442021 2d020002 10400009 8c630008
04800012 00001021 04a00010 0124302a 14c0000e 0065302a 14c0000c 00000000
2508fffe 2d080002 11000008 24020001 04800006 00001021 04a00004 0064182a
14600002 0125282a 38a20001 03e00008 00000000

'pstring
27bdffb8 afbf0044 afbe0040 afb7003c afb60038 afb50034 afb40030 afb3002c
afb20028 afb10024 afb00020 0080b821 00a08021 00c09821 00e0a021 8fb50064
3c029d00 8c420054 00041880 00621021 8c420000 90560000 92a20000 1840001b
8fb20060 72c7f002 24110001 afb20010 02002021 02602821 02803021 02c03821
0411FFC2 00000000 10400016 02b11021 80440000 afb00010 afb30014 afb40018
afb2001c 02e02821 8fa60058 8fa7005c 0411FF81 00000000 26310001 92a20000
0051102a 1040ffe9 021e8021 ae500020 001087c3 ae500024 ae530028 00139fc3
ae53002c 8fbf0044 8fbe0040 8fb7003c 8fb60038 8fb50034 8fb40030 8fb3002c
8fb20028 8fb10024 8fb00020 03e00008 27bd0048

'dcirch
27bdffb8 afbf0044 afbe0040 afb7003c afb60038 afb50034 afb40030 afb3002c
afb20028 afb10024 afb00020 0080a821 00a0a021 00c09821 00e08821 8fa30058
30620010 10400017 8fb6005c 00e63021 02c03821 0411FD5F 00000000 02a02021
02802821 02713023 02c03821 0411FD59 00000000 02a02021 02342821 02603021
02c03821 0411FD53 00000000 02a02021 02912823 02603021 02c03821 0411FD4D
00000000 1a200054 24120001 02519023 0011b823 0017b840 00008021 8fa20058
305e0004 30430002 afa30014 30420008 afa20018 8fa30058 30630001 afa30010
06400004 00000000 2631ffff 26f70002 02579021 13c0000d 26100001 02a02021
02142821 02333021 02c03821 0411FD31 00000000 02a02021 02342821 02133021
02c03821 0411FD2B 00000000 8fa20014 1040000e 8fa30018 02a02021 02142821
02713023 02c03821 0411FD22 00000000 02a02021 02342821 02703023 02c03821
0411FD1C 00000000 8fa30018 1060000e 8fa20010 02a02021 02912823 02133021
02c03821 0411FD13 00000000 02a02021 02902823 02333021 02c03821 0411FD0D
00000000 8fa20010 1040000e 0211102a 02a02021 02912823 02703023 02c03821
0411FD04 00000000 02a02021 02902823 02713023 02c03821 0411FCFE 00000000
0211102a 10400004 00101040 24420001 1000ffbb 02429021 8fbf0044 8fbe0040
8fb7003c 8fb60038 8fb50034 8fb40030 8fb3002c 8fb20028 8fb10024 8fb00020
03e00008 27bd0048

'fcirch
27bdffb0 afbf004c afbe0048 afb70044 afb60040 afb5003c afb40038 afb30034
afb20030 afb1002c afb00028 0080b821 00a0b021 8fb50068 18c00048 8fbe0070
24100001 02068023 0006a023 0014a040 00c08821 24130003 00009021 30e20001
afa20018 8fa30060 24630001 afa30020 30e70002 afa7001c 06000004 8fa20018
2631ffff 26940002 02148021 10400016 26520001 00111040 8fa30020 00621021
afa20010 afbe0014 02a02021 02572821 02d13023 24070001 0411FC57 00000000
8fa30060 02631021 afa20010 afbe0014 02a02021 02372821 02d23023 24070001
0411FC4D 00000000 8fa2001c 10400017 0251102a 00111040 8fa30020 00621021
afa20010 afbe0014 02a02021 02f22823 02d13023 24070001 0411FC3F 00000000
8fa30060 02631021 afa20010 afbe0014 02a02021 02f12823 02d23023 24070001
0411FC35 00000000 0251102a 10400003 02138021 1000ffc8 26730002 8fbf004c
8fbe0048 8fb70044 8fb60040 8fb5003c 8fb40038 8fb30034 8fb20030 8fb1002c
8fb00028 03e00008 27bd0050

'ftri
27bdff90 afbf006c afbe0068 afb70064 afb60060 afb5005c afb40058 afb30054
afb20050 afb1004c afb00048 afa40070 188000df 8fb20090 00a0a821 00c0b021
00e0b821 8fbe0080 8fa20084 afa20038 8fa30088 afa3003c 8fa4008c afa40040
afa00044 8ea20000 afa20020 8ec30000 afa30024 8ee20000 afa20028 8fc20000
afa2002c 8fa50038 8ca40000 afa40030 8fa5003c 8ca40000 afa40034 8fa40040
0043102a 10400009 8c910000 27a40024 27a5002c 0411FDD6 00000000 27a40020
27a50028 0411FDD2 00000000 8fa20034 8fa3002c 0043102a 1040000a 8fa2002c
27a40034 27a5002c 0411FDC9 00000000 27a40030 27a50028 0411FDC5 00000000
8fa2002c 8fa30024 0043102a 1040000a 8fb00024 27a40024 27a5002c 0411FDBC
00000000 27a40020 27a50028 0411FDB8 00000000 8fb00024 8fa20034 16020023
8fb3002c 8fa20020 afa20018 afa2001c 8fa30028 0062202a 10800003 0043102a
10000003 afa30018 54400001 afa3001c 8fa20030 8fa30018 0043182a 10600003
8fa3001c 10000004 afa20018 0062182a 54600001 afa2001c 8fa50018 8fa2001c
24420001 00451023 afa20010 afb20014 02202021 8fa60024 24070001 0411FBB3
00000000 10000069 8fa20044 00531026 0002102b 02629823 0270102a 14400030
8fa20034 24140001 8fa20020 8fa30024 02032823 8fa60028 00c23023 70a63002
8fa4002c 00832023 00c4001a 008001f4 00002012 00822021 afa40018 8fa60030
00c23023 70a62802 8fa60034 00c31823 00a3001a 006001f4 00001812 00621021
afa2001c 0044102a 10400006 8fa20018 27a40018 27a5001c 0411FD6D 00000000
8fa20018 8fa7001c 24e70001 afb40010 afb20014 02202021 00402821 02003021
00e23823 0411FB81 00000000 26100001 0270102a 1040ffd5 8fa20020 8fa20034
0050182a 54600031 8fa20044 24130001 8fa60028 8fa40020 8fa50030 8fa8002c
02083823 00a61823 70e33802 00484023 00e8001a 010001f4 00001812 00661821
afa30018 8fa70024 02073023 00a42823 70c53002 00471023 00c2001a 004001f4
00001012 00442021 afa4001c 0083202a 10800006 8fa20018 27a40018 27a5001c
0411FD3B 00000000 8fa20018 8fa7001c 24e70001 afb30010 afb20014 02202021
00402821 02003021 00e23823 0411FB4F 00000000 26100001 8fa20034 0050182a
1060ffd4 8fa60028 8fa20044 24420001 afa20044 26b50008 26d60008 26f70008
8fa30038 24630008 afa30038 8fa4003c 24840008 afa4003c 8fa50040 24a50008
afa50040 8fa30070 1443ff2e 27de0008 8fbf006c 8fbe0068 8fb70064 8fb60060
8fb5005c 8fb40058 8fb30054 8fb20050 8fb1004c 8fb00048 03e00008 27bd0070

'main
27bdffd0 afbf002c 8fa20040 8fa30044 8fa80048 8fa9004c 8faa0050 8c840000
1480000a 8fab0054 8ca40000 8cc50000 8ce60000 00403821 0411FB81 00000000
00002021 1000008f 00002821 240c0001 148c000d 240c0002 8ca40000 8cc50000
8ce60000 8c470000 8c620000 afa20010 afa80014 0411FB0D 00000000 00002021
10000080 00002821 148c000f 240c0003 8ca40000 afa30010 afa80014 afa90018
afaa001c afab0020 00c02821 00e03021 00403821 0411FEDA 00000000 00002021
10000070 00002821 148c000d 240c0005 8ca40000 8cc50000 8ce60000 8c470000
8c620000 afa20010 afa80014 0411FCD5 00000000 00002021 10000062 00002821
148c0009 240c0007 8ca40000 8cc50000 00e03021 0411F9BA 00000000 00002021
10000058 00002821 148c0010 240c0008 8ca40000 8cc50000 8ce60000 8c470000
8c620000 afa20010 8d020000 afa20014 afa90018 afaa001c 0411FD7F 00000000
00002021 10000047 00002821 148c0011 240c0009 8ca40000 8cc50000 8ce60000
8c470000 8c620000 afa20010 8d020000 afa20018 000217c3 afa2001c afa90020
0411FE3C 00000000 00002021 10000035 00002821 148c000d 240c000a 8ca40000
8cc50000 8ce60000 8c470000 8c620000 afa20010 afa80014 0411FDA4 00000000
00002021 10000027 00002821 548c0012 2408000b 8ca40000 8cc50000 8ce60000
8c470000 8c620000 afa20010 8d020000 afa20014 8d220000 afa20018 afaa001c
afab0020 0411FBD1 00000000 00002021 10000014 00002821 5488000b 2402000c
8ca40000 8cc50000 8ce60000 8c470000 afa30010 0411FB23 00000000 00002021
10000008 00002821 14820009 8fbf002c 00a02021 0411F98A 00000000 00402021
00002821 00801021 00a01821 8fbf002c 03e00008 27bd0030
End CFunction 'MIPS32 M4K

Edited by matherp 2015-07-03
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 04:00am 02 Jul 2015
Copy link to clipboard 
Print this post

SSD1963 V4.1

4.1 Automatic selection of optimisation removed to reduce CFunction size
Optimisation selectable by commenting/uncommenting relevant version of CFunction
all functions, including scrolling, available with any pin allocation
Changed triangle drawing CFunction to accept an array of coordinates
Dual Gauge added to demo code




 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 12:05am 07 Jul 2015
Copy link to clipboard 
Print this post

SSD1351 V2.0

Converted to 4.7 compatible calling sequence and use of internal fonts




2015-07-07_095612_ssd1351.zip

Things to note:

The code is only tested on a 128x96 version of the display but should also work on a 128x128 - feedback appreciated. The vertical resolution is set in the call to S1351.init

Due to the way the 96 line display addresses there is a limitation on changing orientation within a program. All orientations work properly if used by themselves.

You can also change flexibly between PORTRAIT and LANDSCAPE (or RPORTRAIT to RLANDSCAPE) within a program and everything will work properly. i.e. you can draw something in PORTRAIT and annotate it with text in LANDSCAPE before reverting back to PORTRAIT.

However, if you try and mix between the pairs strange things happen. So if you draw in PORTRAIT and try and annotate with text in RLANDSCAPE the things drawn in PORTRAIT will move on the screen when applying the text and visa versa.

I suspect this limitation will not apply if using a 128x128 display but again feedback would be appreciated
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 05:17pm 13 Jul 2015
Copy link to clipboard 
Print this post

@Matherp...

Good evening Peter.. The 2.2" TFT 176x220 Display units got here today... I programed up a 28 pinner with v4.7b8 and downloaded your program that uses the 8 bit interface... Out of time tonight, but should have it wired up tomorrow.. One question if I might... What value of current limiting resistor should be used for the LED back light..? I will be running the display on 3.3v (solder blob on J1) I was thinking 18 ohms, but not sure... What would give MAX brightness without decreasing the life of the back light..?

Thank you for you time fine Sir..!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 09:04pm 13 Jul 2015
Copy link to clipboard 
Print this post

  Quote  What value of current limiting resistor should be used for the LED back light..?


I just run 3.3V direct - but I haven't measured the current

In my simplistic world if it doesn't get too hot it is OK Edited by matherp 2015-07-15
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 12:41am 14 Jul 2015
Copy link to clipboard 
Print this post

Ok... Hey, I have got 10 of them... Tally Ho, here we go... I want to use these for single "slave" gauges on the Rs-485 bus. They just listen for their data values and show things using your awesome gauge code..! I think we need to add an "oh sh*t" mode if the unit stops receiving data from the bus... Maybe a large red "X" like I have seen on some other cockpit stuff... The comms protocol is dead easy, consisting of an attention character, "#", followed by gauge type, then gauge instance, and data value with a simple "cr-lf" as the terminator...

Anyway, nuff bable from here... I will get things hooked up tonight after I get back from the hell-hole... Thanks Peter for all your contributions to this project..! BTW - How is your GA- Airplane project build coming along..?
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 04:40pm 14 Jul 2015
Copy link to clipboard 
Print this post

Ok.. All seems fine... Demo code working OK... Brightness is indeed awesome..!
Demo has been running for about 4 hours... No heating problems with display back light... Sweet... I think this one is a winner... Now for some head scratching...

Thanks Peter for doing the hard stuff on this one..!!
 
Print this page


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

© JAQ Software 2024