181
19.3.4 DMA Channel Priority
It is possible to control the priority between separate DMA channels. There are three
channel-priority options in the Rabbit 4000. The first is fixed priority after every byte where
the priority of each channel is equal to its number, i.e., if both DMA Channels 3 and 4
have a pending transfer request, DMA Channel 4 will always be enabled first. If at any
point a channel with higher priority than the one currently transferring has a DMA request
pending, the current transfer will be terminated and the new channel’s transfer will start.
With this setting, DMA Channel 7 will always have priority over all other channels, and
DMA Channel 0 will transfer only if no other channels have pending requests.
The other two settings rotate the priority between channels as shown in
Table 19-4; after
the seventh rotation, the priority sequence restarts at the top of the table. One option is to
rotate priority after every byte analogous to the fixed-priority setting. The priority list is
updated after each byte transferred, and if a higher priority channel has a pending request
the current transfer will be terminated and the new channel transfer will start. The other
option is to rotate after every burst; this will guarantee that reasonable amounts of data are
transferred by each channel before a switchover occurs.
19.3.5 Buffer Descriptor Modes
Flags in the control byte of a buffer descriptor (which gets loaded into DyCR) describe
whether to halt on completion of the transfer (or load another descriptor) and whether the
next descriptor is adjacent in memory (which implies that the current descriptor is only 12
bytes long) or located at the link address. Each descriptor can also be set to generate an
interrupt on completion of the transfer. By using these options in various ways, the Rabbit
4000 DMA can be operated in a number of conventional DMA modes.
The most common options are described here; others are certainly possible by different
use of the available linking methods.
Table 19-4. Rotating DMA Channel Priority
Rotation
Channel Priority, High to Low
Initial (and eighth)
7, 6, 5, 4, 3, 2, 1, 0
First
6, 5, 4, 3, 2, 1, 0, 7
Second
5, 4, 3, 2, 1, 0, 7, 6
Third
4, 3, 2, 1, 0, 7, 6, 5
Fourth
3, 2, 1, 0, 7, 6, 5, 4
Fifth
2, 1, 0, 7, 6, 5, 4, 3
Sixth
1, 0, 7, 6, 5, 4, 3, 2
Seventh
0, 7, 6, 5, 4, 3, 2, 1