Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:28 17 May 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: High res SSD1963 displays revisited

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 03:47am 19 Jun 2015
Copy link to clipboard 
Print this post



See the Youtube video for an idea of the performance achieved.

With the new facilities Geoff has included in 4.7b8 it is possible to make significant improvements to the code to drive displays other than the ones directly supported. I must also thank Peter Carnegie (G8JCF) who is creating, testing, and documenting the mechanisms to call internal Micromite firmware functions from CFunctions. Without his work this development wouldn't have been possible.

In this case, I have updated the code for the 44-pin MX170 to drive the 4.3", 5", and 7" SSD1963 displays.

I did more research on the SSD1963 and found a mode in which the colours can be loaded as two 9-bit parallel data elements. This supports RGB666 which gives better colour resolution than the RGB565 used by other displays.

The advantage of the 9-bit mode is that the 44-pin MX170 has 10 data pins on port C which do not overlap things like I2C or SPI. These connect to the 9-bit data bus and to the WR pin which is used to load the data on the bus.

pin set up allocation is:
'Fixed pins
setpin 25,dout 'C0 - connect to DB0
setpin 26,dout 'C1 - connect to DB1
setpin 27,dout 'C2 - connect to DB2
setpin 36,dout 'C3 - connect to DB3
setpin 37,dout 'c4 - connect to DB4
setpin 38,dout 'C5 - connect to DB5
setpin 2,dout 'C6 - connect to DB6
setpin 3,dout 'C7 - connect to DB7
setpin 4,dout 'C8 - connect to DB8
setpin 5,DOUT 'C9 - connect to WR
' Connect RD to VCC
' Connect CS to GND
'Flexible pins
Const RS=12 'define the pin to use for RS
const Master_reset=32 'define the pin to use for REST
setpin RS,DOUT
SETPIN Master_reset,dout

Note the display only uses 12 pins on the processor. Pins DB9-DB15 on the display can be left unconnected.

The code now uses the same in-built fonts as the directly supported displays and uses the same 24-bit colour codes (e.g. rgb(red))

All of the facilities are included in the demo code shown in the youtube video

2015-06-19_133829_ssd1963-44.zip

If you have used my display code before you will see that the new version is considerably smaller


The code has been tested on the 4.3" (480 x 272) and 5" (800 x 480) displays. I haven't got a 7" display. You will see in the code there are a number of "IF" statements that set up the display size. These can of course be simplified for a single size display.

I'm very pleased with this version - it allows the use of the larger displays on the MX170 and gives very good performance.

The C source for the Cfunctions is attached:

2015-06-19_135537_SSD1963.zip

The code only runs on 4.7b8 - do not use b11!!!!Edited by matherp 2015-06-20
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 07:41am 19 Jun 2015
Copy link to clipboard 
Print this post

Here is a version that has completely flexible pin assignment allowing use on the 28-pin MX170. Of course it is quite a bit slower but still perfectly usable for many applications.

You specify the pin allocation in the top of the program:

'
' Define the pins to use for all connections to the display
'
CONST RS=12 ' define the pin to use for RS
CONST WR=5 ' etc
CONST DB0=25
CONST DB1=26
CONST DB2=27
CONST DB3=36
CONST DB4=37
CONST DB5=38
CONST DB6=2
CONST DB7=3
CONST DB8=4
CONST Master_reset=32 'define the pin to use for REST
' Connect RD to VCC
' Connect CS to GND
'

The program will then take care of everything else to do with setting up and using the pins.

2015-06-19_173957_ssd1963flex.zip


 
nibbler
Newbie

Joined: 18/04/2013
Location: Canada
Posts: 11
Posted: 08:57am 19 Jun 2015
Copy link to clipboard 
Print this post

matherp - This is very interesting. As of today I have been waiting 44 days for my 2.4" screen to arrive here in Canada and have just about given up on it. Now I'm thinking of buying a larger one but might wait to see what further developments you or others make especially with the 7" screen.

Alan
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 09:06am 19 Jun 2015
Copy link to clipboard 
Print this post

Wow... Sweet Pete..!

I have the 7" version... I think I have a 44 pinner sitting on an unfinished LCD-uMite Board somewhere... Will start gathering parts...

(i think)
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2870
Posted: 01:53pm 19 Jun 2015
Copy link to clipboard 
Print this post

Perter(s),

This is wonderful... There is no stopping you blokes...

Is it possible to adapt to the 28pin '170? I realise that the there would be only 9 pins left over but as a `BackPack' display option they may still be enough for many applications and if we can keep the I2C lines free then the board can be an intelligent display and receive commands from a main Mite/cpu that handles all/most IO..


Love these TFT displays..



Regards,

Mick


Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 08:37pm 19 Jun 2015
Copy link to clipboard 
Print this post

  Quote  Is it possible to adapt to the 28pin '170


The second version (SSD1963flex) is for the 28-pin or 44-pin. It allows you to specify each pin individually so you can leave both the i2c and SPI pins free. Here is a slight update with some speed improvements and better comments.

2015-06-20_073815_ssd1963flex.zip Edited by matherp 2015-06-21
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 11:34pm 19 Jun 2015
Copy link to clipboard 
Print this post

  bigmik said   Perter(s),

This is wonderful... There is no stopping you blokes...

Is it possible to adapt to the 28pin '170? I realise that the there would be only 9 pins left over but as a `BackPack' display option they may still be enough for many applications and if we can keep the I2C lines free then the board can be an intelligent display and receive commands from a main Mite/cpu that handles all/most IO..


or use the MCP23017 16-Bit I/O Expander on I2C and use the same MicroMite for both functions, display and the extra 16 I/O lines. Much cheaper and the MCP23017 works well, it even handles interrupts on the individual pins.

Cheers
Chris

http://caroper.blogspot.com/
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 11:56pm 19 Jun 2015
Copy link to clipboard 
Print this post

  Quote  or use the MCP23017 16-Bit I/O Expander on I2C


I2C is much too slow. A complete refresh (CLR) of a 800*480 screen takes 800*480*18 bits + toggling the WR line after each 9-bits (or 16 if RGB565)

Just transferring the bits to I2C at 400KHz would take 17 seconds not including any protocol exchange.

A pair of 74HC595 on SPI at 10MHz is usable - I've done this before but it is still much slower than direct drive parallel

For reference a complete screen refresh of a 480x272 display on the 48MHz 44-pin using 9-bit parallel takes 27msecEdited by matherp 2015-06-21
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 12:25am 20 Jun 2015
Copy link to clipboard 
Print this post

  matherp said  
  Quote  or use the MCP23017 16-Bit I/O Expander on I2C


I2C is much too slow. A complete refresh (CLR) of a 800*480 screen takes 800*480*18 bits + toggling the WR line after each 9-bits (or 16 if RGB565)


I meant use the MicroMite to drive the Display directly and the Port Expander to replace the I/O lost. I agree driving displays via a port expander is fine for a 2x16 LCD text display but no good for graphics.

If you did need SPI though the MCP23S17 can run at 10MHz.

Personally I have never needed anything faster than the MCP23017, in my projects, for general I/O use.


http://caroper.blogspot.com/
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 124
Posted: 10:57pm 22 Jun 2015
Copy link to clipboard 
Print this post

Is it also possible to use the XPT2046 Type Touchscreen controller ?
(which some of the SSD1963 displays have included i.e. ebay item 281353506869)

I guess touch is a completely independent function
from this new mode of display control anyhow
 
matherp
Guru

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

  Quote  Is it also possible to use the XPT2046 Type Touchscreen controller ?

Of course

  Quote  I guess touch is a completely independent function


Exactly so.

I've appended the test routines using the touch code from this thread modified to use the Cfunction SSD1963 drawing routines to the standard graphics demo.

The first version is for the 44-pin MX170 running 4.7b8 and uses dedicated pins for the SSD1963 databus to get maximum performance. This also now includes a demo of the scrolling capability.

2015-06-23_122334_ssd1963-44-touch.zip

The second version will run on either the 28-pin or 44-pin Micromite (still needs 4.7b8) and allows completely flexible pin use (except of course for the SPI pins used to access the touch controller) at the expense of some performance. The flexible version does not support scrolling so this part of the demo is missing

2015-06-23_122435_ssd1963-flex-touch.zip

You will see that the touch calibration routine outputs 6 numbers
XSAMPLE0
YSAMPLE0
XLEFT0
XRIGHT0
XTOP0
XBOTTOM0

rather than run the calibration routine each time, these can be set as constants for any given display and the calibration routine then isn't needed.





Edited by matherp 2015-06-24
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 124
Posted: 03:24am 23 Jun 2015
Copy link to clipboard 
Print this post

Thank you so much for this full solution package !

I bought two of the original TFT Maximites last year at Segor in Berlin
But with all the recent additions from Geoff & you they got somewhat "stale" now

I do not expect any more updates to the TFT Maximite - so its time to switch...
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 02:29am 24 Jun 2015
Copy link to clipboard 
Print this post

Please find attached an updated version.

I have now combined the flexible pin allocation and the optimised version. In addition the scrolling function is now available in all screen orientations. This allows you to scroll in any direction by setting the orientation before calling the scroll routine and then setting it back if/as required.

The software will automatically use the optimisations if the pin allocation is suitable. The scrolling function is only available with the optimised pin allocation and RD connected to a pin on the Micromite. This snippet of the program header hopefully explains this. The 28-pin part cannot be configured for optimised operation or scrolling. However the update rate on the 28-pin is still fast enough for most applications even with a 800x480 display.

  Quote  
'
' Define the pins to use for all connections to the display
'
Const RS=12 ' define the pin to use for RS, any valid pin
const RD=13 ' define the pin to use for RD, any valid pin, set to zero if tied high, scroll functionality not available if zero
const WR=23 ' define the pin to use for WR, any valid pin
const DB0=25 ' Use pin 25 for optimised update and scroll functionality, otherwise any valid pin
const DB1=26 ' Use pin 26 for optimised update and scroll functionality, otherwise any valid pin
const DB2=27 ' Use pin 27 for optimised update and scroll functionality, otherwise any valid pin
CONST DB3=36 ' Use pin 36 for optimised update and scroll functionality, otherwise any valid pin
CONST DB4=37 ' Use pin 37 for optimised update and scroll functionality, otherwise any valid pin
CONST DB5=38 ' Use pin 38 for optimised update and scroll functionality, otherwise any valid pin
CONST DB6=2 ' Use pin 2 for optimised update and scroll functionality, otherwise any valid pin
CONST DB7=3 ' Use pin 3 for optimised update and scroll functionality, otherwise any valid pin
CONST DB8=4 ' Use pin 4 for optimised update and scroll functionality, otherwise any valid pin
const DB9=5 ' Use pin 5 for optimised update and scroll functionality, set to zero if not using PortC pins for databus
const Master_reset=32 ' define the pin to use for REST, any valid pin
' Connect CS to GND
'
const t_CS=42 ' chip select pin for XPT2046 touch controller, any valid pin
const T_IRQ=43 ' interrupt pin for XPT2046 touch controller, any valid pin
' Connect T_DO to SPIIN
' Connect T_CLK to SPICLK
' Connect T_DIN to SPIOUT


2015-06-24_122431_ssd1963-flex-touch-scroll.zip

The C code is attached if anyone wants to look and or modify it

2015-06-24_123206_SSD1963.zip

Edited by matherp 2015-06-25
 
Print this page


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

© JAQ Software 2024