Data Logging
7.8.4 Examples of Data Logging
Example 7−1. Initialization Code for Data Logging With Word Counter
; Base addresses
ADMA
.set
; Offsets
DMA_ADDRL .set
DMA_ADDRH .set
DMA_CNTRL .set
DMA_ID
.set
EALLOW
MOV
AR4, #ADMA
MOV
*+AR4[#DMA_CNTRL],#1
NOP
NOP
NOP
CMP
*+AR4[#DMA_ID],#7001h
B
FAIL, NEQ
MOV
*+AR4[#DMA_ADDRL],#0100h
MOV
*+AR4[DMA_ADDRH],#((256 − 20) << 8)
MOV
*+AR4[DMA_CNTRL],#3E62h
EDIS
7-28
Example 7−1 shows how to log 20 32-bit words, starting at address 00 0100
in data memory. The accesses are preemptive (they have higher priority than
the CPU) and rude (they ignore the state of the DBGM bit). In addition, data
logging can occur during time-critical interrupt service routines. The applica-
tion can determine whether the data logging operation is complete by polling
the LSB of the DMA control register (DMA_CNTRL) at 00 083E
operation is complete, that bit is set to 1.
0838h
0
1
6
7
; AR4 pointing to register base addr
; Attempt to claim resource
; Value expected in ID register
; If we don't see the correct ID, then we
;
; Set starting address of buffer,
;
Example 7−2 shows how to log from address 00 0100
in data memory. The accesses are nonpreemptive (they have lower priority
than the CPU), and are polite (they are not performed when the DBGM bit is
0). The data logging cannot occur when a time-critical interrupt is being ser-
viced. An end address of 00 02FF
tion must not read from 00 02FF
address stops the data logging. As in Example 7−1, the application can poll
the LSB of DMA_CNTRL for a 1 to determine whether the data logging opera-
tion is complete.
failed (the resource is already in use)
and then the count
is used to end the transfer. The applica-
16
during the data logging; a read from that
16
16
. When the
16
to address 00 02FF
16
16
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?