(**********************************************************************) (* *) (* Function: SQW - SQUARE WAVE *) (* *) (* Creation Date: 03/Mar/92 From: NEW *) (* *) (* Author: Amy Dyson *) (* *) (* Description: *) (* ------------ *) (* SQW produces a continuous square wave after initialization. The *) (* user chooses the period by writing the parameter HIGH_TIME in ram. *) (* (High time and low time are the same.) HIGH_TIME must be between *) (* $0000-$8000. *) (* *) (* Updates: By: Modification: *) (* -------- --- ------------- *) (* 11/Apr/93 JL Converted to new syntax. *) (* *) (*--------------------------------------------------------------------*) (* Standard Exits Used:- End_Of_Phase: N End_Of_Link: Y *) (* *) (* External Files included: NONE *) (* *) (* CODE SIZE excluding standard exits = 11 LONG WORDS *) (*--------------------------------------------------------------------*) (* *) (* *) (********** This Revision: 1.1 *********) (* *) (********** LAST MODIFIED: 11/Apr/93 BY: Jeff Loeliger ********) (* *) (**********************************************************************) (***************************************************************************) (*Motorola reserves the right to make changes without further notice to any*) (*product herein. Motorola makes no warranty, representation or guarantee *) (*regarding the suitability of its products for any particular purpose, nor*) (*does Motorola assume any liability arising out of the application or use *) (*of any product or circuit, and specifically disclaims any and all *) (*liability, including without limitation consequential or incidental *) (*damages. "Typical" parameters can and do vary in different applications. *) (*All operating parameters, including "Typical",must be validated for each *) (*customer application by customer's technical experts. Motorola does not *) (*convey any license under its patent rights nor the rights of others. *) (*Motorola products are not designed, intended, or authorized for use as *) (*components in systems intended for surgical implant into the body, or *) (*other applications intended to support or sustain life, or for any other *) (*application in which the failure of the Motorola product could create a *) (*situation where injury or death may occur. Should Buyer purchase or use *) (*Motorola products for any such unintended or unauthorized application, *) (*Buyer, shall indemnify and hold Motorola and its officers, employees, *) (*subsidiaries, affiliates, and distributors harmless against all claims, *) (*costs, damages, and expenses, and reasonable attorney fees arising out *) (*of, directly or indirectly, any claim of personal injury or death *) (*associated with such unintended or unauthorized use, even if such claim *) (*alleges that Motorola was negligent regarding the design or manufacture *) (*of the part. *) (*Motorola and the Motorola logo are registered trademarks of Motorola Inc.*) (*Motorola is an Equal Opportunity/Affirmative Action Employer. *) (*Copyright Motorola Inc. 1993 *) (***************************************************************************) (*()()()()()()()()()()() 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 *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*) (*+++++++++++++++++++++ PARAMETER MACROS +++++++++++++++++++++++++++*) %macro HIGH_TIME_SQW 'prm0'. (*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*) (*====================================================================*) (*||||||||||||||||||||| MICROCODE STARTS BELOW |||||||||||||||||||||*) (*VVVVVVVVVVVVVVVVVVVVV--------------------------VVVVVVVVVVVVVVVVVVVVV*) (**********************************************************************) (* *) (* ENTRY name: INIT_SQW *) (* *) (* STATE(S) ENTERED: S1 *) (* *) (* PRELOAD PARAMETER : HIGH_TIME_SWQ *) (* *) (* ENTER WHEN : HSR = %11 *) (* *) (* ACTION: set time base as TCR1, set pin high, and pac to toggle *) (* pin after each match. Write the current time + the *) (* HIGH_TIME to the mer. Negate latches. Enable service *) (* requests. *) (* *) (**********************************************************************) %entry name = INIT_SQW; start_address *; disable_match; cond hsr1=1,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x; ram p <-@HIGH_TIME_SQW. chan TBS:= out_m1_c1, (* pin is output, use TCR1 *) PAC:= toggle, (* toggle pin on match *) pin:= high, (* initialize pin as high *) enable_mtsr. (* enable m/tsr requests *) au ert:= tcr1+p; (* write current time + *) chan write_mer, (* high time to mer *) neg_mrl, neg_tdl, neg_lsl; (* negate latches *) end. (* end of S1 *) (**********************************************************************) (* *) (* ENTRY name: MATCHED_SQW *) (* *) (* STATE(S) ENTERED: S2 *) (* *) (* PRELOAD PARAMETER : HIGH_TIME_SWQ *) (* *) (* ENTER WHEN : HSR = %00 m/tsr=1 lsr=X flag0=X pin=X *) (* *) (* ACTION: Write HIGH_TIME_SQW + last match time to mer, neg_mrl. *) (* *) (**********************************************************************) %entry name = MATCHED_SQW; start_address *; disable_match; cond hsr1=0,hsr0=0,lsr=x,m/tsr=1,pin=x,flag0=x; ram p <-@HIGH_TIME_SQW. au ert:= ert + p; (* write last match time + *) chan write_mer, (* high time to mer *) neg_mrl, neg_tdl, neg_lsl; (* negate latches *) end. (* end of S2 *) (**********************************************************************) (* UNUSED STATES *) (**********************************************************************) %entry name = UNUSED_SQW; start_address END_OF_LINK; disable_match; cond hsr1=0,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x; ram p <-none. %entry name = UNUSED_SQW; start_address END_OF_LINK; disable_match; cond hsr1=1,hsr0=0,lsr=x,m/tsr=x,pin=x,flag0=x; ram p <-none. %entry name = UNUSED_SQW; start_address END_OF_LINK; disable_match; cond hsr1=0,hsr0=0,lsr=1,m/tsr=0,pin=x,flag0=x; ram p <-none.