Function: SQW - SQUARE WAVE ================================ Description: ------------ SQW produces a continuous output square wave after initialization. The user chooses the period by writing the parameter HIGH_TIME into the first parameter of the chosen channel. HIGH_TIME represents half the resulting period and must be in the range $0000 to $8000. Note that the actual minimum HIGH_TIME that can be generated will depend 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 of this function is 14 CPU clocks. The function uses TCR1 as the timebase. Signal generation starts with a rising edge. This function is very simple and therefore takes very little code space:- CODE SIZE excluding standard exits = 11 LONG WORDS Initialisation: --------------- ASSUMING a new function set containing SQW has been created following notes elsewhere and downloaded into ON-chip RAM and emulation mode enabled: To use the SQW function , the user should do the following:- i) Disable the selected channel by writing %00 to priority bits. ii) Write desired half period into PRAM1 of chosen channel. iii) Select SQW function on that channel by writng the assigned function number to the channels function select field. iv) Issuing a host service request type %11 to the channel. v) Enable servicing by writing High, Medium or Low priority to priority bits. The function will then start running. HIGH_TIME can be updated at any time by the CPU. (*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()*) (* *) (* Name: Written By: Location Bits: *) (* ----- ----------- --------------- *) (* HIGH_TIME_SQW CPU Parameter0 0..15 *) (* High time of period. (Also the low time, since *) (* this is a square wave.) HIGH_TIME_SQW cannot *) (* be greater than $8000. *) (* *) (* HSR1 HSR0 Action *) (* ---- ---- ------ *) (* 1 1 Initialize continuous square wave *) (* *) (* *) (* Links Accepted: NO Links Generated: NO *) (* *) (* Interrupts Generated After: No interrupts generated *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*)