presto_en.pdf - 第68页
Page 68 Example of use var window:HW ND; begin window:= FindWindow( 'upv1.x', nil); Result:=Sen dMessage(wi ndow, WM_USER,0, 0); end. 1 Only pa rameter lParam=1 or lParam=2 are allowed for AVR …

Page 67
bit 3 = 1
boot memory (MSP430, CC430)
6
see
below
verification
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory
bit 3 = 1
boot memory (MSP430, CC430)
7
see
below
erasing, same return code as from the
command line
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 3 = 1
boot memory (MSP430, CC430)
8
see
below
BlankCheck of memory, same return code as
from the command line
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory
bit 3 = 1
boot memory (MSP430, CC430)
15
any
presses the GO button, returns 1
16
see
below
asks if the programmer supports the function
0
MCLRControl_Run
1
MCLRControl_Stop
2
MCLRControl_Reset
8
current voltage at pin VDD
17
see
below
performs the programmer function
0
MCLRControl_Run
1
MCLRControl_Stop
2
MCLRControl_Reset
8
current voltage at pin VDD
return value PRESTO:
0 – unknown level
1 – 0 V
2 – approx. 2 V
3 – approx. 5V
4 – more than 6V
return value FORTE:
-1 - measuring error
xx - measured voltage × 10
example: 33 means 3.3V
24
address
reads data from address, returns error code,
data are returned with wParam = 25
25
any
returns last data read with wParam of 24
32
see
below
UP program initialization
bit 0 = 1
reload settings (reload project/ini file or
registry)
bit 1 = 1
reload language file
bit 2 = 1
recreate programmer (like programmer was
changed)
bit 3 = 1
reload programmer settings (like port
settings)
bit 4 = 1
reload selected device
bit 5 = 1
reload current file (.hex, .bin, ...)
bit 6 = 1
recreate all dialog windows (adjust their size
when reloading device)
0x 0100
refresh device specific windows
0x 0200
refresh all editors
0x 0300
refresh project captions
33
1
save all project settings
48
see
below
1
saves current file (same as Ctrl+S), returns 0
when there was no error else returns a
nonzero value
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory
bit 3 = 1
boot memory (MSP430, CC430)
56
0
returns the handle of the UP main form
Table9: Commands WM_USER
A message of the WM_CLOSE type closes the UP
program.

Page 68
Example of use
var
window:HWND;
begin
window:=FindWindow('upv1.x',nil);
Result:=SendMessage(window,
WM_USER,0,0);
end.
1
Only parameter lParam=1 or lParam=2 are allowed for
AVR microcontrollers.
5.8
UP_DLL.DLL Library
Thanks to this library strings can be exchanged with the
UP program.
As the library needs to communicate with UP, the
program must be running. UP_DLL cannot work on its
own.
unitup_dll;
interface
FunctionUP_LoadFile(FileName:PChar;style:in
teger):integer;stdcall;
(*
*LoadFile(withextension.hexor.ppr);
*Loadingof.pprfilecanresultinloading.he
xfiletoo;
*Resultcodesaresamelikeoncommand
*line.
*
*Style|
=1;UPwillbequietonfileloaderrors
*Style|
=2;UPwilldonopreviousfilesaving
*
*)
FunctionUP_GetStrValue(ValueName:PChar;Value:
PChar;Size:integer):integer;stdcall;
FunctionUP_GetIntValue(ValueName:PChar;varVa
lue:integer):LongBool;stdcall;
FunctionUP_SetStrValue(ValueName:PChar;Value:
PChar):LongBool;stdcall;
FunctionUP_SetIntValue(ValueName:PChar;Value:
integer):LongBool;stdcall;
FunctionUP_LoadFile_Wnd(WndClass:PChar;FileNam
e:PChar;style:integer):integer;stdcall;
FunctionUP_SetStrValue_Wnd(WndClass:PChar;Valu

Page 69
eName:PChar;Value:PChar):BOOL;stdcall;
FunctionUP_SetIntValue_Wnd(WndClass:PChar;Valu
eName:PChar;Value:integer):BOOL;stdcall;
FunctionUP_GetStrValue_Wnd(WndClass:PChar;Valu
eName:PChar;Value:PChar;Size:integer):inte
ger;stdcall;
FunctionUP_GetIntValue_Wnd(WndClass:PChar;Valu
eName:PChar;varValue:integer):LongBool;std
call;
(*
*Allthesefunctionsareusedforchanging
*internalsettingsofUPinruntime.
*UP_GetIntValue,UP_SetStrValue,
*UP_SetIntValuereturnsnonzeroif
*successful
*UP_GetStrValuereturnsamountof
*characterstocopyintoValuestring
*includingnullterminator
*IfSizeislessthanrequiedsize,no
*charactersarecopied.
*)
FunctionUP_GetChecksum(Recalculate:integer;Ch
ecksum:PChar;Size:integer):BOOL;stdcall;
FunctionUP_GetChecksum_Wnd(WndClass:PChar;Reca
lculate:integer;Checksum:PChar;Size:integer
):BOOL;stdcall;
(*
*Thesefunctionsreturnchecksumvaluefromthe
UP,where:
*Recalculate=0;onlyreturnsthechecksum
*Recalculate=1;checksumwillberecalculated
first
*Checksum;thereturnedchecksumasstring
*Size;thelengthoftheChecksumarray,theca
llerhavetofill
*WndClass;theUPwindowclassname
*)
implementation
functionUP_LoadFile;external'up_dll.dll';
functionUP_GetStrValue;external'up_dll.dll';
functionUP_GetIntValue;external'up_dll.dll';
functionUP_SetStrValue;external'up_dll.dll';
functionUP_SetIntValue;external'up_dll.dll';
functionUP_LoadFile_Wnd;external'up_dll.dll';
functionUP_SetStrValue_Wnd;external'up_dll.dl
l';
functionUP_SetIntValue_Wnd;external'up_dll.dl
l';
functionUP_GetStrValue_Wnd;external'up_dll.dl
l';
functionUP_GetIntValue_Wnd;external'up_dll.dl
l';
functionUP_GetChecksum;external'up_dll.dll';
functionUP_GetChecksum_Wnd;external'up_dll.dl
l';
end.
For further information see Appendix A UP_DLL.DLL.
5.9
Running More Than
One Instance of UP
If you need to connect more than one programmer to one
computer, a separate instance of UP must be running for
each programmer connected.
UP should be running in just one instance for standard
use. Each additional instance just sends commands from