MATLAB Link for Code Composer Studio Development Tools | ![]() ![]() |
Write data values to specified registers on a target processor
Syntax
regwrite(cc,'regname',value,'represent',timeout) regwrite(cc,'regname',value,'represent') regwrite(cc,'regname',value,)
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:
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
:
Other processors provide other register sets. Refer to the documentation for your target processor to determine the registers for the processor.
Note
Use write (called a direct memory write) to write memory-mapped registers. For the TMS320C5xxx processor family, register PC is memory mapped and thus available using write , not regwrite . Use regwrite to write to all other registers.
|
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:
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
:
Other processors provide other register sets. Refer to the documentation for your target processor to determine the registers for the processor.
Note
Use write (called a direct memory write) to write memory-mapped registers. For the TMS320C5xxx processor family, register PC is memory mapped and thus available using write , not regwrite . Use regwrite to write to all other registers.
|
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:
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
:
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.
Note
Use write (called a direct memory write) to write to memory-mapped registers. For the TMS320C5xxx processor family, register PC is memory mapped and thus available using write , not regwrite . Use regwrite to write to all other registers.
|
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
![]() | regread | reload | ![]() |