This is only a preview of the November 2021 issue of Silicon Chip. You can view 0 of the 96 pages in the full issue. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "USB Cable Tester – Part 1":
Articles in this series:
Items relevant to "R80 Synthesised Aviation Band Receiver Kit":
Items relevant to "Modifying Micromite software to use a 3.5in display":
Items relevant to "Voice-operated and proximity lift controls":
Items relevant to "Pocket Weather Station":
Items relevant to "Model Railway Carriage Lights":
Items relevant to "Two- or Three-Way Stereo Active Crossover – Part 2":
Purchase a printed copy of this issue for $11.50. |
CIRCUIT NOTEBOOK
Interesting circuit ideas which we have checked but not built and tested. Contributions will be
paid for at standard rates. All submissions should include full name, address & phone number.
Modifying Micromite software to use a 3.5in display
Our readers often ask if it is possible
to make software written for the Micromite BackPack V1 (February 2016;
siliconchip.com.au/Article/9812) or
V2 (May 2017; siliconchip.com.au/
Article/10652) which normally use a
2.8in touchscreen to instead work with
the larger 3.5in display.
At the very least, a different display
driver is needed. The ILI9488 controller used on the 3.5in touchscreen does
not have a native Micromite MMBasic
driver, so we need to load an external
CSUB library.
This consumes around 6kB of
library space, so it won’t fit if the original program comes close to filling the
available flash memory space.
Assuming the driver fits, rewriting
the MMBasic code to function with
the 3.5in display is possible, but it is
tedious, time-consuming and requires
thorough testing.
That’s because these display controllers cannot perform scaling to fill
the screen. Also, Micromite fonts are
bitmap-based and cannot be resized
easily, except in integer multiples.
The 2.8in display has 320x240
pixels, while the 3.5in display has
480x320 pixels. Pixels would have to
be mapped 2:3, which would appear
chunky and grainy as this must be
done on a per-pixel basis.
Also, screen elements may be
anchored to the different parts of the
display, so they could become scattered confusingly around the screen.
But there is another, easier solution.
It tricks MMBasic into thinking that it
is connected to a 320x240 display, so
all display elements are where they
should be. As far as the MMBasic program is concerned, it is connected to
a 320x240 screen.
The downside is that these 320x240
pixels are located in one corner of the
larger screen, meaning that the entire
3.5in display area is not available. In
fact, since the pixel pitch of the 3.5in
display is smaller than the 2.8in display, the resulting active display area
is actually smaller.
Still, as long as you have 6kB of
flash memory spare, it will give you
a functional, working display. Most
importantly, it will be the same as far
as the software is concerned.
All you need to do is load our
Library file (available for download
from siliconchip.com.au/Shop/6/5949)
instead of the inbuilt LCD driver,
usually done with the OPTION LCDPANEL command. The main part of
the Library file is the ILI9488 driver
that we have used previously.
The MM.STARTUP subroutine runs
when the Micromite starts up. This
loads the driver, clears the display and
then uses POKE commands to override
the display driver resolution. After
this, the display is indistinguishable
(as far as MMBasic is concerned) from
the ILI9341 display driver.
By initialising and clearing the display before changing the resolution,
the unused parts of the display are
simply left blank. You could also add
other commands here to set this area
to a contrasting colour if needed.
The POKE commands are as follows.
You could modify the values to emulate other display sizes:
‘set width
POKE WORD PEEK(
WORD &H9D000094),320
‘set height
POKE WORD PEEK(
WORD &H9D000098),240
The sequence of commands needed
to configure the Micromite is as follows; these are also listed in the
Library file. After loading Library.bas
into the Micromite (eg, using MMEdit
or TeraTerm), type:
LIBRARY SAVE
WATCHDOG 1
OPTION TOUCH 7, 15
GUI CALIBRATE
GUI TEST LCDPANEL
GUI TEST TOUCH
While not elegant, this solution is fully functional and results in a pixelidentical image to what would be seen on a 2.8in screen. Here’s what a typical
screen from the DDS Signal Generator (April 2017; siliconchip.com.au/
Article/10616) looks like.
siliconchip.com.au
Australia’s electronics magazine
Following these steps, develop or
load your MMBasic program. This
solution will only work with the
V1-V3 Micromite BackPacks (using
the PIC32MX170 processor) and not
the Micromite Plus.
Tim Blythman, Silicon Chip.
November 2021 53
|