Texas Instruments MSP-PRGS430 User manual

1
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
User's Guide
SLAU048I–August 2000–Revised October 2018
MSP430™ Microcontroller Serial Programming Adapter
This document describes how to use the MSP430™ Microcontroller Serial Programming Adapter
(MSP430-PRGS430). Instructions include how to install the software and hardware for the programmer
and how to use the programmer to read to and write from MSP MCUs.
Contents
1 Installation and Setup ....................................................................................................... 3
1.1 Installing the Software.............................................................................................. 3
1.2 Installing the Hardware............................................................................................. 3
2 Operation ..................................................................................................................... 5
2.1 Software and Hardware Layers of the PRGS430 Environment .............................................. 5
2.2 Programming MSP430 Devices With the GUI .................................................................. 6
2.3 Command Line Options .......................................................................................... 11
2.4 PRGS430.DLL Description....................................................................................... 14
3 Hardware.................................................................................................................... 26
3.1 Specifications ...................................................................................................... 26
3.2 Hints................................................................................................................. 26
3.3 Programming Adapter Target Connector Signals............................................................. 27
3.4 MSP-PRGS430 Circuit Diagrams............................................................................... 29
3.5 Location of Components on MSP-PRGS430.................................................................. 29
3.6 Interconnection of MSP-PRGS430 to OTP or EPROM-Based MSP430 Devices ........................ 30
3.7 Interconnection of MSP-PRGS430 to Flash-Based MSP430 Devices..................................... 31
4 Hex Object Format......................................................................................................... 32
4.1 Intel-Hex Object Format.......................................................................................... 32
4.2 TI-TXT File Format................................................................................................ 33
5 Schematics.................................................................................................................. 33
List of Figures
1 ADT430 Program Icons..................................................................................................... 3
2 Serial Programming Adapter............................................................................................... 4
3 Software and Hardware Layers............................................................................................ 5
4 MSP430 Programmer Dialog Box ......................................................................................... 6
5 Communication Error Box .................................................................................................. 9
6 Communication Error Box for Blown Fuse ............................................................................... 9
7 Erase Check Error Message ............................................................................................... 9
8 Data Error..................................................................................................................... 9
9 25-Pin Sub-D at Programming Adapter ................................................................................. 27
10 14-Pin Connector at End of Interconnect Cable ....................................................................... 27
11 MSP-PRGS430 Components............................................................................................. 29
12 MSP-PRGS430 Used to Program OTP or EPROM-Based MSP430 Devices..................................... 30
13 MSP-PRGS430 Used to Program Flash-Based MSP430 Devices.................................................. 31
14 Intel-Hex Object Format................................................................................................... 32
15 Schematics (1 of 2) ........................................................................................................ 34
16 Schematics (2 of 2) ........................................................................................................ 35

www.ti.com
2SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
List of Tables
1 MSP430 Function Buttons and Descriptions............................................................................. 7
2 Error Messages............................................................................................................. 10
3 Command Line Options ................................................................................................... 11
4 SetNotificationWnd Status Codes........................................................................................ 23
5 Return Values and Error Codes.......................................................................................... 25
6 MSP430 Hardware Specifications ....................................................................................... 26
7 Target Connector Signal Functions...................................................................................... 28
8 Programming Adapter Signal Levels .................................................................................... 28
Trademarks
MSP430 is a trademark of Texas Instruments.
All other trademarks are the property of their respective owners.

www.ti.com
Installation and Setup
3
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
1 Installation and Setup
This section describes how to install and program the hardware and software for the MSP430-PRGS430
programming adapter used with the MSP430 family of microcontrollers.
1.1 Installing the Software
To install the MSP-PRGS430 software, perform the following steps.
1. To ensure that you are using the latest version of the MSP-PRGS430 software, download the latest
software from http://www.ti.com/lit/zip/slac029 and extract the installation executable
(PRGS430_Rxxx.exe).
2. Run PRGS430_Rxxx.exe. A welcoming message is displayed.
3. Follow the setup instructions. The setup program guides you through the installation process.
4. During setup, the MSP430 program icons are installed in the selected folder. Click on the PRGS430
Read Me First icon (see Figure 1) for important information about the program device hardware and
software.
Figure 1. ADT430 Program Icons
5. To start the programming adapter software, click the PRGS430 icon in the selected program group
(default: ADT430).
1.2 Installing the Hardware
To install the programming adapter hardware, perform the following steps:
1. Using the 9-pin SUB-D connector, connect the programming adapter to the serial port (COM1 to
COM4) of the PC.
2. Connect an external power supply to the programming adapter. The voltage of the power supply must
be between 14 V and 20 V dc and must provide a minimum of 200 mA of power. The center terminal
of the supply connector at the programming adapter is the positive pole.
3. The red LED on the programming adapter illuminates if the power supply is properly connected. If the
LED does not illuminate and the power supply is properly connected, check the F1 fuse on the
programming adapter printed-wire board (PWB).
4. Connect the MSP430 MCUs, in a socket or on a PWB, to the programming adapter through the 14-pin
cable.
The programming adapter provides the selected supply voltage VCC at pin 14 of the 25-pin SUB-D
connector, or at pin 2 of the 14-pin connector to supply the MSP430 MCU. The signal name is
VCC_MSP.
If an external supply voltage VCC is used for the MSP430, the internal voltage VCC_MSP must be set
to the same voltage level.

www.ti.com
Operation
5
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2 Operation
This section describes the programming procedure for MSP430 MCUs and the error messages you may
encounter during the procedure.
2.1 Software and Hardware Layers of the PRGS430 Environment
Figure 3 shows the layers of the environment and the communication options.
Figure 3. Software and Hardware Layers
The options to handle and communicate with the PRGS430 hardware are:
• Using the graphical user interface (see Section 2.2)
• Using command line parameters (see Section 2.3)
• Using the PRGS430.dll (see Section 2.4). This is the fastest way if the PRGS430 is used in an in-
system program and test environment.

Operation
www.ti.com
6SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.2 Programming MSP430 Devices With the GUI
2.2.1 Basic Procedure
To program the MSP430 MCUs:
1. Click the Program Device icon during the installation-selected program group (default: ADT430). The
MSP430 programmer dialog box appears. The status line at the bottom of the window shows the
actual or the most recent activity (see Figure 4). The status line displays the message "Connecting to
adapter..." until the programming adapter is detected and the baud rate is set.
2. Select the correct device and supply voltage.
3. Select the name of the object file (TI-TXT (.txt) or Intel-hex (.a43) format).
4. Select the additional options to program, if necessary using Erase Flash, Erase Check, or Verify (see
Table 1).
5. Click the Program button to start programming. The status line at the bottom of the window shows the
actual or most recent activity (see Figure 4).
Figure 4. MSP430 Programmer Dialog Box

www.ti.com
Operation
7
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.2.2 Description of the MSP-PRGS430 GUI
To program an MSP430 MCU:
1. Select the file that contains the data to program from the MSP430 programmer dialog box (see
Figure 4).
2. Select the device. An error message appears on the screen if the device selected is different or not
connected.
3. Set the required supply voltage, communication port COMx, and baud rate. The device configuration
and memory type are selected automatically according to the selected device.
4. Click the Program button to start the programming operation.
Table 1 describes the function of the buttons for different options and combinations for the MSP430
programmer dialog box.
Table 1. MSP430 Function Buttons and Descriptions
Button Name Functions Description
File Name Selects the name of the file to program (Intel-hex or TI-TXT format)
Device Select Selects the MSP430 MCU type to program from a list
Supply Voltage VCC switch off Selects the supply voltage for the MSP430
If selected (default), the supply voltage is switched off after each MSP430 access;
otherwise, the supply voltage remains connected.
Program
An object code is programmed to the on-chip memory using the select options.
With Erase Flash Memory is erased before programming (only with flash devices). The following
options are possible:−Main and information memory−Main memory only
With Erase Check Erase check is performed before programming operation is executed.
With Verify Each section is verified after it is programmed, or an error message is displayed if
verification fails.
With Blow Fuse The code-protection fuse is blown after the entire object code, with verify, is
programmed. This action is irreversible and disables future on-chip memory access
(reading or programming). This step is not performed if verify is disabled or verify
fails. A warning is displayed.
Erase Flash
Erase operation can be done only with flash devices, according to the selected
option.
By file Only the memory locations corresponding to the selected object file are erased. All
other memory locations keep their old data (smart erase).
By device The entire flash memory of the device is erased.
By range An erase is performed depending on the values entered in the range fields.
Erase Check
Checks if memory locations are erased.
By file Checks only the memory locations used by the selected object file.
By device Checks the entire programmable memory of the device. (No RAM is checked.)
By range An erase check is performed according to the range of memory locations in the
range for Erase Check/Readout field.
Verify
Verify the data in the MSP430 MCU according to the selected option.
By file A verification of the memory locations vs the selected object file is performed. (By
file and by device are the same functions.)
By device
By range Verify memory locations defined in the range field vs the data in the selected file.
The defined range should not contain memory locations outside the data stored in
the selected file, otherwise an error is reported.
Blow Fuse The on-chip security fuse is irreversibly disabled and any access, such as reading
or programming of the MSP430, is impossible through JTAG. Access through
bootstrap loader interface is possible for devices that support that interface.

Operation
www.ti.com
8SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
Table 1. MSP430 Function Buttons and Descriptions (continued)
Button Name Functions Description
Read
Read data from MSP430 MCU. When this function is executed, a dialog box
appears; the file name for the data to store should be selected.
By device Read the entire memory of the device and store the data into the file selected in
the file name field.
By range Read the memory locations selected by the range field and store the data in the file
selected in the file name field.
Reset
The reset of a MSP430 can be performed in two ways. After reset, the MSP430
may remain under JTAG control or can be released to operate normally and
execute the program.
PUC A software reset of the chip is generated.
RST/NMI Generates a hardware reset by applying a low pulse on RST/NMI pin.
With JTAG release JTAG is released after the execution of the reset (through JTAG or RST/NMI).
COM Port Selects the COM port to which the programming adapter is connected
Baud Rate Selects the baud rate for communication with the programming adapter hardware
Help Help is available for programming MSP430 MCUs, command buttons, selectors,
and the object file format used. The Help menu can be found in the system menu
of the serial programming adapter software (right click on the symbol at the upper-
left corner of the program window) or with the F1 function key.
NOTE: For some MSP430 family members, for example, MSP430F2xxx devices, portions of flash
information memory are factory preprogrammed with calibration data. Depending on which
method is used for erasing the flash memory, this calibration data may be erased. Should the
calibration data be conserved, it must be read prior to the information memory erase or a
flash erase method that does not affect the calibration data memory locations must be used.
See the device-specific data sheet for further information on preprogrammed calibration data
memory locations.
If it should be saved, the following erase options must not be used as the Info memory will
be entirely erased:
• Program with Erase Flash (flash-erase options: Main and Info Memory)
or
• Erase Flash by Device
Instead, "Erase Flash by File" or "Erase Flash by Range" should be used.

www.ti.com
Operation
9
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.2.3 Error Messages
One of the following messages may show if JTAG communication is not established correctly:
• If the MSP430 MCU to program can not be found, the message shown in Figure 5 appears. This
problem can be caused by the PRGS430 not being connected to the hardware, the device not inserted
or incorrectly inserted into the socket, or the device not powered.
• The problem could be that the PRGS430 is not connected to the hardware, the device is not inserted
or is incorrectly inserted into the socket, or the device is not powered.
Figure 5. Communication Error Box
If the fuse is already blown, the error message shown in Figure 6 appears.
Figure 6. Communication Error Box for Blown Fuse
Additional message boxes appear for general error messages, such as erase check (see Figure 7).
Figure 7. Erase Check Error Message
When a read error is detected in the input file, such as a format error, the following message is displayed
(see Figure 8).
Figure 8. Data Error

Operation
www.ti.com
10 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
Table 2. Error Messages
Error Type Error Message
Communication Communication failed!
Communication Adapter not connected!
Communication Synchronization with adapter failed!
Communication The present adapter is not an MSP-PRGS430!
Communication Missing setting of VCC!
MSP430 Target not connected!
MSP430 Wrong JTAG version!
MSP430 PUC failed!
MSP430 Wrong target!
MSP430 Target fuse is blown!
MSP430 Blown fuse failed!
MSP430 Supply voltage to low!
MSP430 Fuse not released for this device!
Setting Unknown target!
Setting No target selected!
Setting Wrong VCC selected!
Setting Wrong baud rate!
Setting Communication port error!
Setting The selected range is invalid!
Setting Wrong argument!
Setting Error at target address (during erase check or verify)
Setting Unknown command line option
Setting Command line option out of valid range
System DEVICE.CFG corrupted
System General error!
System File type could not be detected!
System Unexpected end of file!
System PROJECT.INI corrupted!
System Filename mismatch
System Error in DEVICE.CFG
Windows Error during file I/O
2.2.4 Content of PRGS430.ini File
The last settings of the PRGS430 graphical user interface (GUI) are stored in the .ini file before exiting the
program. This information is stored under the Program Device System section.
Additionally, the following parameters are in the [Options] section and may be modified:
[Options]
\BlowFuse = 1 →The blow fuse button in the GUI is disabled to prevent accidental blow of the irreversible
fuse.
LastResult = 0 →If the program is called with command-line parameter, the error code that is returned to
the system when exiting the program is also stored here.

www.ti.com
Operation
11
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.2.5 Use of a [Project].ini File
Some default options could be changed within a [Project].ini file. This file has to be in the same directory
as the object code file. The following variables could be defined or redefined there.
The name of the file should have the same name as the object file with the extension .ini.
[ProgramDevice]
UserMemProtect = Start, Size
UserMemProtect2 = Start, Size
UserMemProtect3 = Start, Size
UserMemProtectn = Start, Size
DisableTIMemProtect = 0
Memory ranges defined in the UserMemProtect and UserMemProtect [n] option are read and
reprogrammed after erase (flash device only). [n] could be a number ≥2 and be in ascending order.
If a memory protection is activated in the device definition file from TI, it can be switched off with the
DisableTIMemProtect = 1 option.
2.3 Command Line Options
2.3.1 General Definitions
0: Off 1: First selectable option
1: On 2: Second selectable option
3: Third selectable option
The PRGS430.ini file options are used if they are not specified in the command line. The command line
option overwrites the .ini file options.
The program exits automatically if a command is passed in the command line and the command was
executed. There is only a small status window opened during the execution.
Only one command identifier (/cmd:) is allowed within the command line. Otherwise, the execution is
canceled and an error is returned.
If an error in the command line parameter is detected, the program exits with an error message.
The filename may also contain a path. If special characters are used, the string has to be inside quotes
(for example, \\server\adt430\PRG files\test.txt).
If an error is detected in the filename, the operation is canceled and an error is returned.
Table 3. Command Line Options
Command
/cmd:PRG Program command
/cmd:VFY Verify command
/cmd:ERS Erase command
/cmd:CHK Erase check command
/cmd:READ Read command
/cmd:RST Reset command
/cmd:BLOW Blow fuse command
Options
/COM:x Specifies the serial port: /COM:1, /COM:2, /COM:3, or /COM:4
/BR:xxxxxx Sets baud rate to be used: 9600/19200/38400/57600/115200, for example, /BR:57600
/Dev: Selects the device according to the name in the device.cfg file, for example, /Dev:MSP430F1121
/SVolt:x.x Selects supply voltage MSP_VCC of the programming adapter. The voltage is supplied between GND
and MSP VCC, for example, /Svolt: 3.0.

Operation
www.ti.com
12 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
Table 3. Command Line Options (continued)
/SVoff:{0,1} Switches off supply voltage MSP_VCC after execution
0: Disable (do not switch off)
1: Enable (switch off)
filename Specifies name of the object file to be programmed or verified
/FILE filename (Second way to define the filename −space separated)
Options for Program Command
/PE:{0,1,2} Option program with erase (flash only)
0: Without erase
1: Main and Info memory
2: Main memory only
/PC:{0,1} Option program with erase check
0: Disable
1: Enable
/PV:{0,1} Option program with verify
0: Disable
1: Enable
/PB:{0,1} Option program with blow fuse (only valid with verify successful)
0: Disable
1: Enable
Options for Erase, Erase Check, and Verify Command
/E:{1,2,..} Option for the erase, erasecheck, or verify by file/device/range
1: File
2: Device
3: Range
/ERange:0xXXX, 0xYYYY Option for the erase, erasecheck, or verify range (start: 0xXXXX, length: 0xYYYY)
Options for Read Command
/RO:{1,2} Option read by device or range
1: Device
2: Range
/RRange:0xXXXX,0xYYYY Option read range (start: 0xXXXX, length: 0xYYYY)
/Rfile:file- name,{1,2} Specifies read file name
1: TI-TXT
2: Intel-hex (default directory should be the last object file directory)
Log Options
/Log:filename Specifies log file name (default directory should be the PRGS430.exe directory)
/ALog:{0,1} Option accumulative Log file
0: Disable
1: Enable
Example
PRGS430.exe "C:\adt430\test\test.txt" /Dev:MSP430F1121 /cmd:PRG /PE:1 /PC:0
/PV:1 /COM:2
This command programs the file test.txt, located in the directory C:adt430\test, into a MSP430F149
device. The device is erased before programming. The erase check is disabled. The code is verified after
programming. The programming adapter is connected to ComPort 2. The baud rate is not passed with the
command line, so the setting in the PRGS430.ini file is used.

www.ti.com
Operation
13
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.3.2 Return Values and Error Codes in .ini File
The error code is returned to the PC operating system and also is stored in PRGS430.ini file in the
[Options] section:
LastResult=0
0 Ok
2 Communication failed!
3 Target not connected!
4 Adapter not connected!
5 Wrong JTAG version!
6 PUC failed!
7 Synchronization with adapter failed!
8 The present adapter is not an MSP-PRGS430!
9 Unknown target!
10 Wrong target!
11 No target selected!
12 Target fuse is blown!
13 Blow fuse failed!
14 Missing setting of VCC!
15 Wrong VCC selected!
16 Wrong baudrate!
17 Communication port error!
18 DEVICE.CFG corrupted!
19 General error!
20 The selected range is invalid!
21 Wrong argument!
22 Error during file I/O
23 File type could not be detected!
24 Unexpected end of file!
25 PROJECT.INI corrupted!
26 Vcc voltage too low for selected function!
27 Fuse not release for this device!
101 Error at target address (during erase check or verify)
102 Unknown command line option
103 Command line option out of valid range
104 Filename mismatch
105 Error in device.cfg

Operation
www.ti.com
14 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4 PRGS430.DLL Description
The PRGS430.dll is used to communicate with the MSP-PRGS430 hardware and the connected MSP430
MCU.
The initialization of the PRGS430 should be done with this sequence:
InitCom
SetDeviceType
SetVCC
. InitTarget
. ...
. ReleaseTarget
ReleaseCom
Several examples showing how the DLL could be used are located in the DLL_Usage_Examples folder of
the PRGS430 system. This dll can be used separately using the conventions in the following sections.
2.4.1 /FN0001/ InitCom
InitCom initializes (opens) the given communications port, establishes communication with the PRGS430
hardware, and sets the baud rate of the MSP-PRGS430. If successful, the MSP-PRGS430 is reset and
VCC is set to 0.0 V (the voltage should be set after the first user action to validate the correct value).
long int InitCom(char* lpszComPort, long int lBaudRate)
lBaudRate
Valid baud rates are: 9600, 19200, 38400, 56800, and 115200 baud. The default baud rate after
installation is 115200 baud.
lpszComPort
The name of the communication port—COM1, COM2, COM3, or COM4.
Example
lFuncReturn = InitCom("COM1" 115200)
2.4.2 /FN0002/ ReleaseCom
This new function is the counterpart to InitCom. It allows to close a communication with the MSP-
PRGS430 hardware. VCC is set to 0 and all outputs are set to the Hi-Z state.
long int ReleaseCom (void)
Example
lFuncReturn = ReleaseComm()
2.4.3 /FN0003/ SetDeviceType
Selects the device type.
lFuncReturn = SetDeviceType(char* lpszDeviceName)
lpszDeviceName
Name of the device in file device.cfg
Example
lFuncReturn = SetDeviceType("MSP430F1121")

www.ti.com
Operation
15
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.4 /FN0004/ InitTarget
Initializes the JTAG access to the target device, detects the device type, and reports when the detected
device does not match the parameter DeviceName passed.
long int InitTarget(char* lpszDeviceName)
lpszDeviceName
Name of the device in file device.cfg
Example
lFuncReturn = InitTarget ("MSP430F1121")
2.4.5 /FN0005/ ReleaseTarget
This function performs a PUC and releases the JTAG access to the target device. All JTAG signals from
the serial programming adapter are switched to Hi-Z. The device starts program execution if it is still
connected to VCC.
long int ReleaseTarget(void)
Example
lFuncReturn = ReleaseTarget()
2.4.6 /FN0006/ Erase
This function erases flash memory (if available). The protection of areas can be disabled by setting the
DISABLE_TI_MEM_PROTECT−Bit in Flags.
long int Erase(long int wStart, long int wLength, long int Flags)
wStart
Start address of the area to be erased. Allowed values are 0x0000 to 0xFFFE (see the memory map in
the device-specific data sheet for the supported memory size).
wLength
Length of the area. Allowed values are 0x0000 to 0xFFFE (see the memory map of the corresponding
device).
If erasing information and main memory segments, first erase the information memory segments, then
erase the main memory segments.
The mass erase sequence then would be:
Erase(InfoStart,InfoLength,0);
Erase(MainStart,MainLength,0);
The function invokes a mass erase for information or main memory if the start address and the complete
memory range of the information or main memory is specified. If the range specified is not complete for
that device, a segment erase of the individual segments is performed.
Flags
DISABLE_TI_MEM_PROTECT (0x01)
If this bit is set, the memory protection settings in device.cfg are ignored.
Example
lFuncReturn = Erase(long:0xF000, long:0x1000, long:1)
For some MSP430 family members (for example, MSP430F2xxx devices) portions of flash information
memory are factory preprogrammed with calibration data. Depending on which method is used for erasing
the flash memory, this calibration data may be erased. Should the calibration data be conserved, it must
be read prior to the information memory erase or a flash erase method that does not affect the calibration
data memory locations must be used. See the device-specific data sheet for further information on
preprogrammed calibration data memory locations.

Operation
www.ti.com
16 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.7 /FN0007/ EraseFile
Erases all addresses used in the specified file.
long int EraseFile(char* lpszFileName, long int iFileType, long int Flags,
char* lpszProjectIni)
iFileType
FILETYPE_AUTO (0x00): Autodetection of file type (Intel-hex or TI-TXT)
FILETYPE_TI_TXT (0x01): File type is TI-TXT
FILETYPE_INTEL_HEX (0x02): File type is Intel-hex
Flags
DISABLE_TI_MEM_PROTECT (0x01)
If this bit is set, the memory protection setting device.cfg is ignored. lpszProjectIni: name of the
{project}.ini file, if protection settings from this file shall be used. If there is no protection, replace
lpszProjectIni with NULL.
Example
lFuncReturn = EraseFile("text.txt", long:0, long:0, NULL)
For some MSP430 family members, for example MSP430F2xxx devices, portions of flash information
memory are factory preprogrammed with calibration data. Depending on which method is used for erasing
the flash memory, this calibration data may be erased. Should the calibration data be conserved, it must
be read prior to the information memory erase or a flash erase method that does not affect the calibration
data memory locations must be used. See the device-specific data sheet for further information on
preprogrammed calibration data memory locations.
2.4.8 /FN0008/ EraseCheck
Performs an erase check of an area of the target memory
long int EraseCheck(long int wStart, long int wLength)
wStart
Start address of the memory area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the
device-specific data sheet for the supported memory size).
wLength
Size of the area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the device-specific
data sheet for the supported memory size).
The function EraseCheck() simply uses PatternCheck(), with 0xFFFF as pattern.
EraseCheck(long int wStart, long int wLength)
{
return PatternCheck(wStart, wLength, 0xFFFF);
}
Example
lFuncReturn = EraseCheck(long:0xF000, long:0x1000)

www.ti.com
Operation
17
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.9 /FN0009/ EraseCheckFile
Checks if all memory addresses in the file are erased.
long int EraseCheckFile(char* lpszFileName, long int iFileType)
lpszFileName
Name of the file
iFileType
FILETYPE_AUTO (0x00): autodetection of file type (Intel-hex or TI-TXT) FILETYPE_TI_TXT (0x01):
file type is TI-TXT
FILETYPE_INTEL_HEX (0x02): file type is Intel-hex
The function returns success or the first address with mismatching data.
Example
lFuncReturn = EraseCheckFile("test.txt", long:0)
2.4.10 /FN00010/ PatternCheck
Checks a memory range with word pattern passed.
long int PatternCheck(long int wStart, long int wLength, long int wPattern)
wStart
Start address of the memory area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the
device-specific data sheet for the supported memory size).
wLength
Size of the area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the device-specific
data sheet for the supported memory size).
wPattern
Word pattern for check
The function returns success or the first address with mismatching data.
Example
lFuncReturn = PatternCheck(long:0xF000, long:0x1000, long:0xFFFF)
2.4.11 /FN00011/ VerifyData
This function verifies the content of the device with the data stored at passed pointer to data.
long int VerifyData(long int wStart, long int wLength, void* lpData)
wStart
Start address of memory area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the
device-specific data sheet for the supported memory size).
wLength
Length of the memory area to be checked. Allowed values are 0x0000 to 0xFFFE (see the memory
map in the device-specific data sheet for the supported memory size).
lpData
Pointer to buffer with data bytes in it
The function returns success or the first address with mismatching data.
Example
lFuncReturn = VerifyData(long:0xF000, long:0x1000, void* lpData)

Operation
www.ti.com
18 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.12 /FN00012/ VerifyFile
This function checks if the memory contents of the target device are equal to the file contents.
long int VerifyFile(char* lpszFileName, long int iFileType)
lpszFileName
Name of the file
iFileType
FILETYPE_AUTO (0x00): autodetection of file type (Intel-hex or TI-TXT)
FILETYPE_TI_TXT (0x01): file type is TI-TXT
FILETYPE_INTEL_HEX(0x02): file type is Intel-hex
The function returns success or the first address with mismatching data.
Example
lFuncReturn = VerifyFile("test.txt", long:0)
2.4.13 /FN00013/ VerifyFileRange
This function evaluates if the memory contents of the target device are equal to the file contents in a
passed range.
long int VerifyFileRange(char* lpszFileName, long int iFileType, long int
wStart, long int wLength)
lpszFileName
Name of the file
iFileType
FILETYPE_AUTO (0x00): autodetection of file type (Intel-hex or
TI-TXT) FILETYPE_TI_TXT (0x01): file type is TI-TXT
FILETYPE_INTEL_HEX (0x02): file type is Intel-hex
wStart
Start address of memory area. Allowed values are 0x0000 to 0xFFFE (see the memory map in the
device-specific data sheet for the supported memory size).
wLength
Length of the memory area to be checked. Allowed values are 0x0000 to 0xFFFE (see the memory
map in the device-specific data sheet for the supported memory size).
The function returns success or the first address with mismatching data.
Example
lFuncReturn = VerifyFileRange("test.txt", long:0, long:0xF000, long:0x1000)

www.ti.com
Operation
19
SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.14 /FN0014/ ProgramData
This function writes data into an MSP430 MCU. Protection of ranges of memory locations defined in the
DEVICE.CFG file can be disabled by setting the DISABLE_TI_MEM_PROTECT−Bit in Flags.
long int ProgramData(long int wStart, long int wLength, void* lpData)
wStart
Start address of the range that is to be erased. Allowed values are 0x0000 to 0xFFFE (see the memory
map in the device-specific data sheet for the supported memory size).
wLength
Length of the range. Allowed values are 0x0000 to 0xFFFE (see the memory map in the device-
specific data sheet for the supported memory size).
lpData
Pointer to the Data to be programmed
Flags
The bits in Flags control the operation of ProgramData().
Example
lFuncReturn = ProgramData(long:0xF000, long:0x1000, void* lpData)

Operation
www.ti.com
20 SLAU048I–August 2000–Revised October 2018
Submit Documentation Feedback
Copyright © 2000–2018, Texas Instruments Incorporated
MSP430™ Microcontroller Serial Programming Adapter
2.4.15 /FN0015/ ProgramFile
This function writes data from the file to the MSP430 MCU. The protection of ranges of memory locations
defined in the DEVICE.CFG file can be disabled by setting the DISABLE_TI_MEM_PROTECT−Bit in
Flags.
If the PGM_WITH_ERASE option are not selected the program data is preserved. This means that the
data is read from the flash and replaced with the new data. All other information is restored automatically.
The handling of the information memory works with the same mechanism.
For the fastest programming speed, select the PGM_WITH_ERASE and PGM_ERASE_INFO options.
long int ProgramFile(char* lpszFileName, long int iFileType, long int iFlags,
char* lpszProjectIni)
lpszFileName
Name of the file to be written into the target
iFileType
FILETYPE_AUTO (0x00): autodetection of file type (Intel-hex or
TI-TXT) FILETYPE_TI_TXT (0x01): file type is TI-TXT
FILETYPE_INTEL_HEX (0x02): file type is Intel-hex
iFlags
DISABLE_TI_MEMPROTECT (0x01)
PGM_WITH_ERASE (0x02) // Erases the main memory before programming
PGM_ERASE_INFO (0x04) // Erases the info memory before programming
PGM_WITH_ERASECHECK (0x08) // Erase check by device and the programs the device
PGM_WITH_Verify (0x10) // Read device, merge with file to be programmed, and write back to device
Use PGM_ERASE_INFO only together with the PGM_WITH_ERASE flag.
lpszProjectIni
Name of the {project}.ini file, if protection settings from this file are used. If no protection is required,
replace lpszProjectIni with NULL.
The added features do not need to be used. For example, to call ProgramFile according to older
specification, call:
ProgramFile(FileName, FileType, 0, NULL)
If no {project}.ini file or erase check is used, call:
lFuncReturn = ProgramFile(FileName, 0, 0, NULL); // with autodetect file type
If an erase or erase-check function reports an error, the function ProgramFile() is aborted before
programming is started.
Table of contents
Other Texas Instruments Adapter manuals

Texas Instruments
Texas Instruments TCM4300 Installation and user guide

Texas Instruments
Texas Instruments TI-GRAPH LINK Manual

Texas Instruments
Texas Instruments TI-Python Adapter User manual

Texas Instruments
Texas Instruments Serial Programming Adapter MSP430 User manual

Texas Instruments
Texas Instruments USB2ANY User manual

Texas Instruments
Texas Instruments SimpleLink CC3200 Wi-Fi User manual

Texas Instruments
Texas Instruments Adpater User manual

Texas Instruments
Texas Instruments Serial Programming Adapter MSP430 User manual