Welcome Guest, you are in: Login

Fruit Of The Shed

Navigation (MMBasic)






Search the wiki

»


Page History: Multiple LCD panel displays

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2017/08/07 16:59


The Micromite can natively drive a number of common LCD panel displays - these can really bring a spark of panache to a project and are cheaply available on a number of electronics components outlets/tat-bazaars at around the £5 mark.

I have a requirement for such a display but it needs to be long rather than big due to restrictions on the space available. I decided to try stacking two 2.8" colour TFTs side by side, but would it be possible to drive them from a single Micromite?

In the breadboard knock-up, I handle the CS pins of each display individually. This requires two extra outputs and the code switches to the relevant display immediately before doing anything on it.

Here is a small video of the below code in action on a breadboard with a Micromite MkII 44pin.

Currently the displays are quite simplistic as this is only a proof of concept. I took the familiar test program from the Micromite manual and tweaked it to hold the relevant switching but it is essentially the same. Really, there is no practical limit to the number of LCDs you could drive in this way.

The Micromite needs to have the LCD options set at the command prompt but the program re-initialises the LCD panels with the GUI RESET command so that they play nicely. I also tied the LCD reset pins to VCC to prevent the GUI RESET commands fighting. You would probably be better off tying them to the master reset or to another output pin and controlling them manually too. This does sterilise the reset pin in the OPTION LCDPANEL command (19) from use.

If you are careful with the CS activity, there is no reason to lose any functionality - even when reading from the panels - MISO is tri-stated by the slave until the CS goes low - make sure you don't have both CSs low simultaneously. To minimise the control pins, you can use a simple selector and a single hi/lo selector for the displays as shown below. This could be expanded very easily to 16 displays with something like a 74HC154(!)

Image


' OPTION LCDPANEL ILI9341, orientation, D/C pin, reset pin [,CS pin]
'
' enter the below at the command prompt
' OPTION LCDPANEL ILI9341,RL,15,19 ' don't use CS, we'll handle that manually and 19 is out of use so choose a low-feature pin

  Pin(23)=1: SetPin 23,dout
  Pin(24)=1: SetPin 24,dout

  Pin(23)=0:GUI reset lcdpanel:Pin(23)=1)
  Pin(24)=0:GUI reset lcdpanel:Pin(24)=1)

  Const DBlue = RGB(0, 0, 128) ' A dark blue colour
  Colour RGB(GREEN), RGB(BLACK) ' Set the default colours
  Font 1, 3 ' Set the default font

  Do
    For n=23 To 24
      Pin(n)=0
      Box 0, 0, MM.HRes-1, MM.VRes/2, 3, RGB(RED), DBlue
      Text MM.HRes/2, MM.VRes/4, Time$, "CM", 1, 4, RGB(CYAN), DBlue
      Text MM.HRes/2, MM.VRes*3/4, Date$, "CM"
    'If Touch(X) <> -1 Then End
      Pin(n)=1
    Next
    Pause 1000
  Loop