background image

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

Summary of Contents for DM42

Page 1: ...DM42 User Manual v3 10 1 October 2018 Copyright 2016 2018 SwissMicros GmbH ...

Page 2: ... 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 ...

Page 3: ...sites 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 A...

Page 4: ...as 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 10...

Page 5: ...hes 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 rea...

Page 6: ... 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 resu...

Page 7: ...ain 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 t...

Page 8: ...iable 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...

Page 9: ...ggle 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 displa...

Page 10: ... 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 in...

Page 11: ... 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 i...

Page 12: ...d 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 item...

Page 13: ...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 ma...

Page 14: ...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 ...

Page 15: ...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 Separa...

Page 16: ...t 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 Sel...

Page 17: ...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 ...

Page 18: ... 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 m...

Page 19: ...mbined 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 Ma...

Page 20: ...r 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 syst...

Page 21: ...gram to get some real functionality Prerequisites DMCP_flash_x x bin DMCP system file e g DMCP_flash_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 bin file from the PC Mac computer to root folder of calculator disk 4 Eject safely remove the calculator di...

Page 22: ...ers in plugdev group by running as root cd etc udev rules d cat OI 49 stm32 dfuse rules This is udev rules file place in etc udev rules d Makes STM32 DfuSe device accessible to the plugdev group ACTION add SUBSYSTEM usb ATTRS idVendor 0483 ATTRS idProduct df11 MODE 664 GROUP plugdev OI udevadm control reload rules Alternatively you can use dfu util as root or prefix the commands with sudo e g sudo...

Page 23: ...e Program button to flash new firmware FW Update Using dfu util You can check user rights configuration for Linux first Switch the calculator to bootloader mode From menu or by RESET PGM buttons see Bootloader mode activation Connect the calculator to the PC You can list information about connected DFU device using dfu util l then start flashing using dfu util D DM42_flash bin a Internal Flash 0x0...

Page 24: ...e DFU version 011a Device returned transfer size 2048 DfuSe interface name Internal Flash Downloading to address 0x08000000 size 756288 Download 100 756288 bytes Download done File downloaded successfully real 1m55 929s user 0m0 044s sys 0m0 048s Example output of dfu util l dfu util l dfu util 0 9 Copyright 2005 2009 Weston Schmidt Harald Welte and OpenMoko Inc Copyright 2010 2016 Tormod Volden a...

Page 25: ...stall this file Obsolete Firware versions from 2 10 13 to 3 7 contain built in QSPI loader which is activated when QSPI data doesn t match The prefered option for QSPI update is to use QSPI Load menu to copy firmware to the calculator filesystem and flash the QSPI contents from the file User can also switch the calculator into bootloader mode and then use dfu util or dm_tool obsolete described bel...

Page 26: ...irmware DMflash bin Get DMflash bin from the URL http www swissmicros com tools DMflash bin Switch the calculator into bootloader mode From menu or by RESET PGM buttons see Bootloader mode activation Flash QSPI bootloader dfu util D DMflash bin a Internal Flash 0x08000000 512 0002Kg s 0x8000000 Press RESET button after dfu util finishes the flashing Flash QSPI contents dfu util D DM42_qspi_2 10 12...

Page 27: ...CP menu start you can use F1 RESET i e upper left key RESET button through the hole in calculator backplate 1 Program Info Displays information about program loaded into DMCP system 2 Run Program Starts currently loaded program 3 Load Program Displays selection dialog to choose among programs stored in FAT root directory Loads selected program to DMCP system 4 Load QSPI from FAT Starts flashing of...

Page 28: ...d 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 7 Enter System Menu Jumps to the main System menu 8 About Displays general information about DMCP system QSPI Load menu Obsolete valid for versions before 3 7 This menu is displayed only when the calculator detects in...

Page 29: ...omatically 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 4 Format FAT Disk Format the internal FAT disk storage All data is erased 5 FAT Dis...

Reviews: