-[[.:start]]
====== DM41X Progs ======
===== DM41x RAW =====
|HP Maths Benchmark |{{ :public:calculator:progs:bm.raw |}}|
|HP Trig Benchmark |{{ :public:calculator:progs:bmt.raw |}}|
|8-Queens Benchmark |{{ :public:calculator:progs:nqu.raw |}}|
|Savage Benchmark |{{ :public:calculator:progs:svg.raw |}}|
|Memo - as below - uses ascii file name "SITES" instead of "MEMO" | {{ :public:calculator:progs:memo.raw |}}|
|TR - from HP41cx User guide vol. 2| {{ :public:calculator:progs:tr.raw |}} |
|Sigma - from HP41cx User guide vol.2| {{ :public:calculator:progs:sigma.raw |}}|
===== Using Solve and Integrate together =====
* from HP343C handbook
* DM41X version uses ''SOLVE'' and ''INTEG'' from [[..:guides:advantage_pac| Advantage Pac]]
- Create a ''MYSOLVE'' wrapper that handles putting the correct ''SOLVE'' program name in ''ALPHA'' etc
- Create the program that is to be solved and which has as it's function an integral
- Create the program that defines the integral
=== MYSOLVE ===
LBL ¬MYSOLVE
¬MOD // the label of the program to be solved is put in ALPHA
SOLVE // we XEQ SOLVE (the Advantage Pac solver)
RTN
=== Solve : MOD ===
The program to be solved
LBL ¬MOD
¬BESSEL // We put the name of the program with the integral in ALPHA
STO 00 // We store our current guess for X in R 00 to be accessible by the integral finction
0 // put upper and lower limits for the integration in Y and X
PI
INTEG // xeq INTEG from Advantage Pac
ABS // our current guess, make it positive
X<=Y? // Y has the Integration's estimate of accuracy - we use this to limit our search
ClX // if our guess has returned a value from the integral that's less than the inherent accuracy then that's GOOD ENOUGH, we set X to zero and SOLVE completes
X≠0? // if we still don't have zero we put back the last guess and SOLVE continues
LastX
RTN
=== Integral : BESSEL ===
LBL ¬BESSEL
SIN
RCL 00
*
COS
PI
/
RTN
=== Running it ===
* ''MYSOLVE'' sets up the ''ALPHA'' register with the name of the prog to be solved, so nothing needed in ''ALPHA'' at this time
* put initial guesses in ''X'' and ''Y''
* '1' ENTER '2'
* try ''FIX 4''
* Run ''MYSOLVE'' - via XEQ or set up a ''CST'' menu item for it
After a few minutes of Goose-flying we get the answer ''2.4048''
===== Useful Memo prog =====
{{ :public:calculator:progs:03319.pdf | MEMO }}
By Gary Goodman from HP document collection. Dated 24/3/85
===== 65c22 Timer values =====
** for VIA Tone generator **
** Needs [[..:guides:dm41x_ladybug_module|Ladybug]] module **
The required count is calculated from ''Φ2'' and the audio frequency required.
Count (decimal)
{ Φ2 / ( 2 x F ) } - 2
for 1000Hz and a 1MHz Φ2 :
Count = { 1,000,000 / ( 2 X 1000 ) } - 2 = 498
498d -> $01F2
Run as XEQALPHA''TI''ALPHA
Prompt ''F'' for required audio tone frequency.
Enter freq
R/S
Result is the 2-byte value for T1CL & T1CH
e.g.
XEQALPHA''TI''ALPHA
1000
R/S
Result:
$001F2
The Counter should be set to
T1CH = $01
T1CL = $F2
Entered as follows (make sure you're in DECS mode in Ladybug while entering the program - otherwise the ''1000000'' won't be interpreted correctly). When viewing/editing the program later it will look different!
LBL ¬TI
DECS
WSIZE 20
¬ F
PROMPT
STI 01
1000000
ENTERI
LDI 01
2
x
/
2
-
HEXS
RTN
===== BFil =====
++++ Butterworth HPF/LPF Filter designer |
LBL ¬BFIL
SF 00
¬MHZ ?
PROMPT
1 E6
*
STO 11
¬N
PROMPT
x<0?
CF 00
STO 10
XEQ 06
LBL 01
RCL 12
INT
XEQ 00
FS? 00
1/x
STO IND 12
ISG 12
GTO 01
¬COEFFICIENTS
FIX 3
STOP
ENG 3
XEQ 06
LBL 02
RCL 12
INT
RCL IND 12
RCL 11
2
*
PI
*
/
STO IND 12
ISG 12
GTO 02
XEQ 06
LBL 03
RCL 12
INT
2
/
FRC
FS? 00
GTO 09
GTO 10
LBL 09
¬HPF
x=0?
GTO 05
GTO 04
RTN
LBL 10
¬LPF
x=0?
GTO 04
GTO 05
RTN
LBL 04
RCL IND 12
50
*
STO IND 12
ISG 12
GTO 03
RTN
LBL 05
RCL IND 12
50
/
STO IND 12
ISG 12
GTO 03
RTN
LBL 06
RCL 10
ABS
1000
/
1
+
STO 12
RTN
LBL 00
2
*
1
-
180
*
RCL 10
ABS
2
*
/
SIN
2
*
RTN
END
++++
==== Examples ====
=== 5MHz 5-pole LPF ===
XEQALPHABFILALPHA
MHZ ?
5 R/S
N
''Order/poles = N''
''Positive for HPF''
''Negative for LPF''
''5 pole LPF = -5''
5CHSR/S
COEFFICIENTS
0.618
(at this point you can RCL 01 etc. up to RCL 05 to see the calculated Butterworth Coefficients)
* R01 : 0.618
* R02 : 1.618
* R03 : 2.000
* R04 : 1.618
* R05 : 0.618
R/S
LPF
393.5 -12
The calculated component values are now in Reg 01 - Reg 05
* R01 : 393.5pf
* R02 : 2.575uH
* R03 : 1.273nF
* R04 : 2.575uH
* R05 : 393.5pF
=== 1MHz 7 pole HPF ===
XEQALPHABFILALPHA
MHZ ?
1 R/S
N
''Order/poles = N''
''Positive for HPF''
''Negative for LPF''
''7 pole HPF = 7''
7R/S
COEFFICIENTS
2.247
(at this point you can RCL 01 etc. up to RCL 07 to see the calculated Butterworth Coefficients)
* R01 : 2.247
* R02 : 0.802
* R03 : 0.555
* R04 : 0.500
* R05 : 0.555
* R06 : 0.802
* R07 : 2.247
R/S
HPF
17.88 -06
The calculated component values are now in Reg 01 - Reg 07
* R01 : 17.88uH
* R02 : 2.553nF
* R03 : 4.416uH
* R04 : 1.592nF
* R05 : 4.416uH
* R06 : 2.553nF
* R07 : 17.88uH
===== Page Info =====
Page created Thu May 26 18:35:00 2022 by John Pumford-Green
Page last updated: ~~LASTMOD~~
--- //John Pumford-Green 24/04/23 16:07//
===== Further Information =====
{{tag>calculator dm41x}}