John's Vademecum

Try to learn something about everything, and everything about something -Thomas Huxley “Darwin's bulldog” (1824-1895)

User Tools

Site Tools


public:calculator:dm41_progs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:calculator:dm41_progs [24/09/22 08:52 BST] – [TI : calculate 65c22 Timer values for tone generation] johnpublic:calculator:dm41_progs [24/04/23 17:07 BST] (current) – removed john
Line 1: Line 1:
-<-[[.:start]] 
- 
- 
-====== DM41X Progs ====== 
- 
-===== TI : calculate 65c22 Timer values for tone generation ===== 
- 
-Run as <key>XEQ</key><key>ALPHA</key>''TI''<key>ALPHA</key> 
- 
-Prompt ''F'' for required audio tone frequency. 
- 
-Enter freq  
- 
-<key>R/S</key>  
- 
-Result is the 2-byte value for T1CL & T1CH 
- 
-e.g. 
- 
-<key>XEQ</key><key>ALPHA</key>''TI''<key>ALPHA</key> 
- 
-  1000  
- 
-<key>R/S</key>  
- 
-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!  
- 
-<code> 
-LBL ¬TI 
-DECS 
-WSIZE 20 
-¬ F 
-PROMPT 
-STI 01 
-1000000 
-ENTERI 
-LDI 01 
-2 
-x 
-/ 
-2 
-- 
-HEXS 
-RTN 
-</code> 
-===== BFil ===== 
- 
-++++ Butterworth HPF/LPF Filter designer | 
- 
-<code> 
-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 
-</code> 
- 
- 
-++++ 
- 
-==== Examples ==== 
- 
-=== 5MHz 5-pole LPF === 
- 
-<key>XEQ</key><key>ALPHA</key><key>BFIL</key><key>ALPHA</key> 
- 
-  MHZ ?  
- 
-<key>5</key> <key>R/S</key> 
- 
-  N 
- 
-''Order/poles = N'' 
- 
-''Positive for HPF'' 
- 
-''Negative for LPF'' 
- 
-''5 pole LPF = -5''  
- 
-<key>5</key><key>CHS</key><key>R/S</key> 
- 
-  COEFFICIENTS 
-  0.618 
- 
-(at this point you can <key>RCL 01</key> etc. up to <key>RCL 05</key> to see the calculated Butterworth Coefficients) 
- 
-  * R01 : 0.618 
-  * R02 : 1.618 
-  * R03 : 2.000 
-  * R04 : 1.618 
-  * R05 : 0.618 
- 
- 
-<key>R/S</key> 
- 
-  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 === 
- 
- 
-<key>XEQ</key><key>ALPHA</key><key>BFIL</key><key>ALPHA</key> 
- 
-  MHZ ?  
- 
-<key>1</key> <key>R/S</key> 
- 
-  N 
- 
-''Order/poles = N'' 
- 
-''Positive for HPF'' 
- 
-''Negative for LPF'' 
- 
-''7 pole HPF = 7''  
- 
-<key>7</key><key>R/S</key> 
- 
-  COEFFICIENTS 
-  2.247 
- 
-(at this point you can <key>RCL 01</key> etc. up to <key>RCL 07</key> 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 
- 
- 
-<key>R/S</key> 
- 
-  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~~ 
- 
-{{tag>dm41x calculator}} 
- 
  
public/calculator/dm41_progs.1664005963.txt.gz · Last modified: 06/03/25 06:49 GMT (external edit)