![Infineon Technologies TC1784 Скачать руководство пользователя страница 809](http://html.mh-extra.com/html/infineon-technologies/tc1784/tc1784_user-manual_2055446809.webp)
TC1784
Peripheral Control Processor (PCP)
User´s Manual
10-144
V1.1, 2011-05
PCP, V2.09
10.20.6
Case-like Code Switches (Computed Go-To)
The JC.I instruction can be used to implement a multi-way branch for branch-on-bit or
branch-on-state conditional branches. This instruction allows a conditional relative jump
based on an index held in a register. If this instruction is combined with a table of jump
addresses, a switch-type statement can be implemented. The default case, that is when
the condition code = False, is the next instruction, as is the jump with register index = 0.
The table can be any arbitrary length. The index register should be checked for range
before the jump into the table is performed.
For Example:
COMP R3,#5
;compare R3 to #5 - the number
;of entries in the table
JC.I R3,cc_ULE
DEFAULT:
JL
#case_0
;destination if R3 = 0 or
;condition = false
JL
#case_1
;destination if R3 = 1
JL
#case_2
;destination if R3 = 2
JL
#case_3
;destination if R3 = 3
JL
#case_4
;destination if R3 = 4
JL
#case_5
;destination if R3 = 5
10.20.7
Simple DMA Operation
A simple interrupt-driven DMA requires at least the Small Context Model to operate
properly. Its operation is consists of three stages:
•
The device interrupts the PCP to indicate it can receive or provide data.
•
The PCP moves the amount of data it is programmed to move.
•
The PCP eventually finishes and interrupts the CPU to notify it that the DMA is
complete.
There are two options for implementing a simple DMA operation, copy and burst copy.
10.20.7.1 COPY Instruction
A simple DMA channel program can consist of only two instructions. In the example
below, a device interrupts the PCP to notify it that it has data in its output buffer, which
is 4 words deep. The COPY instruction copies 4 words to memory at a time. It
decrements CNT1 (which is initialized by the CPU in CR6_CNT1 context) after each 4
word transfer. The EXIT command then executes, and if CNT1 was decremented to 0,
the condition code causes it to issue an interrupt with the value held R6_SRPN.
COPY DST+,SRC,CNC=1,BRST=4,SIZE=32
;do peripheral -> memory DMA
EXIT EC=0,ST=0,INT=1,EP=0,cc_CNZ
;transfer done, so exit
Содержание TC1784
Страница 1: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 3: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 950: ...TC1784 Direct Memory Access Controller DMA User s Manual 11 132 V1 1 2011 05 DMA V3 03 ...
Страница 1949: ...TC1784 General Purpose Timer Array GPTA v5 User s Manual 21 297 V1 1 2011 05 GPTA v5 V1 14 ...
Страница 2350: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG Doc_Number ...