SwissMicros DM42 User manual

DM42 User Manual
v3.10.1, October 2018
Copyright © 2016-2018 SwissMicros GmbH

Table of Contents
About this User Manual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê1
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê1
CPU Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê1
IR Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê1
Internal FAT disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê1
Calculator Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê2
Virtual variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê2
RefLCD in more detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê3
Accessing virtual variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê5
F-Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê6
LCD Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê6
OFF Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê6
PIXEL and AGRAPH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê7
Alpha Input Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê7
Printing to File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê8
Program Decoder/Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê9
DM42 Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê9
Main Setup menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê9
File menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê10
1. Load Program > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê10
2. Save Program > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê10
3. Activate USB Disk > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê10
4. Show Disk Info > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
Calculator State menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
1. Load State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
2. Save State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
3. Load Clean State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
Print to File menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
1. Graphics Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê11
2. Text Print. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
3. Graphics in Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
4. Don’t print to IR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
Settings menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
1. Set Time > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
2. Set Date >. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
3. Status Bar > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
4. Stack Font Sizes > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê12
5. Beep Mute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê13

6. Slow Auto-repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê13
7. Stack Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê13
System menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
1. Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
2. Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
3. Format FAT Disk > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
4. FAT Disk Media Test > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
5. Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
Firmware Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê14
Changes since v3.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê15
Quick Update Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê16
DMCP and PGM Update Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê17
Program Loading/Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê17
DMCP Update Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê18
Bootloader mode activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê18
FW Update Using dm_tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê19
Prerequisites for Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê19
Prerequisites for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê19
Launching dm_tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê19
FW Update Using dfu-util. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê20
QSPI flashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê22
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê22
Flashing QSPI from FAT disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê22
Flashing QSPI using dm_tool (obsolete) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê23
Flashing QSPI using dfu-util . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê23
DMCP System Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
1. Program Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
2. Run Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
3. Load Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
4. Load QSPI from FAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
5. Settings > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê24
6. Activate USB Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê25
7. Enter System Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê25
8. About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê25
QSPI Load menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê25
1. Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê25
2. Load QSPI from FAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê26
3. Activate USB Disk > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê26
4. Format FAT Disk > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê26
5. FAT Disk Media Test > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê26
6. Show Disk Info > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ê26

About this User Manual
This user manual refers to special features of DM42. Look at the following documentation for
description of basic calculator functionality:
•HP-42S Owner’s Manual
•HP-42S Programming Examples and Techniques
•Free42 Manual
General Information
CPU Speed
CPU speed is 24MHz when running on battery (due to limited battery current) and increases to
80MHz when the USB cable is connected.
IR Printing
Calculator contains IR output and can print on HP 82240B infrared printer.
Internal FAT disk
The calculator has 6MB of internal flash storage formatted as a FAT filesystem that is used for
loading/saving programs and for backing up calculator state. It is accessible as USB disk when
activated via the menu 'File > Activate USB Disk >'.
Internal flash has limited amount of write cycles. While the lifetime with ordinary
usage could be dozens of years, an excessive number of writes will wear the flash
memory much quicker.
Worst case scenario, you would have to replace the flash chip, which is worth less
than $1. If needed, SwissMicros will replace the chip at no cost, but shipping costs
must be covered by the customer.
The datasheet mentions a minimum of 100,000 write cycles, which sounds like a
lot, but any change in the filesystem means overwriting at least part of the file
allocation table, which is stored in a static location.
Calculator comes with pre-filled FAT disk contents. In case the contents of the FAT area is lost it
could be always downloaded from the SwissMicros DM42 FAT files page. There is the contents of
individual directories accessible separately or the whole contents of FAT disk can be downloaded as
single zip file DM42.zip.
There are several directories with special names on the FAT disk:
1

HELP
Contains help file(s) for built-in DM42 help that can be activated from main system soft menu by
pressing [ F1 ]key (leftmost in top row of keys).
OFFIMG
Bitmap files from this directory are displayed when the calculator is turned off. See OFF Images
chapter for more details.
PROGRAMS
Raw files with programs are loaded/saved from/to this directory.
SCREENS
Screenshots of calculator LCD are saved into this directory. See LCD Screenshots for more
details.
STATE
Calculator state files with extension .s42 are stored in this directory. See chapters Load State or
Save State how the load or save calculator state.
Calculator Extensions
Virtual variables
Managing some of the new features specific to the DM42 is something that spurred a lot of
discussion. Initially we wanted to re-purpose some of the so-called "reserved" flags of the HP-42S
but it soon became apparent that others had already done so in various patches for Free42 and we
wanted to avoid trampling on anybody’s toes with our own patches for Free42.
The next idea was to extend the number of flags available beyond 100 but obviously only have
them accessible via indirect addressing as there was no question of patching Free42 to accept 3
digits in the various flag instructions. But then, how do we make integer values (and one real value)
available to programs without assigning a whole block of flags that are going to be awkward to
read?
After that we thought of using extended register numbers. They would either have to be assigned
ridiculously high index numbers in order to avoid conflict if someone decided to go for a register
array SIZE of 2000, or they would have to be assigned negative index numbers. We couldn’t use
negative indexes because the HP-42S and Free42 just take the absolute value of the index and use
that to access the correct register and some programs might rely on that.
We settled on the concept of "Virtual Variables". These are variables that do not (and cannot, for
that matter) exist in the DM42’s variable table. Because of this, they are not listed in the variable
menu when you press RCL or STO but there is a way to make them easy-ish to access, just read on…
There are six such virtual variables:
"DevID"
2

Device ID (read-only) — RCL "DevID" returns the type of DM42 you’re using. There are currently
two hardware models only identified by value 0 (zero) is returned by the DM42 units that we
have. Other types of unit that may be produced in future will have different DevID values.
"GrMod"
Graphics Mode (read-write) — RCL "GrMod" retrieves the current graphics mode and STO
"GrMod" sets the graphics mode to the number present in the X register. Graphics modes
currently supported are:
•0 = standard HP-42S resolution 131x16
•1 = reserved for future use and maps to 0 on the DM42
•2 = DM42 full resolution 200x120
•3 = DM42 full resolution 400x240
"ResX" and "ResY"
X- and Y-resolution (read-only) — RCL "ResX" or RCL "ResY" recalls the current X-resolution or Y-
resolution respectively into the X stack register. The values that you will get are 131, 200 or 400
for RCL "ResX" and 16, 120 or 240 for RCL "ResY" depending on the current graphics mode (0, 2
or 3).
"Vbat"
Battery voltage (read-only) — If you’re running off battery power then this will give you the
voltage read at that precise moment in time. If you’re running on USB power then this will give
you the last battery voltage that was recorded before connecting the USB cable. Note that the
value retrieved here can and almost always will be different to the voltage displayed in the
status bar. The latter is cached and almost always retrieved when the DM42 is idle. The voltage
read from "Vbat" is the voltage read while you are using the keyboard and/or running a
program. This can be useful for pausing lengthy processing if the battery voltage drops below a
threshold and allowing it to recover before resuming.
"RefLCD"
The purpose of programs can vary significantly. There are programs like a stopwatch or games,
where quick refreshing of the LCD is required. On the other end of the spectrum are pure
computational programs, where no LCD output is required throughout program execution and
where it is more beneficial to utilize all the CPU time for computation rather than wasting it on
unnecessary LCD updates. The "RefLCD" virtual variable was introduced specifically to address
those different requirements. It is possible to disable LCD refreshing altogether or to enable the
periodic refresh of individual portions of the LCD.
RefLCD in more detail
It is possible to disable LCD refreshing altogether or to enable the periodic refresh of individual
portions of the LCD. The value that you store in this variable is in fact a bitmask as per the table
below. Items whose corresponding bit is cleared are not refreshed whereas those whose bit is set
are refreshed with 200ms timeout after the LCD contents changes.
3

Bit Val
ue
Zone
0 1 Main area (stack/graphics)
1 2 Goose
2 4 Annunciators
In order to prevent any part of the LCD from refreshing and thus maximize performance, store the
value 0 (zero) in "RefLCD". Storing 1 in the variable means that the main area will be updated with
200ms timeout (stack or the graphics display if that is what is active). 2 will allow the goose to fly
and 4 will allow the annunciators (including the flag tiles) to be updated. To have more than one
zone refreshed during program execution, store the sum of the bit value(s) in "RefLCD" as follows:
Val
ue
Bina
ry
Zone(s)
0 000 None (no refreshing occurs)
1 001 Main area
2 010 Goose
3 011 Main area and goose
4 100 Annunciators
5 101 Annunciators and main area
6 110 Annunciators and goose
7 111 Annunciators, goose and main area (everything)
You can, however, still refresh zones on an ad hoc basis even when they don’t normally refresh by
storing the negative value of the bitmask value in "RefLCD". For example, to update the
annunciators programatically "now", store -4 to "RefLCD".
One exception to this is the message area in which VIEW and AVIEW show their results. This is
never disabled and is repainted with 200ms delay(if needed) even if zero is stored in "RefLCD". If
the redraw response isn’t fast enough (e.g. for a stopwatch application, see below) then you can
have the message area refreshed by program by storing the value -8 in "RefLCD". This program
shows an example of how to use it:
4

00 { 49-Byte Prgm }
01▸LBL "STOPW"
02 TIME
03 →HR
04 STO 02
05 "RefLCD"
06 ASTO 03
07 CLX
08 STO IND 03 @ Disable refreshing
09 FIX 02
10▸LBL 00
11 TIME
12 →HR
13 RCL- 02
14 3600
15 ×
16 VIEW ST X
17 -8
18 STO IND 03 @ refresh the message area now
19 GTO 00
Accessing virtual variables
Attempting to STO a value in a read-only virtual variable has no effect, so it is not possible to create
these variables in the variables table within Free42. Because of this it is a bit awkward to RCL and
STO them directly. We recommend adding a reference to the virtual variables that you will need in
your program in order to access the variables indirectly later on. Something like this:
"GrMod"
ASTO 10
"ResX"
ASTO 11
"ResY"
ASTO 12
Where needed you can then simply address the virtual variables this way:
3
STO IND 10
"Pixels on "
├"screen: "
RCL IND 11
RCLx IND 12
ARCL ST X
AVIEW
STOP
5

F-Buttons
The top row of keyboard consists of six unprinted buttons referenced as F-Buttons (F1-F6) or Soft-
Menu Buttons. When no calculator menu is in action those buttons have following functions:
F1
Displays the Help. Note that the /HELP/index.htm file has to be present. The latest version can be
downloaded from the DM42 help page.
F2
Toggle this system soft menu visibility.
F3
(not assigned)
F4
Increase buzzer volume
SHIFT-F4
Decrease buzzer volume
F5
Toggle stack alignment (Left, Right, Right Underlined)
SHIFT-F5
Toggle between sans and HP font
F6
Increase font size
SHIFT-F6
Decrease font size
LCD Screenshots
Hold [ SHIFT ]and press [ DISP ]to get a screenshot.
You will find a .bmp file named according to the current time and date in the /SCREENS folder of
the FAT drive.
OFF Images
The LCD display used in DM42 calculator behaves in similar way as e-ink displays and contents of
the LCD is visible for a long time after the calculator is turned OFF.
This feature is used to display images when the calculator is turned OFF.
Single hard-coded OFF image is present in calculator firmware and this image is displayed
6

whenever the calculator is turned OFF and FAT disk doesn’t contain any valid custom image or the
FAT disk is in error state.
Custom OFF images should be stored in /OFFIMG/ directory. All valid images are then cyclically
displayed one after each calculator OFF in the order how they appear in /OFFIMG/ directory.
OFF images require specific image format. It has to be .bmp file with dimensions 400 x 240 and 1 bit
depth.
Examples of OFF images can be found on "A collection of off-screen images" page.
PIXEL and AGRAPH
PIXEL and AGRAPH are not limited to the original HP-42S’s resolution of 131x16 pixels. The
compatibility with negative values to display lines and with complex numbers and matrices is
conserved. You can now use horizontal values of 1≤X≤200 and vertical values of 1≤Y≤120 in
200x120 mode, or 1≤X≤400 and 1≤Y≤240 in 400x240 mode. Switching between 131x16, 200x120 and
400x240 modes is achieved using the GrMod virtual variable and current graphics resolution could
be probed by ResX and ResY.
Alpha Input Mode
Upon entering Alpha input mode you will see a new annunciator on the screen:
•"[ ]" denotes original HP-42S input mode. This is the mode that Alpha input starts with when
entered for the first time.
•"[a]" denotes lower case DM42 input mode.
•"[A]" denotes upper case DM42 input mode.
[ SHIFT ]followed by [ ▲ ]and [ ▼ ]allow you to cycle through the modes.
The DM42 remembers which mode you were in last time alpha input was active and upon entering
alpha input modes switches immediately to that mode.
Original HP-42S mode
•Function keys work as expected for standard characters.
•ASTO (STO) and ARCL (RCL) work as expected.
•"%", "pi" and "E" work as expected.
•[ SHIFT ][ SHOW ]works as expected.
•Local labels LBL 01, LBL A and LBL a work as expected.
•Global labels LBL "ABC", LBL "123" and LBL "A123" work as expected.
•Un-shifted [R/S] works as expected and [SHIFT] [R/S] enters/leaves Prgm mode as expected.
Lower and upper case DM42 modes
•The function keys still allow input in HP-42S mode.
7

•All alpha keys A-Z give the expected characters.
•[ SHIFT ][ A ]to [ SHIFT ][ O ]give the same characters.
•[ SHIFT ][ 0 ](zero) to [ SHIFT ][ 9 ]give the digits 0-9 instead of the alpha characters.
•Shifted [ ÷ ], [ × ], [ - ]and [ + ]give '÷', '×', '-' and '+' instead of the alpha characters.
•Shifted [ R/S ]gives '?' instead of entering/leaving Prgm mode.
•ASTO, ARCL, '%', 'pi' and 'E' (exponent) are not available. Switch to standard HP-42S mode to
get them.
•[ SHIFT ][ SHOW ]is not available. Use standard HP-42S mode.
•Two-digit local labels LBL 01 are not available. Use standard HP-42S mode.
•Local labels LBL A and LBL a and global labels LBL "ABC", LBL "123" and LBL "A123" work as
expected.
•Un-shifted [ R/S ]still behaves as usual allowing program execution to resume after inputting
alpha data to a program.
•Function arguments (eg. STO* "h") work as expected
SST/BST in alpha input mode
Press and hold the [ SHIFT ]key while pressing [ ▲ ]or [ ▼ ]in order to execute BST or SST
respectively when in alpha input mode. As on the original HP-42S, BST will start auto-repeating
after a while and SST will NULL after a couple of seconds if you press and hold [ ▲ ]or [ ▼ ]
respectively.
Printing to File
Since DM42 3.10 in addition to default IR printing user can choose printing to file.
This functionality can be activated in Print to File menu.
Two output formats are supported:
Graphics Print
Creates bitmap (.bmp) file with printed data in graphics.
Text Print
Creates text (.txt) file with printed data in UTF-8.
The output file /PRINTS/<time-stamp>.txt for text output and /PRINTS/<times-tamp>.bmp for graphics
output is created just after the 'Text Print' or 'Graphics Print' (respectively) is activated in menu.
Disabling one of those options flushes appropriate buffer and finishes the file. Next activation of
previously deactivated 'Text Print' or 'Graphics Print' creates new file with current time-stamp.
Printing buffers are allocated from available calculator memory just after the 'Text
Print' or 'Graphics Print' is selected in menu. Error is displayed if not enough
memory is available also no file is created and selected option isn’t activated.
8

There are two options for tweaking the print to file functionality:
Don’t print to IR
(affects both 'Text Print' and 'Graphics Print')
Disables printing to IR and printing delays.
Graphics in Text
(affects 'Text Print' only)
If enabled graphics prints appear as block graphics in text file using Unicode "Block Elements".
Note that you need reasonably equipped font to display the graphics print correctly (which isn’t
the default case for Windows users).
Program Decoder/Encoder
Thanks to generous contribution of Godwin (known as grsbanks in forum) we can use web based
program decoder and encoder for Free42 raw files - i.e. those files used for program import/export
in DM42.
Thus you can prepare your DM42 program directly on PC and then download it to DM42 and
import it there. As well as export programs written directly on DM42 and edit them on PC.
The program decoder/encoder is located at https://www.swissmicros.com/dm42/decoder/. Follow
this link and look into instructions tab for more details.
DM42 Menus
Menu navigation:
•Select menu items using [ ▲ ], [ ▼ ]keys.
•Activate current menu item by pressing [ ENTER ]key or by pressing the number key
corresponding to particular menu line.
•Return to previous menu level by [ EXIT ]key
Main Setup menu
Main 'Setup menu' could be entered by pressing [ SHIFT ]+[ SETUP ].
From there other sub-menus could be entered or about screen displayed
1. File menu
2. Calc. State menu
3. Print to File
4. Settings menu
5. System menu
6. About > Displays About screen.
9

File menu
1. Load Program >
Used for loading the *.raw programs stored in the /PROGRAMS/ directory of the flash storage.
It should display all *.raw files from /PROGRAMS/ directory in alphabetical order.
To load program
•Select the program to load using the [ ▲ ]and [ ▼ ]keys
•[ ENTER ]to load the selected program
Loading info flashes for a second until the program is loaded into calculator memory.
Then the program list is displayed again. You can load next program or leave the menu by [ EXIT ]
key.
2. Save Program >
Used for saving one or more program(s) from the calculator memory to a *.raw file in the
/PROGRAMS/ directory of the flash storage.
•Select the program or programs to save, confirm with [ ENTER ]
•Choose existing filename as target or type new target filename, confirm with [ ENTER ]
3. Activate USB Disk >
Used to copy files from/to a host computer - e.g. backup/restore the calculator state files from
/STATE/ directory or read/write programs in RAW format into /PROGRAMS/ directory.
•Connect the calculator to a computer using a USB cable
•The DM42’s flash disk should be visible on the computer
•Read/write files
•'Eject device' on the host machine.
•Calculator should end USB disk mode automatically if correctly ejected by OS. You can end USB
disk mode by pressing [ EXIT ]key on the calculator but be sure all data are flushed to disk first.
The last two points 'Eject device' and 'Press [ EXIT ]key on calculator' (if it doesn’t
end automatically) are important to avoid unsaved data and possible FAT disk
corruption!
Note that calculator programs must be stored in the /PROGRAMS/ directory of the
flash storage to be accessible from the calculator menu.
10

4. Show Disk Info >
Displays disk status and disk block info.
Calculator State menu
The calculator reads last used state file after a hardware RESET (i.e. after pressing the [RESET] on
the back of the calculator).
Reading of last stored calculator state file can be bypassed (eg. when the FAT disk is corrupted and
the calculator hangs after a reset while reading the state file) by holding the [ - ]key and pressing
the [RESET] button on the back of the calculator.
1. Load State
Displays list of available calculator state files (.s42 extension) from /STATE/ directory.
To load calculator state file:
•Select particular file and press [ ENTER ]to load the state file.
•Confirmation dialog appears and you have to acknowledge you want to abandon current
calculator state.
If confirmed, calculator is restarted and selected calculator state file loaded.
2. Save State
Used for saving current calculator state to a *.s42 file into the /STATE/ directory of the flash storage.
To save state file: - Select existing filename as target or type new target filename, confirm with
[ ENTER ]- Confirmation dialog can appears if existing file is about to be overwritten
If confirmed, calculator state is saved and subsequently is the calculator restarted and the
calculator state file reloaded.
3. Load Clean State
Restarts the calculator without reading the state file (same as [RESET] + [ - ]).
Print to File menu
For functional details look at Printing to File.
1. Graphics Print
Selecting this menu item enables printing to graphics file.
11

2. Text Print
Selecting this menu item enables printing to text file.
3. Graphics in Text
Selecting this menu item enables to see graphics in text file.
4. Don’t print to IR
Selecting this menu item disables default printing to IR printer.
Settings menu
1. Set Time >
Used for setting the time.
•Use the function keys to adjust the time.
•Press Set to write the new time to the calculator clock or [ EXIT ]to cancel your changes.
2. Set Date >
Used for setting the date.
•Use the function keys to adjust the date.
•Press Set to write the new date to the calculator clock or [ EXIT ]to cancel your changes.
•Σ+could be used to change between DMY/MDY formats.
3. Status Bar >
Displays filed selector for what should be displayed in calculator top status bar:
Status Bar menu
1. State Filename
2. Day of Week
3. Date
4. Date Separator
5. Month Shortcut
6. Time
7. Power Voltage in Header
Fields are always displayed in order how they appear in this menu.
4. Stack Font Sizes >
Enters font size configuration for stack registers:
12

Stack Font Sizes menu
1. Font Size Offset Reg X: 0
2. Font Size Offset Reg Y: 0
3. Font Size Offset Reg Z: 0
4. Font Size Offset Reg T: 0
5. Font Size Offset Reg L: 0
6. Font Size Offset Reg A: 0
For each register a font offset in range -5 .. 5 could be specified. Each font offset is relative to
current font size set by [ F6 ]/ [ SHIFT ]+[ F6 ]keys.
Example:
Lets expect there are five font sizes 1 to 5 and third font size is selected. If the "Font Size Offset Reg
X" is set to 1 and other offsets remain zeroed, then the X register will be displayed in one step larger
font then others.
Note that the if the maximal font size is reached the font remains at maximal size. So, setting all
font offsets to 5 actually disables any effect of [ F6 ]/ [ SHIFT ]+[ F6 ]keys.
5. Beep Mute
Selecting this menu item toggles the 'Beep Mute' flag.
When the 'Beep Mute' flag is active, no sounds are produced by the calculator.
Note that this value is stored in the calculator state file.
6. Slow Auto-repeat
Selecting this menu item toggles the 'Slow Auto-repeat' flag.
When the 'Slow Auto-repeat' flag is active auto-repeat delays are prolonged.
Note that this value is stored in the calculator state file.
7. Stack Layout
Enters stack layout selector where one of following layouts could be selected
Stack Layout menu
1. XYZTL
2. XYZTA
3. XYZT
4. XYL
5. XYA
6. XY
13

System menu
1. Bootloader
Activates bootloader mode for firmware flashing.
You can flash DM42 firmware once is the bootloader mode entered.
Press the RESET button on the back of the calculator if you activate Bootloader mode accidentally.
2. Diagnostics
Diagnostic screen for factory checking and troubleshooting.
3. Format FAT Disk >
Format the internal FAT disk storage. All data is erased.
4. FAT Disk Media Test >
Checks whole flash disk FAT area for bad blocks. Disk is formatted starting from first good block
after the check.
All data is erased from disk.
5. Self Test
Displays production test menu where tests of various parts of calculator could be run from.
Self Test menu
1. KBD Test
2. LCD Test
3. IR Test
4. BEEP Test
Firmware Update
Please remember it is always wise to make FAT disk backups periodically and
especially before any update.
Latest firmware is available at https://www.swissmicros.com/dm42/firmware/
If you are looking for quick update instructions you most probably want to follow Quick
Update Guide.
DM42 has two firmware areas. First one is the main flash area which is updated with each
14

firmware update, the second one is auxiliary QSPI area which is rarely updated and special update
menu appears when the firmware needs new QSPI contents.
Note that since version 3.7 the calculator operating system (called DMCP) is separated from the
DM42 program. Thus, both DMCP and DM42 program could be loaded separately. See Quick DMCP
and PGM Update Guide for details.
No action related to QSPI contents is needed until firmware requests QSPI update
by showing DMCP System menu or "QSPI Load" menu for versions before 3.7.
The preferred firmware update method is using calculator FAT disk which is available since
firmware version 3.5.
This method is implemented in main firmware, so it could be unavailable if the firmware is
corrupted. Then other method of update based on internal CPU flashing routine could be used. This
method requires the calc to be switched in so called 'Bootloader mode'.
The internal bootloader exposes standard DFU interface and can be programed by any DFU
programming software with limitation that firmware is plain binary file not file in general .dfu
format, so the programming software has to support it.
This section describes how to update firmware using FAT disk or using bootloader mode with two
utilities GUI based dm_tool and command line based dfu-util.
macOS users can get dfu-util via Homebrew
Availability of the particular update method on mainstream operating systems outlines following
table:
FAT disk dm_tool dfu-util
Windows X X X
Linux i686 X X X
Linux x86_64 X X X
macOS X X
Changes since v3.7
Since version 3.7 the firmware for the calculator contains only operating system (called DMCP).
DM42 program could be loaded separately as described in section Program update.
Instructions for quick update of both DMCP firmware and program load are in Quick Update Guide.
There is new DMCP User Manual future plan which should contain information about SDK and
program development for DMCP platform. Before the manual becomes available here are some
useful links related to DMCP development:
•Source code for DM42 program: https://github.com/swissmicros/DM42PGM
Follow instructions in README files for program building
15

•Source code for base DMCP_SDK with simple "Hello World" program: https://github.com/
swissmicros/DMCP_SDK
Follow instructions in README files for program building
•More enhanced SDK demo: https://github.com/swissmicros/SDKdemo.
It is simple RPN style calculator with
a. Power management
b. LCD printing
c. Keyboard handling
d. Use of Intel® Decimal Floating-Point Math Library (which leads to project with data in QSPI
flash)
e. Menu system
And as usually, follow instructions in README files for program building.
Developing programs for embedded systems requires some level of expertise and
SwissMicros doesn’t have enough resources to make individual support for
program building and SDK use.
Quick Update Guide
Here we will update DMCP system and DM42 program at once using combined flashing file,
therefore we need just single file for that:
Prerequisites
DMCP_flash_x.x_DM42-y.y.bin - Combined DMCP system file with DM42 program, e.g.
DMCP_flash_3.10_DM42-3.10.bin
Steps
1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from
DMCP System menu.
2. Connect USB cable from DM42 to PC/Mac computer.
3. Copy the DMCP_flash_x.x_DM42-y.y.bin file from the PC/Mac computer to root folder of calculator
disk.
4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can
take some time. Don’t unplug USB cable until safely ejected from OS.
5. Calculator detects presence of new firmware file and asks for update. You can confirm it
immediately or press EXIT key and activate flashing process later using "Flash firmware from
FAT" either from DM42 program "SETUP → System" or directly from DMCP System menu "Enter
System Menu"
6. Once finished the calculator resets and should restart to updated DM42 program.
16

DMCP and PGM Update Guide
Since version 3.7
Here we will update DMCP system and DM42 program separately, therefore we need two files for
that:
Prerequisites
DMCP_flash_x.x.bin - DMCP system file, e.g. DMCP_flash_3.10.bin
DM42-x.x.pgm - DM42 program file, e.g. DM42-3.10.pgm
Steps
1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from
DMCP System menu.
2. Connect USB cable from DM42 to PC/Mac computer.
3. Copy both DMCP_flash_x.x.bin and DM42-x.x.pgm files from the PC/Mac computer to root folder of
calculator disk.
4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can
take some time. Don’t unplug USB cable until safely ejected from OS.
5. Calculator detects presence of new firmware file and asks for update. You can confirm it
immediately or press EXIT key and activate flashing process later using "Flash firmware from
FAT" either from DM42 program "SETUP → System" or directly from DMCP System menu "Enter
System Menu"
6. Once finished the calculator resets and displays the DMCP System menu.
7. Choose "Load Program" and select appropriate DM42-x.x.pgm file, loading process should start
8. Once loaded the system should (after key-press) restart to DM42 program.
Program Loading/Update
Since version 3.7
Use this if you want to switch between programs or load new program to already loaded DMCP
system.
DMCP system can have one loaded program and only loaded program can be started. Programs
have .pgm extension and are expected to be stored in root folder of calculator disk.
Prerequisites
Program file with .pgm extension, e.g. DM42-3.10.pgm, SDKdemo-1.0.pgm, etc.
Steps
1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from
DMCP System menu.
17
Table of contents
Other SwissMicros Calculator manuals