(**********************************************************************) (* *) (* Function: RWTPIN - READ / WRITE TIMERS & pin *) (* *) (* Creation Date: 19/Dec/91 From: NEW *) (* *) (* Author: Jeff Wright *) (* *) (* Description: *) (* ------------ *) (* Allows user to read and write the two TCRs and to control and read *) (* the channel pin. A link can also be used to read the TCRs and *) (* update the pin. *) (* *) (* Updates: By: Modification: *) (* -------- --- ------------- *) (* 11/Apr/93 JL Converted to new syntax. *) (* *) (*--------------------------------------------------------------------*) (* Standard Exits Used:- End_Of_Phase: Y End_Of_Link: N *) (* *) (* External Files included: NONE *) (* *) (* CODE SIZE excluding standard exits = 18 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: *) (* ----- ----------- --------------- *) (* CHAN_CONTROL_RWTPIN CPU Parameter2 0..8 *) (* Standard channel configuration parameter. *) (* *) (* CHAN_PINSTATE_RWTPIN TPU Parameter3 0..15 *) (* Indicates current pinstate $8000=hi,$0000=lo. *) (* *) (* TCR1_VAL_RWTPIN BOTH Parameter4 0..15 *) (* Holds value of TCR1 read out by TPU or value to*) (* be loaded into TCR1 written by CPU. *) (* *) (* TCR2_VAL_RWTPIN BOTH Parameter5 0..15 *) (* Holds value of TCR2 read out by TPU or value to*) (* be loaded into TCR2 written by CPU. *) (* *) (* *) (* *) (* hsr1 hsr0 Action *) (* ---- ---- ------ *) (* 0 0 No action. *) (* 0 1 Read TCRs & read/write pin *) (* 1 0 Write TCR1, read TCRs & read/write pin *) (* 1 1 Write TCR2, read TCRs & read/write pin *) (* *) (* HSQ1 HSQ0 Action *) (* ---- ---- ------ *) (* X X Not used. *) (* *) (* Links Accepted: YES Links Generated: NO *) (* *) (* Interrupts Generated After: All States. *) (* *) (*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()*) (*+++++++++++++++++++++ PARAMETER MACROS +++++++++++++++++++++++++++*) %macro CHAN_CONTROL_RWTPIN 'prm2'. %macro CHAN_PINSTATE_RWTPIN 'prm3'. %macro TCR1_VAL_RWTPIN 'prm4'. %macro TCR2_VAL_RWTPIN 'prm5'. (*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*) (*====================================================================*) (*||||||||||||||||||||| MICROCODE STARTS BELOW |||||||||||||||||||||*) (*VVVVVVVVVVVVVVVVVVVVV--------------------------VVVVVVVVVVVVVVVVVVVVV*) (**********************************************************************) (* *) (* ENTRY name: RWTPIN_WT1 *) (* *) (* STATE(S) ENTERED: S2 *) (* *) (* PRELOAD PARAMETER : TCR1_VAL_RWTPIN *) (* *) (* ENTER WHEN : hsr1=1, hsr0=0. *) (* *) (* ACTION : Configure channel, update CHAN_PINSTATE, Load tcr1, IRQ. *) (* read both tcrs. *) (* *) (**********************************************************************) %entry name = rwtpin_wt1; start_address *; disable_match; cond hsr1 = 1,hsr0 = 0; ram p <- @TCR1_VAL_RWTPIN. rwtpin_wt1: au tcr1 := p ; (* jam tcr1 with value from PRAM *) ram p <- @CHAN_CONTROL_RWTPIN. (**********************************************************************) (* *) (* ENTRY name: RWTPIN_LNK *) (* *) (* STATE(S) ENTERED: S4 *) (* *) (* PRELOAD PARAMETER : CHAN_CONTROL_RWTPIN *) (* *) (* ENTER WHEN : hsr1=0, hsr0=0, lsr=1. *) (* *) (* ACTION : Configure channel, update CHAN_PINSTATE, read TCRs, IRQ. *) (* *) (**********************************************************************) %entry name = rwtpin_lnk; start_address *; disable_match; cond hsr1 = 0,hsr0 = 0,lsr = 1; ram p <- @CHAN_CONTROL_RWTPIN. (**********************************************************************) (* *) (* ENTRY name: RWTPIN_READ *) (* *) (* STATE(S) ENTERED: S1 *) (* *) (* PRELOAD PARAMETER : CHAN_CONTROL_RWTPIN *) (* *) (* ENTER WHEN : hsr1=0, hsr0=1. *) (* *) (* ACTION : Configure channel, update CHAN_PINSTATE, read TCRs, IRQ. *) (* *) (**********************************************************************) %entry name = rwtpin_read; start_address *; disable_match; cond hsr1 = 0,hsr0 = 1; ram p <- @CHAN_CONTROL_RWTPIN. chan_rwtpin: chan config:= p; (* setup channel/ disable mtsr service reqs*) disable_mtsr. au diob := tcr1; ram diob -> @TCR1_VAL_RWTPIN. (*store tcr1 value in parameter ram*) au chan_reg := chan_reg; (* latch pinstate *) neg_lsl; (* clear link & IRQ -> CPU *) chan cir. au diob := tcr2; (* store tcr2 value in parameter ram*) ram diob -> @TCR2_VAL_RWTPIN. If PSL = 1 then goto str_hi_rwtpin,flush. au diob := 0; ram diob -> @CHAN_PINSTATE_RWTPIN; end. (* store value to represent pinstate *) str_hi_rwtpin: au diob := max; ram diob -> @CHAN_PINSTATE_RWTPIN; end. (* all states end here or instruction above *) (**********************************************************************) (* *) (* ENTRY name: RWTPIN_WT2 *) (* *) (* STATE(S) ENTERED: S3 *) (* *) (* PRELOAD PARAMETER : TCR2_VAL_RWTPIN *) (* *) (* ENTER WHEN : hsr1=1, hsr0=1. *) (* *) (* ACTION : Configure channel, update CHAN_PINSTATE, Load tcr2, IRQ. *) (* read both tcrs. *) (* *) (**********************************************************************) %entry name = rwtpin_wt2; start_address *; disable_match; cond hsr1 = 1,hsr0 = 1; ram p <- @TCR2_VAL_RWTPIN. rwtpin_wt2: goto chan_rwtpin. au tcr2 := p; (* jam tcr2 with value from PRAM *) ram p <- @CHAN_CONTROL_RWTPIN. (**********************************************************************) (* UNUSED ENTRIES - execute appropriate termination *) (**********************************************************************) %entry start_address End_of_phase; name = quit_rwtpin; cond hsr1 = 0,hsr0 = 0,lsr = 0,m/tsr = 1.