Cprog 08
Cprog 08
Cprog 08
Introduction
[?] Use the '?' character option to cause the commandline programmer
to wait and display the result of programming in the PROG
window. If the user does not use a batch file to test
errorlevel,
this provides a method to display the programming result.
This option should be the FIRST commandline option.
The configuration file contains two types of commands. The first type are
SETUP commands which configure the parameters which are used when attempting to
contact the target (Detailed in section 5). These SETUP commands include
choosing the proper COM port, delays, and target class to use when contacting
the target. All SETUP commands begin with a colon (:). The entire configuration
file is pre-processed prior to contacting the target in order to properly
process all SETUP commands. After this is complete, the CPROG08SZ software
processes the configuration file for programming commands (detailed in section
6). These commands are used to control erasure, programming, and verification
of target device programming. All programming commands consist of two upper
case letters possibly followed by parameters according to the particular
command.
4. Passing Security
SETUP commands are all processed before the programmer attempts to contact
the target. The whole configuration file is parsed for these commands prior to
attempting communications. This section gives an overview of using these
SETUP commands to do different type of configuration. The default base for
parameters is decimal with the exception of the :SECURITYCODE command. An
overview of the SETUP commands is as follows:
:BAUD n - Set the baud rate to n. This is for class 1-4 only. Class
5, 6, 7, and 8 use autobaud detection.
:POWERDOWNDELAY n - Amount of time to delay when the power to the target is
turned off for the targets power supply to drop to
below 0.1v. n is the time in milliseconds.
:POWERUPDELAY n - Amount of time to delay when the power to the target is
turned on OR the target is reset, and before the software
attempts to talk to the target. This time can be a
combination of power on time and reset time (especially
if a reset driver is used). n is the time in milliseconds.
:IRQ n - Class 5, 7, and 8 targets only.
Sets the value of the IRQ pin on reset. This pin can
either
be set to high voltage (n is 1) or to ground (n is 0).
:FORCEPASS - Specified that security should be passed on startup of the
software instead of waiting for an EM (Erase Module)
command. The :SECURITY code command must also be provided.
:SECURITYCODE hh hh hh hh hh hh hh hh
- Specifies the 8 bytes of security code to use at startup
which corresponds to the addresses $FFF6-$FFFD of the
target HC08 device. The parameter for this is a
string containing 8 bytes of data in HEX
separated by white spaces.
:DEVICETYPE str - For Class 5, 6, 7, and 8 only. Specifies the target device
family. As an example, the device type for a 68HC908KX8
would be KX. The allowed device type values are :
AB,AP,AS,AT,AZ,BD,EY,GP,GR16,GR4/8,GT,GZ,
JB16,JB1/8,JG,JK,JL,KX,LD,LJ,MR4/8,MR16/32,
QT,QY,RF,RK,SR
:DEVICECLOCK n - For Class 5, 6, 7, and 8. Controls whether the P&E
interface should drive a clock to the target or whether
the P&E interface should tristate it's clock output. Valid
values of n are:
0 : Clock driven by P&E Interface
1 : Target self-clocked, P&E Clock output disabled
:CLOCKDIVIDER n - For Class 5, 6, 7, and 8. Often one of the port pins of
the target processor controls the ratio of the BUS clock
to the External clock. Valid values of n are:
0 : Divide by 2 (usually and if applicable)
1 : Divide by 4 (usually and if applicable)
:DEVICEPOWER n - For Class 5, 6, 7, and 8. This setting incorporates both
the target voltage as well as whether the P&E interface
is generating/switching the power or whether the user
should be prompted to cycle the target power. Valid values
of n are:
0 : 5 Volts, Generated/Switched by P&E Interface
1 : 5 Volts, User Switched (when prompted)
2 : 3 Volts, Generated/Switched by P&E Interface
3 : 3 Volts, User Switched (when prompted)
4 : 2 Volts, Generated/Switched by P&E Interface
5 : 2 Volts, User Switched (when prompted)
:POWEROFFONEXIT n - Determines whether power to the target should be turned
off when the CPROG08SZ application terminates (class
5, 6, 7, and 8 only). Valid values of n are:
0 : Turn power off upon exit (default)
1 : Keep power on upon exit
6. Programming Commands
Commands all start with a two character sequence followed by white space
(blanks or tabs). Lines starting with characters which are not commands
are listed as REMarks. The values for starting, ending, byte, word, user_par
and base_address are given in hexadecimal. The term filename means a full
path to a file. Commands use the same two letter codes as used in the
interactive programmers PROG08SZ. The same .08P files used by PROG08SZ are
used to set up for a particular device to be programmed. If a user function
is specified for a particular device, it's two character command and the
meaning or user_par are specified in the .08P file.
Example User functions: - User functions are listed in the .08P file
7. Example Programming script file for P&E MON08 Cyclone -> 908SR12 target
The programming script file should be a pure ASCII file with one command per
line.
An example is:
:PORT 1
:TARGETCLASS 5 ; P&E MON08 Cyclone Interface
:POWERDOWNDELAY 500
:POWERUPDELAY 500
:DEVICETYPE SR ; SR Device. See manual for header.
:DEVICECLOCK 0 ; OSCout Clock driven by P&E Interface
:CLOCKDIVIDER 1 ; Bus is XTAL Divide by 4
:DEVICEPOWER 0 ; MCU voltage is 5 Volts, and is
; Generated/Switched by the MON08 Cyclone
CM C:\PEMICRO\PROG08SZ\908_SR12_highspeed.08P ; Choose Flash Algorithm
EM ; Erase Flash Module
BM ; Blank Check Flash Module
SS C:\PEMICRO\PROG08SZ\TESTSR12.S19 ; Specify S-record for program
PM ; Program Flash Module
VC ; Verify programmed data CRC-8
8. Example Programming script file for USB MON08 Multilink -> 908GP32 target
The programming script file should be a pure ASCII file with one command per
line.
An example is:
CM C:\PEMICRO\PROG08SZ\908_GP32_highspeed.08P
EM
BM
SS C:\PEMICRO\PROG08SZ\TESTGP32.S19
PM
VM
The programming script file should be a pure ASCII file with one command per
line.
An example is:
:PORT 1
:POWERDOWNDELAY 500
:POWERUPDELAY 500
:TARGETCLASS 1 ; Socket device in ICS
:BAUD 9600
CM C:\PEMICRO\PROG08SZ\908_GP32_highspeed.08P
EM
BM
SS C:\PEMICRO\PROG08SZ\TESTGP32.S19
PM
VM
Here is an example of calling the commandline programmer and testing it's error
code return in a simple batch file. Sample batch examples are given for both
Windows 95/98/XP and also Windows NT.
Windows NT/2000:
C:\PEMICRO\PROG08SZ\CPROG08SZ C:\PEMICRO\PROG08SZ\ENGINE.CFG
if errorlevel 1 goto bad
goto good
:bad
ECHO BAD BAD BAD BAD BAD BAD BAD BAD
:good
ECHO done
Windows 95/98/ME/XP:
Error returns are provided so they may be tested in .BAT files. The
error codes used are:
12. Information