SiUtilEx

FYI: If you use SiUtilEx, it happens at your own risk. I don't give any warranties for nothing!

Hint: If you like using SiUtilEx in conjunction with the USB Debug Adapter, you should add the path to USBHID.dll to %PATH% (Control Panel -> System -> Environment Variables). You find USBHID.dll in <SiLabsDir>\MCU\IDEFiles.

SiUtilEx is a small COM object that wraps up the functions found in SiUtil.dll (version 2.70 or later required). Before you can use SiUtilEx, you have to register the COMponent. Do this from the command line. Switch to the Bin-Folder and type in the following:

regsvr32.exe siutilex.dll

Please note, that the original SiUtil.dll has to be in the same directory as SiUtilEx.dll. If it is not, even the registration process will fail. And in order to get most out of the help, it is recommended keeping the help file within this folder, too.

However, some changes are made in respect of the original functions. Since I assume the parameters 'nComPort' and 'nDisableDialogBoxes' aren't changed that often, these are added as properties to the COMponent and are therefore left out in the method calls.

The second change applies to the SetXXXMemory/ GetXXXMemory functions. You don't pass/ get a raw pointer to/ from the methods. Instead, Byte-Arrays are used. If you want to set memory, the COMponent writes the entire array to the address specified in 'wStartAddress', hence no length parameter is needed.

You can also use this COMponent from within WSH (VBS (ProgID: "SiUtilEx.SiUtilEx"), for example), but there are limitations. Since all variables in scripts are VARIANTs you cannot use the memory methods, because they work with Byte arrays instead of VARIANT arrays. Because it does not make sense to use VARIANT arrays (IMO), you simply cannot use these methods in scripts. There shouldn't be problems with all other methods.

In order to use SiUtilEx from within Visual Basic 6, add a reference to your project. See: Creating a Reference to an Object

To work with the object itself is very, very simple. For example:


Dim oSiUtilEx As SiUtilExLib.SiUtilEx
Set oSiUtilEx = new SiUtilExLib.SiUtilEx
MsgBox oSiUtilEx.Version

' Default values are taken for the parameters left out.
' Refer to the appnote mentioned above, in order to get
' information about the defaults.
oSiUtilEx.Connect C2
oSiUtil.Download "C:\Test.hex", True

oSiUtilEx.Disconnect
Set oSiUtilEx = Nothing

If you like to recompile the source files, make sure to ad the Include-Folder in the options of your IDE!

If there are any questions left or if you have any suggestions or any other comments or if you simply want to give some feedback, feel free to send me a mail:
mailto:renkoe@tbkoenig.de


SiUtilEx reference