Function: MHT- MEASURE HIGH TIME ==================================== Description: ------------ MHT measures the high time of an input signal using TCR1 as the timebase, and writes the result into parameter RAM. MHT interrupts the CPU after measuring each high time. After initialization, MHT will continuously measure high time. The high time input must be in the range HTmin to $FFFF TCR1 counts. HTmin is dependant on other TPU activity - ie time taken to service other channels will define the maximum performance of this function. With no other channels active, the minimum HIGH_TIME that can be measured by this function is the number of TCR1 counts equivalent to 14 CPU clocks with a minimum period of 28 CPU clocks. CODE SIZE excluding standard exits = 14 LONG WORDS Initialisation: --------------- ASSUMING a new function set containing MHT has been created following notes elsewhere and downloaded into ON-chip RAM and emulation mode enabled: To use the MHT function , the user should do the following:- i) Disable the selected channel by writing %00 to priority bits. ii) Select MHT function on that channel by writng the assigned function number to the channels function select field. iii) Issuing a host service request type %11 to the channel. iv) Enable servicing by writing High, Medium or Low priority to priority bits. The function will then start running. When a high time measurement has been completed, the function will issue an interrupt request to the CPU. The CPU can then read the high time result from the channels second parameter. (*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()*) (* *) (* Name: Written By: Location Bits: *) (* ----- ----------- --------------- *) (* START_TIME_MHT TPU Parameter0 0..15 *) (* Start time of a high pulse. MHT uses this *) (* to measure high times. *) (* HIGH_TIME_MHT TPU Parameter1 0..15 *) (* High time of the last high pulse measured. *) (* *) (* HSR1 HSR0 Action *) (* ---- ---- ------ *) (* 1 1 Initialize MHT function *) (* *) (* *) (* Links Accepted: NO Links Generated: NO *) (* *) (* Interrupts Generated After: Every high time is measured *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*) Function: MHT2- MEASURE HIGH TIME 2 ======================================= Description: ------------ MHT2 is identical in operation to MHT described above, except that MHT2 will also issue a link request to a user specified channel after completion of the first high time measurement after initialisation. With no other channels active, the minimum HIGH_TIME that can be measured by this function is the number of TCR1 counts equivalent to 14 CPU clocks with a minimum period of 28 CPU clocks. CODE SIZE excluding standard exits = 15 LONG WORDS Initialisation: --------------- ASSUMING a new function set containing MHT2 has been created following notes elsewhere and downloaded into ON-chip RAM and emulation mode enabled: To use the MHT2 function , the user should do the following:- i) Disable the selected channel by writing %00 to priority bits. ii) Select MHT function on that channel by writng the assigned function number to the channels function select field. iii) Write the link destination channel number to the third parameter of the MHT2 channel. iv) Issue a host service request type %11 to the channel. iii)Enable servicing by writing High, Medium or Low priority to priority bits. The function will then start running. When a high time measurement has been completed, the function will issue an interrupt request to the CPU. The CPU can then read the high time result from the channels second parameter. After the first high time measurement since last initialisation, the function shall also issue a link request to the specified channel. (*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()*) (* *) (* Name: Written By: Location Bits: *) (* ----- ----------- --------------- *) (* START_TIME_MHT2 TPU Parameter0 0..15 *) (* Start time of a high pulse. MHT2 uses this *) (* to measure high times. *) (* HIGH_TIME_MHT2 TPU Parameter1 0..15 *) (* High time of the last high pulse measured. *) (* LINK_TO_MHT2 CPU Parameter2 4..7 *) (* Channel number that MHT2 will link to after *) (* measuring the first high time after initial- *) (* ization. *) (* *) (* HSR1 HSR0 Action *) (* ---- ---- ------ *) (* 1 1 Initialize MHT2 function *) (* *) (* *) (* Links Accepted: NO Links Generated: YES *) (* *) (* Interrupts Generated After: Every high time is measured *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*)