(41C) Conversion sur HP 41C

12192021, 10:50 AM
(This post was last modified: 12302021 10:14 PM by C.Ret.)
Post: #2




RE: (41C) Conversion sur HP 41C (adding dBW)
Bonjour à tous,
At first glance the tittle in french intrigue my curiosity. I then realize that the reference article is written in french. I try the code on my HP41C. It is a bit long code and not so easy to use since units have to be key in without any misspelling. Secondly, it produce quite erroneous results; when we are successively converting a value through all the available units, we get back a really different value from the starting one. One detail that disturb me is that this code display the results with units mixing engineer notation and subunit indication. For exemple, a value of one volt is display " 1.00E+6 µV " and one picovolt " 1.00E3 µV " where I would have preferred " 1.00 V " and " 1.00 pV " respectively or at least (for a shorter and easier code) " 1.00E0 V " and " 1.00E9 V" respectively. I think it's more general for large range of data and easy to read enough since engineer notation only show multiple exponent of 3. That's the aim on engineer notation having full unit ( E0 ), multiple of unit such as mega or kilo (resp. E6 or E3), or submultiple of unit such as expected milli, micro or pico (resp. E3 , E6 or E9 ). One other detail that had disturbed me is that dB, which are dimensionless value are also expressed in engineer notation. This is useless, one may always display dB = x.xxxE0 since there is no unit. Display as xxx.xx dB is much more appropriate. A third problem is that, amplification relative to power is missing. So I rewrite this code to include all the features I was expecting in such a converter. First, conversion is easy to achieve, I use digit entry detection of the HP41C (flag 22) to detect no data entry and conversion order. The indication of units use direct USER Alpha label A through E. So the the user have to keyin a value (that set the Flag 22) and press one key of the first row to indicate the unit. To convert to any unit, the user may press directly the corresponding label without any digit entry. Easy multiple conversions to different units are possible. The impedance have to be entered in OHMS before any conversion in register R00 or using XEQ 00 or XEQ "IMP" to display the value. Label  Units ( display notation ) "IMP" 00  OHMS ( engineer) Impedance value have to be keyin in ohms: 50 [XEQ[00]] set Z = 50 Ohms and store value in register R00. "A"  WATT (engineer) Power entered in Watt; value store in register R01 "B"  dBW (fixe) Power amplification relative to one Watt : 1 [ A ] [ B ] display 0.00 dBW. Value store in register R02. "C"  dbm (fixe) dBm (decibelmilliwatts) is amplification relative to one milliwatt (mW): 1 [EEX] 3 [CHS] [ A ] [ C ] display 0.00 dBM . value store in R03 "D"  dbµV (fixe) electric field strength relative to 1 microvolt per meter. The unit is often used to specify the signal strength of a television broadcast at a receiving site (the signal measured at the antenna output is reported in dBμV): 1 [EEX] 6 [CHS] [ E ] [ D ] display 0.00 dBµV. value is store in register R04 "E"  VOLT (engineer) Electric potential in VOLT : 7.07 [ E ] set value to 7.07 V and display " 7.07E0 VOLT " . Value is store in register R05 Principe of operation: The unit of the entered value is remained by setting a flag (respectively Flag 01, 02, 03, 04 and 05 for each above unit). When pressing a unit labelkey without digit entry, conversion is achieve by retrospectively testing each flag and executing the corresponding conversion subroutines: LBL 01: convert from V (Volt) to power (Watt) ; W := V²/Z LBL 02: convert from power (W) to power amplification, dBW := 10*LOG(W) LBL 03: convert from dBW to dBm ; dBm := 30+dBW LBL 04: convert from dBm to dBµV ; dBµV := dBm+10*LOG(Z)+90 LBL 05: convert from dBµV to Volt ; V := 10^(dBµV/20) The code is one hundred of instructions: 01 LBL "IMP" SF 27 03 LBL 00 STO 00 CF 11 "OHM" GTO 11 // ENTER impedance Z (Ohm) press XEQ 00 08 LBL "A" FC?C 22 XEQ 01 STO 01 SF 01 CF 11 "WATT" GTO 11 // ENTER or CONVERT to mW ( x.xxxEee Watt ) press USER  A 16 LBL "B" FC?C 22 XEQ 02 STO 02 SF 02 SF 11 "W" GTO 11 // ENTER or CONVERT to dBW ( xxx.xx dBW ) press USER  B 24 LBL "C" FC?C 22 XEQ 03 STO 03 SF 03 SF 11 "m" GTO 11 // ENTER or CONVERT to dBm ( xxx.xx dBm ) press USER  C 32 LBL "D" FC?C 22 XEQ 04 STO 04 SF 04 SF 11 "µV" GTO 11 // ENTER or CONVERT to dBµ ( xxx.xx dBµV ) press USER  D 40 LBL "E" FC?C 22 XEQ 05 STO 05 SF 05 CF 11 "VOLT" // ENTER or CONVERT to µV ( x.xxxEee VOLT ) press USER  E 47 LBL 11 ASTO Y CLA ENG 3 FS? 11 FIX 2 ARCL X "~ " FS? 11 "~dB" 57 ARCL Y ENG 6 PROMPT RTN // Display ( x.xxxEee unit or xxx.xx dBunit ) 61 LBL 01 FC?C 05 XEQ 05 x^2 RCL 00 / RTN // Convert from V to W := V²/Z 68 LBL 02 FC?C 01 XEQ 01 LOG 10 * RTN // Convert from W to dBW := 10*LOG(W) 75 LBL 03 FC?C 02 XEQ 02 30 + RTN // Convert from dBW to dBm := 30+dBW 81 LBL 04 FC?C 03 XEQ 03 RCL 00 LOG 10 * + 90 + RTN // Convert from dBm to dBµV := dBm+10*LOG(Z)+90 92 LBL 05 FC?C 04 XEQ 04 20 / 6  10^X // Convert from dBµV to µV := 10^(dBµV/20) 100 END The µ and m symbols may be entered on halfnutt HP41C using a synthetic technique or simply being replaced by capital letters U and M on any other Hp41. Typical used:(edited) Code: 50 XEQ [ALPHA]IMP[ALPHA] "50.00E0 OHM " // Startup program and initiate impedance Sometime, numerous successive conversions may produced a few accumulated rounding errors. Fortunately, the display format in alpha register is masking rounding error (main of the time). Accuracy can be check by setting in FIX 9 display mode and observing the values in registers. Thanks to all of you. EDITED 30dec2021 22:36 UTC+1: see following messages 

« Next Oldest  Next Newest »

Messages In This Thread 
(41C) Conversion sur HP 41C  SlideRule  07022020, 11:51 AM
RE: (41C) Conversion sur HP 41C (adding dBW)  C.Ret  12192021 10:50 AM
RE: (41C) Conversion sur HP 41C  Dave Britten  12302021, 12:09 AM
RE: (41C) Conversion sur HP 41C  C.Ret  12302021, 09:29 PM
RE: (41C) Conversion sur HP 41C  Ángel Martin  12312021, 11:55 AM
RE: (41C) Conversion sur HP 41C  Dave Britten  12312021, 12:50 PM
RE: (41C) Conversion sur HP 41C  C.Ret  12312021, 07:22 PM
RE: (41C) Conversion sur HP 41C  Ángel Martin  01012022, 07:54 AM
RE: (41C) Conversion sur HP 41C  C.Ret  01012022, 04:03 PM

User(s) browsing this thread: 1 Guest(s)