User`s manual
MOTOROLA MC68332TUT/D
42
4.5.1.2 Channel Function Select Registers
Channel function select registers (CFSR[1:3]) contain the function numbers assigned to each individual
channel. These function numbers are mask-set dependent because they are determined by the microcode
assembly.
4.5.1.3 Host Sequence Registers
Host sequence registers (HSQR0 and HSQR1) contain the host sequence bits for the function running on
a particular channel. The host sequence bits determine the mode of a particular function. Host sequence
bit encoding for each function is determined by microcode, and differs from function to function. For exam-
ple, host sequence bits for a function that counts input transitions could determine whether the function op-
erates in single-shot mode or continuous mode.
4.5.1.4 Host Service Request Registers
Host servicerequest registers (HSRR0 and HSRR1) contain the service request bits for each channel. The
service request bits ask the TPU microengine to perform a particular service on the associated channel.
Usually, the first service request is for initialization. Another common service request is for an immediate
update.
Like host sequence bits, host service bit encoding for each function is determined by microcode, and differs
from function to function. However, the host service bits are different from other control bits because, while
the CPU can set the service bits, only the TPU can clear them. In fact, the TPU tells the CPU that it has
serviced a channel the first time by clearing the host service request bits. An HSRR should not be written
unless all of the other parameters and control bits are initialized or the associated channel is disabled (via
the channel priority register)
and
the host service bits are cleared. The CPU program must wait until a pre-
vious service request has been cleared before issuing a new service request.
To make a host service request, follow one of the following scenarios.
1. To initialize a channel out of reset, first initialize the parameter RAM and other control registers, then
make the host service request for initialization. The final step is to enable the channel via the channel
priority register.
2. To change the function operating on a particular channel, first disable the channel using the channel
priority register, then follow the same steps as for initialization out of reset.
3. To make a host service request other than that for initialization, do not disable the channel. Instead,
wait for the TPU to clear the previous host service request. Then, issue a new request. Usually this
is for an immediate update or to force an output state on a particular pin.
To initialize two or more channels that share a host service request register, either write all the fields in the
register at the same time or disable all channels via the channel priority registers, write to the host service
request register, then enable each channel as needed via the channel priority registers. This ensures that
conflicts do not occur within the host service request registers. If the channels are running, and cannot be
disabled, write the host service request field for the first channel, then poll those bits until the TPU clears
them. Then, write the host service request field for the second channel, wait until the TPU clears it, and so
on.
4.5.1.5 Channel Priority Registers
The channel priority registers determine how often each channel is serviced. There are three priority levels:
high, medium, and low. If the priority bits are set to zero, then a channel is disabled, and the TPU mi-
croengine will not service it.