STM32 Journal - Digikey
STM32 Journal - Digikey
STM32 Journal - Digikey
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>STM32</strong> <strong>Journal</strong><br />
down, developers must minimize<br />
the expense for both of these<br />
processes as well as eliminate<br />
any unnecessary design delays.<br />
In the past, UIs for embedded<br />
systems were designed<br />
specifically for the hardware on<br />
which they were going to be<br />
run. With increasing pressure to<br />
shorten product design cycles, IP<br />
Java Application<br />
Java Class/API<br />
Wrapper C Java<br />
API C<br />
Driver C<br />
External<br />
Port<br />
Figure 1 Abstracting the hardware through a<br />
Hardware Abstraction Layer (HAL)<br />
frees the GUI framework from<br />
handling specific low-level details,<br />
leading to faster code development<br />
and greater reusability.<br />
reuse has become an important<br />
consideration in UI design.<br />
Ideally, developers need to be<br />
able to carry a UI across different<br />
products using MCUs that may<br />
be from different families as well.<br />
To achieve this, GUI application<br />
code is abstracted above<br />
the hardware. A Hardware<br />
Abstraction Layer (HAL) handles<br />
specific low-level details such<br />
as how graphical data is stored<br />
in memory and transferred to<br />
the display (see Figure 1). By<br />
interacting with the HAL using<br />
APIs, the GUI application code<br />
becomes a framework that can<br />
be ported across an MCU family<br />
with minimal rewriting required.<br />
Creating an extensible GUI<br />
framework is an involved<br />
process. The HAL enables<br />
developers to build the<br />
framework using a language<br />
other than assembly, leading to<br />
faster code development and<br />
greater reusability. Designing the<br />
framework using C, however,<br />
can still require substantial<br />
development resources.<br />
Ideally, rather than design<br />
a framework from scratch,<br />
developers can use off-the-shelf<br />
software to minimize development<br />
investment. With the right tools,<br />
the GUI design cycle can be<br />
shortened from months to weeks.<br />
GWStudio from GeeseWare,<br />
for example, is a Java Framework<br />
with a wide array of preexisting<br />
GUI libraries providing a complete<br />
human-machine interface (HMI)<br />
development environment. Its Java<br />
engine based on IS2T MicroEJ ®<br />
technology is specifically optimized<br />
for embedded applications that<br />
have limited memory, constrained<br />
peripherals, restricted network<br />
connectivity, and low power<br />
consumption requirements.<br />
Java brings many advantages to<br />
GUI-based design compared to<br />
working in C. Java was designed<br />
to facilitate GUI creation with an<br />
emphasis on reuse. In addition, its<br />
flexibility ensures a simple revision<br />
process that enables developers<br />
to quickly implement changes<br />
to existing designs. With the<br />
availability of Java for embedded<br />
applications, developers can<br />
leverage the benefits of Java in<br />
many applications:<br />
〉〉 Improved code portability<br />
and reuse<br />
〉〉 Accelerated development up<br />
to 3-5 times faster than<br />
working in C<br />
〉〉 Equivalent performance to<br />
C-based designs; i.e., less<br />
than 1 ms responsiveness for<br />
machine-to-machine (M2M)<br />
processes (i.e., Ethernet) or<br />
touchscreen latency<br />
〉〉 Greater functionality in a<br />
smaller footprint<br />
〉〉 Higher reliability and<br />
robustness by eliminating<br />
manual management of<br />
memory and exceptions<br />
〉〉 Operating system<br />
independence<br />
〉〉 Large development community<br />
Note that even though the GUI is<br />
written in Java, the main application<br />
can be based on C. This enables<br />
developers to introduce a GUI to an<br />
existing design without having to<br />
rewrite the application.<br />
Even with the framework in<br />
place, however, only half the job<br />
is done. Now the look and feel of<br />
the GUI needs to be designed.<br />
Intuitive Look and Feel<br />
Developing an effective GUI can<br />
be one of the most challenging<br />
aspects of system design. GUI<br />
design involves much more<br />
than simply arranging icons on<br />
a screen. To be intuitive, a user<br />
interface has to anticipate how a<br />
variety of different types of people<br />
are going to use the device.<br />
However, it can be very difficult<br />
to know how an end-customer<br />
is going to use a device from<br />
43