A repository containing the programs that I use on my SwissMicros DM42n.
Find a file
2024-12-01 16:07:51 -05:00
raw Added BASE program 2024-12-01 15:52:05 -05:00
src Added BASE program 2024-12-01 15:52:05 -05:00
LICENSE Initial commit 2024-11-17 02:02:44 +00:00
README.md Updated README with the Variables section 2024-12-01 16:07:51 -05:00

dm42

A repository containing the programs that I use on my SwissMicros DM42n.

Catalog

BASE


This is Ton van de Burgt's Base program with stack save & restore.

CRCMCL


Computes the diameter of the circumcircle of an N-sided equilateral polygon of side length L. Quantity N must be an integer with a value of least 3.

LOGN


Computes the Y-base logarithm of X.

NTC


Program that computes NTC thermistor circuit properties. In the NTC program, all temperature values are in degrees Celsius.

CONF

Full name is NTCCONFG. Configure NTC thermistor properties for use in the NTC program. Press R/S in order to return to the top-level menu. The following properties can be set:

  • Thermistor beta factor
  • Thermistor resistance at the reference temperature
  • Thermistor reference temperature

SNGL

Full name is NTCSNGL. Calculate the temperature or resistance of a single thermistor. When calculating the thermistor temperature, the thermistor resistance must first be keyed in. When calculating the thermistor resistance, the thermistor temperature must first be keyed in.

DIVB

Full name is NTCDIVB. Calculate the temperature or output voltage of a voltage divider where the bottom resistor is an NTC thermistor. Calculating either parameter requires that the reference voltage ("VIN") and the top resistance be keyed in. Calculating the thermistor temperature requires that the divider output voltage also be keyed in. Calculating the divider output voltage requires that the thermistor temperature also be keyed in.

DIVT

Full name is NTCDIVT. Calculate the temperature or output voltage of a voltage divider where the top resistor is an NTC thermistor. Calculating either parameter requires that the reference voltage ("VIN") and the bottom resistance be keyed in. Calculating the thermistor temperature requires that the divider output voltage also be keyed in. Calculating the divider output voltage requires that the thermistor temperature also be keyed in.

PARR


Computes the equivalent impedance of X parallel Y using the product-over-sum method.

PWR


A program to convert between W and dBW.

DB2W

Converts X, a quantity in dB, to watts.

W2DB

Converts X, a quantity in watts, to dB.

PYTH


Solves the pythagorean theorem.

HYP

Solves for the length of the hypotenuse given the length of both legs.

LEG

Solves for the length of one leg of the triangle given the length of the hypotenuse and of the other leg.

QUAD


Calculates the roots of a quadratic equation of the for Ax^2 + Bx + C = 0.

Asks the user to input A, B, and C, and then successively displays the two roots. Variable A cannot be 0.

This program is largely based on HP's HP-42S Programming Examples and Techniques's Q2 program.

SVSTK


Contains subroutines pertaining to saving and recalling the stack.

SVSTK

Saves the current stack to four separate variables:

  • X -> BKPX
  • Y -> BKPY
  • Z -> BKPZ
  • T -> BKPT

It is important to note that this subroutine is not memory-safe. If a program calls this subroutine and then calls another subroutine which also calls SVSTK, there is no guaranty that the original stack saved will be correct.

RSTRYZT

Recalls the saved X, Y, Z, and T registers into the stack:

  • BKPX -> X
  • BKPY -> Y
  • BKPZ -> Z
  • BKPT -> T

RSTRYZT

Recalls the saved Y, Z, and T registers into the stack (X is untouched):

  • BKPY -> Y
  • BKPZ -> Z
  • BKPT -> T

RSTRZT

Recalls the saved Z and T registers into the stack (X and Y are untouched):

  • BKPZ -> Z
  • BKPT -> T

RTADZT

Restore and advance Z and T registers. Recalls the saved Z, and T registers into the stack and advances them down (X is untouched):

  • BKPZ -> Y
  • BKPT -> Z
  • BKPT -> T

VDIV


Calculates the unknown parameter in a ground-referenced voltage divider. All parameters may be complex numbers. The parameters are:

  • VIN: the voltage divider input
  • VOUT: the voltage divider output/tap
  • Z1: the top voltage divider impedance connected between VIN and VOUT
  • Z2: the bottom voltage divider impedance connected between VOUT and ground

In order to use the program, proceed with the following steps:

  1. XEQ "VDIV"
  2. Key in the value of the first known parameter
  3. Press the soft key associated with this parameter
  4. Key in the value of the second known parameter
  5. Press the soft key associated with this parameter
  6. Key in the value of the third known parameter
  7. Press the soft key associated with this parameter
  8. Press the soft key associated with the unknown parameter
  9. The calculated value of the unknown parameter is displayed and saved to the variable with the same name
  10. Press R/S to restore the stack and loop back to the begining of the program
  11. Press EXIT if you desire to exit the program, or go back to Step 2 in order to continue

Variables


The following is a list of variables used by the programs in this repository:

  • A: QUAD (rw)
  • B: QUAD (rw)
  • BETA: NTC (rw)
  • BKPX: SVSTK (rw), PARR (r)
  • BKPY: SVSTK (rw), PARR (r)
  • BKPZ: SVSTK (rw)
  • BKPT: SVSTK (rw)
  • C: QUAD (rw)
  • D: CIRCUMCIRCLE (rw)
  • HYP: PYTH (rw)
  • L: CIRCUMCIRCLE (rw)
  • LEG1: PYTH (rw)
  • LEG2: PYTH (rw)
  • N: CIRCUMCIRCLE (rw)
  • R: NTC (rw)
  • R1: QUAD (rw)
  • R2: QUAD (rw)
  • RBOT: NTC (rw)
  • RREF: NTC (rw)
  • RTOP: NTC (rw)
  • T: NTC (rw)
  • TREF: NTC (rw)
  • VIN: VDIV (rw)
  • VOUT: NTC (rw), VDIV (rw)
  • VREF: NTC (rw)
  • WORD: BASE (rw)
  • Z1: VDIV (rw)
  • Z2: VDIV (rw)