MATLAB Link for Code Composer Studio Development Tools    
regwrite

Write data values to specified registers on a target processor

Syntax

Description

regwrite(cc,'regname',value,'represent',timeout) writes the data in value to the regname register of the target processor. regwrite converts value from its representation in the MATLAB workspace to the representation specified by represent. The represent input argument defines the format of the data when it is stored in regname. Input argument represent takes one of three input strings:

represent string
Description
2scomp
Write value to the destination register as a signed integer value in two's complement format. This is the default setting when you omit the represent argument.
binary
Write value to the destination register as an unsigned binary integer.
ieee
Write value to the destination registers as a floating point 32-bit or 64-bit value in IEEE floating-point format. Use this only when you are writing to 32- and 64-bit registers on the target.

String regname specifies the name of the destination register on the target. Link cc defines the target to write value to. Valid entries for regname depend on your target processor. Register names are not case-sensitive -- a0 is the same as A0. For example, the TMS320C6xxx processor family provides the following register names that are valid entries for regname:

Register Names
Register Contents
A0, A1, A2,..., A15
General purpose A registers
B0, B1, B2,..., B15
General purpose B registers
PC, ISTP, IFR, IRP, NRP, AMR, CSR
Other general purpose 32-bit registers
A1:A0, A2:A1,..., B15:B14
64-bit general purpose register pairs

Other processors provide other register sets. Refer to the documentation for your target processor to determine the registers for the processor.

To limit the time that regwrite spends transferring data to the target processor, the optional argument timeout tells the data transfer process to stop after timeout seconds. timeout is defined as the number of seconds allowed to complete the write operation. You might find this useful for limiting prolonged data transfer operations. If you omit the timeout option in the syntax, regwrite defaults to the global timeout defined in cc. If the write operation exceeds the time specified, regwrite returns with a timeout error. Generally, timeout errors do not stop the register write process. They stop while waiting for CCS IDE to respond that the write operation is complete.

regwrite(cc,'regname',value,'represent') writes the data in value to register regname of the target processor. regwrite converts value from its representation in the MATLAB workspace to the representation specified by represent. The represent input argument defines the data format when it is stored in regname. Input argument represent takes one of three input strings:

represent string
Description
2scomp
Write value to the destination register as a signed integer value in two's complement format. This is the default setting when you omit the represent argument.
binary
Write value to the destination register as an unsigned binary integer.
ieee
Write value to the destination registers as a floating point 32-bit or 64-bit value in IEEE floating-point format. Use this only when you are writing to 32- and 64-bit registers on the target.

String regname specifies the name of the destination register on the target. Link cc defines the target to write value to. Valid entries for regname depend on your target processor. Register names are not case-sensitive -- a0 is the same as A0. For example, the TMS320C6xxx processor family provides the following register names that are valid entries for regname:

Register Names
Register Contents
A0, A1, A2,..., A15
General purpose A registers
B0, B1, B2,..., B15
General purpose B registers
PC, ISTP, IFR, IRP, NRP, AMR, CSR
Other general purpose 32-bit registers
A1:A0, A2:A1,..., B15:B14
64-bit general purpose register pairs

Other processors provide other register sets. Refer to the documentation for your target processor to determine the registers for the processor.

regwrite(cc,'regname',value,) writes the data in value to the regname register of the target processor. regwrite converts value from its representation in the MATLAB workspace to the representation specified by represent. The represent input argument defines the format of the data when it is stored in regname. Input argument represent takes one of three input strings:

represent string
Description
2scomp
Write value to the destination register as a signed integer value in two's complement format. This is the default setting when you omit the represent argument.
binary
Write value to the destination register as an unsigned binary integer.
ieee
Write value to the destination registers as a floating point 32-bit or 64-bit value in IEEE floating-point format. Use this only when you are writing to 32- and 64-bit registers on the target.

String regname specifies the name of the destination register on the target. Link cc defines the target to write value to. Valid entries for regname depend on your target processor. Register names are not case-sensitive -- a0 is the same as A0. For example, the TMS320C6xxx processor family provides the following register names that are valid entries for regname:

Register Names
Register Contents
A0, A1, A2,..., A15
General purpose A registers
B0, B1, B2,..., B15
General purpose B registers
PC, ISTP, IFR, IRP, NRP, AMR, CSR
Other general purpose 32-bit registers
A1:A0, A2:A1,..., B15:B14
64-bit general purpose register pairs

Other processors provide other register sets. Refer to the documentation for your target processor to determine the registers for the processor.

When you omit the represent argument, regwrite takes value from the function and writes it to the designated register as a two's complement value signed integer.

Examples

To write a new value to the PC register on a C5xxx family processor, type

specifying that you are writing the value 256 (the decimal value of 0x100) to register pc as binary data.

To write a 64-bit value to a register pair, such as B1:B0, the following syntax specifies the value as a string, representation, and target registers.

Registers B1:B0 now contain the value 4112 in double-precision format.

See Also

read, regread, write


  regread reload