(**********************************************************************) (* *) (* Function: RECTW - RECTANGULAR WAVE *) (* *) (* Creation Date: 03/Mar/92 From: NEW *) (* *) (* Author: Amy Dyson *) (* *) (* Description: *) (* ------------ *) (* RECTW produces a continuous rectangular wave after initialization. *) (* The user chooses the period and the high time by writing the *) (* parameters HIGH_TIME and PERIOD in ram. HIGH_TIME and *) (* PERIOD - HIGH_TIME must be between $0000-$8000. *) (* *) (* Updates: By: Modification: *) (* -------- --- ------------- *) (* 11/Apr/93 JL Convert to new syntax *) (* *) (*--------------------------------------------------------------------*) (* Standard Exits Used:- End_Of_Phase: N End_Of_Link: Y *) (* *) (* External Files included: NONE *) (* *) (* CODE SIZE excluding standard exits = 14 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_RECTW CPU Parameter0 0..15 *) (* High time of period. HIGH_TIME_RECTW cannot *) (* be greater than $8000. *) (* PERIOD_RECTW CPU Parameter1 0..15 *) (* Period. PERIOD_RECTW - HIGH_TIME_RECTW cannot *) (* be greater than $8000. *) (* *) (* hsr1 hsr0 Action *) (* ---- ---- ------ *) (* 1 1 Initialize continuous rectangular wave *) (* *) (* *) (* Links Accepted: NO Links Generated: NO *) (* *) (* Interrupts Generated After: No interrupts generated *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*) (*+++++++++++++++++++++ PARAMETER MACROS +++++++++++++++++++++++++++*) %macro HIGH_TIME_RECTW 'prm0'. %macro PERIOD_RECTW 'prm1'. (*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*) (*====================================================================*) (*||||||||||||||||||||| MICROCODE STARTS BELOW |||||||||||||||||||||*) (*VVVVVVVVVVVVVVVVVVVVV--------------------------VVVVVVVVVVVVVVVVVVVVV*) (**********************************************************************) (* *) (* ENTRY name: INIT_RECTW *) (* *) (* STATE(S) ENTERED: S1 *) (* *) (* PRELOAD PARAMETER : HIGH_TIME_RECTW *) (* *) (* ENTER WHEN : HSR = %11 *) (* *) (* ACTION: set time base as TCR1, set pin high, and pac to low so the *) (* pin goes low after a match. Write the current time + the *) (* HIGH_TIME to the mer. Negate latches. Enable m/tsr *) (* service requests. *) (* *) (**********************************************************************) %entry name = INIT_RECTW; start_address *; disable_match; cond hsr1=1,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x; ram p <-@HIGH_TIME_RECTW. chan TBS:= out_m1_c1, (* pin is output, use TCR1 *) PAC:= low, (* make pin go low next 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_LOW_RECTW *) (* *) (* STATE(S) ENTERED: S2 *) (* *) (* PRELOAD PARAMETER : HIGH_TIME_RECTW *) (* *) (* ENTER WHEN : HSR = %00 m/tsr=1 lsr=X flag0=X pin=0 *) (* *) (* ACTION: Find low time by subtracting the high time from the *) (* period. Add the low time to the last matched time (ert) *) (* and write this to mer, set the pin to go high on match *) (* and negate mrl. *) (* *) (**********************************************************************) %entry name = MATCHED_LOW_RECTW; start_address *; disable_match; cond hsr1=0,hsr0=0,lsr=x,m/tsr=1,pin=0,flag0=x; ram p <-@HIGH_TIME_RECTW. ram diob <- @PERIOD_RECTW. (* fetch period from ram *) au p:= diob - p. (* subtract high time from *) au ert:= ert + p; (* write next match *) chan write_mer, (* time to mer *) PAC:= high, neg_mrl; (* negate mrl *) end. (* end of S2 and S3 *) (* period to get low time *) (**********************************************************************) (* *) (* ENTRY name: MATCHED_HIGH_RECTW *) (* *) (* STATE(S) ENTERED: S3 *) (* *) (* PRELOAD PARAMETER : HIGH_TIME_RECTW *) (* *) (* ENTER WHEN : HSR = %00 m/tsr=1 lsr=X flag0=X pin=1 *) (* *) (* ACTION: Add the high time to the last match time (ert) and write *) (* this to the mer. set the pin to go low on a match. *) (* *) (* *) (**********************************************************************) %entry name = MATCHED_HIGH_RECTW; start_address *; disable_match; cond hsr1=0,hsr0=0,lsr=x,m/tsr=1,pin=1,flag0=x; ram p <-@HIGH_TIME_RECTW. au ert:= ert + p; (* write next match *) chan write_mer, (* time to mer *) PAC:= low, neg_mrl; (* negate mrl *) end. (* end of S2 and S3 *) (**********************************************************************) (* UNUSED STATES *) (**********************************************************************) %entry name = UNUSED_RECTW; 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_RECTW; 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_RECTW; start_address END_OF_LINK; disable_match; cond hsr1=0,hsr0=0,lsr=1,m/tsr=0,pin=x,flag0=x; ram p <-none.