Back to MiscEl main page | Write a message to author |

This page contains some hints and tricks for use with MiscEl

A few examples:

To enter the number 1500, all of the following are valid "1500", "1.5e3", "15e2", "1.5k", "1k5"

To enter the number 0.000033, all of the following are valid "0.000033", "33e-6", "33u", "33000n", "0.033m"

The most common letters used in electronic are:

- G = giga = 1000000000 = 1e9
- M = mega = 1000000 = 1e6 (Beware, upper case/lower case are very different values)
- k = kilo = 1000 = 1e3
- m = milli = 0.001 = 1e-3 (Beware, upper case/lower case are very different values)
- µ = micro = 0.000001 = 1e-6 (This is a bit tricky to type, but "u" can be used instead)
- n = nano = 0.000000001 = 1e-9
- p = pico = 0.000000000001 = 1e-12

Some examples:

- To enter the sqare root of 2 in a field, write "sqrt(2)"
- To enter 800 divided by 2pi, write "800/2/pi"
- To enter 2^8, write "power(2,8)"

In the Calculator write: "a" then right click and select "Create variable", now "a" must be assigned a value, this is also done in the calculator. Write "a:=6.567*3" and press ENTER.

"a" now has the value 19.701, this can be confirmed by selecting the "Variables" tab in the calculator or by writing "a" and pressing ENTER.

Now "a" can be used as a valid input value in nearly any input field in all the pages in MiscEl.

- Open the "Calculator" page
- Write "i"
- Right click and select "Create variable"
- Press the "Variable" button, your can now see the "i", but it has no value
- Write "i:=inch" and press enter, the value of "i" changes to 25.4m

Is is possible to use this kind of unit conversions with many other units (see the Const page in the calculator). Some of the possible values are:

- Open the "Calculator" page
- Write "imm"
- Right click and select "Create variable"
- Press the "Variable" button, your can now see the "imm", but it has no value
- Write "imm:=inch*1000" and press enter, the value of "imm" changes to 25.4

All windows can be pulled out, but only a few windows can be resized.

The example here is a complex setup, to try it do the following:

- Press the "New" button
- Select the "-- Undef --" entry
- Click in the field that says "none" and press the "F8" key*
- Select the "Function" "Script" option
- Copy the program listed below into the "Function of the hotkey" field
- Press the F8 key and enjoy

```
ShowProgramAt(PageWidth,0);
```

ShowPageAt("Fo",0,0);

Update;

PageSetValue("Fo","PageControl","Analyze");

PageSetValue("Fo","Impedance curve","1");

Update;

ShowPageAt("Curve plotter",0,PageHeight);

ShowPageFront("Calculator");

Now a press on the F8 key will open 3 windows and move two of them outside the MiscEl frame.

`ShowProgramAt(PageWidth,0);` | The MiscEl frame is moved to the right and top of the windows screen. PageWidth is the standard width of the MiscEl frame. |

`ShowPageAt("Fo",0,0);` | The "Fo" page is shown at the top left of the windows screen |

`Update;` | Give MiscEl and windows time to do the lines above |

`PageSetValue("Fo","PageControl","Analyze");` | On the "Fo" page select the "Analyze" page PageControl is the name used for all page selections in MiscEl Analyze is the text on the button to select |

`PageSetValue("Fo","Impedance curve","1");` | On the "Fo" page put a checkmark in the "Impedance curve" checkbox |

`Update;` | Give Miscel and windows time to update, i.e. show the "Curve plotter" page |

`ShowPageAt("Curve plotter",0,PageHeight);` | Place the "Curve Plotter" page just below the "Fo" page PageHeight is the standard heigth of the MiscEl frame |

`ShowPageFront("Calculator");` | We also wants a "Calculator" in the MiscEl frame, and it must be in front |

Before doing this examples, check the "Config" page, "Use standard signed bits" and "Use standard unsigned bits" must be checkmarked

A value in the range 0..1023 needs to be multiplied with pi (3.141592654...). To do this with integers we multiply with an integer and then divide with another integer.

Select the "Real to Mult/Div" kind and enter "pi" in the value field. The result shows some possible solutions: 22/7, 179/57, 355/113, 102928/32763, which one to use depends on our number range. We know that that the max. input value is 1023. Checking the "Max. input" result, we can see that for 22/7 and 15 bit, we can accept input numbers up to 1489, i.e. 1023 is inside the range and the calculations can be done with 15 bits (i.e. 16 bit with sign). The maximum error in the calculations will be 402ppm.

If we need better precision, we can use 31 bits (i.e. 32 with sign) with 102928/32763, this allows a maximum input of 20863, and the error will not be more than -1.06e-9

A value in the range 0..1023 needs to be multiplied with pi (3.141592654...). To do this with integers we multiply with an integer and the divide with another integer, this time we want to do it fast, i.e. we do not have time for a divide, but want a shift operation.

Select the "Real to Mult/Div with x/2^n" kind and enter "pi" in the value field. The result shows many possible solutions: 3/1, 13/4, 25/8, 101/32, 201/64, 3217/1024..., which one to use depends on our number range. We know that that the max. input value is 1023. Checking the "Max. input" result, we can see that for 25/8 (/8 is 3 shift right operations) and 15 bit, we can accept input numbers up to 1310, i.e. 1023 is inside the range and the calculations can be done with 15 bits (i.e. 16 bit with sign). The maximum error in the calculations will be -0.53 %.

If we need better precision, we can use 31 bits (i.e. 32 with sign) with 1647099/524288 (/524288 is 2^19, i.e. 19 shift right operations), this allows a maximum input of 1303, and the error will not be more than -0.2 ppm

See also MPU Support for more about where MiscEl can be usefull when working with microprocessors

On the CRC and checksum page select "Guess with checksum", enter the data in the data window and the crc (or checksum) for the data in the Checksum field. If the crc is one of the standard crc's, the specifications will be shown.

The kind "Guess" can be used if you known that the last bytes in the data is the crc.

See also MPU Support for more about where MiscEl can be usefull when working with microprocessors