(**********************************************************************) (* *) (* Function: DIO - Descrete Input/Output *) (* *) (* Creation Date: Pre 89 From: NEW *) (* *) (* Author: Motorola *) (* *) (* Description: *) (* ------------ *) (* Init - Initialization phase for both input or output. *) (* ----- (HSR = 11 and hsq1 = 0) *) (* *) (* Discrete Output - force pin low/high as host request: *) (* --------------- *) (* 1. Force pin low *) (* (HSR = 10) *) (* 2. Force pin high *) (* (HSR = 01) *) (* 3. Update pin state parameter according to host request. *) (* (HSR = 11 and hsq1 = 1) *) (* *) (* Discrete Input - 3 modes of operation: *) (* -------------- *) (* 1. Update pin state parameter according to host request. *) (* (HSR = 11 and hsq1 = 1) *) (* 2. Update pin state parameter when specified trans detected *) (* (SEQ0 = 0) *) (* 3. Update pin state parameter at programmable rate specified *) (* by parameter OFFSET_DIO. *) (* (SEQ0 = 1) *) (* *) (* Updates: By: Modification: *) (* -------- --- ------------- *) (* 28/Feb/92 JW Cleaned up for inclusion in Library *) (* 10/Apr/93 JL Converted to new syntax & changed unused *) (* link states to End_of_Link *) (* 30/Mar/94 JL Fix bug when doing match on TCR2. Old way tried *) (* to always force a match using TCR1. *) (* *) (*--------------------------------------------------------------------*) (* Standard Exits Used:- End_Of_Phase: Y End_Of_Link: N *) (* *) (* External Files %included: NONE. *) (* *) (* CODE SIZE excluding standard exits = 23 LONG WORDS *) (*--------------------------------------------------------------------*) (* *) (* *) (********** This Revision: 2.1 *********) (* *) (********** LAST MODIFIED: 30/Mar/94 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 *) (***************************************************************************) (* Parameters *) %macro CHANNEL_CONTROL_DIO 'prm0'. %macro PLV 'prm1'. %macro OFFSET_DIO 'prm2'. (**********************************************************************) (* *) (* STATE : INIT / Update pin State parameter *) (* *) (* PRELOAD PARAMETER : CHANNEL_CONTROL_DIO *) (* *) (* ENTER WHEN : issued host service request 11 *) (* *) (* ACTION : Configure for mode of operation OR record the state of *) (* the pin *) (**********************************************************************) %entry ram p <- @CHANNEL_CONTROL_DIO; start_address *; name = INIT_UPD_PS; cond hsr1 = 1, hsr0 = 1. INIT_UPD_PS : if hsq1 = 1 then goto Update_ps, flush. Initialize : chan tbs := in_m1_c1, enable_mtsr. au ert := tcr1; chan write_mer. (* remove any pending match *) nop. (* DO NOT REMOVE, need for match *) chan clear flag0; chan config := p; if hsq0 = 0 then goto Update_ps, flush. (* Update pin state when trans. *) Init_match_mode : chan set flag0; (* Update pin state periodicaly *) ram p <- @OFFSET_DIO. (**********************************************************************) (* *) (* STATE : MATCH_PS *) (* *) (* PRELOAD PARAMETER : OFFSET_DIO *) (* *) (* ENTER WHEN : match recognized *) (* *) (* ACTION : Record the state of the pin and setup for next match *) (**********************************************************************) %entry ram p <- @OFFSET_DIO; start_address *; disable_match; name = MATCH_PS; cond hsr1 = 0,hsr0 = 0,m/tsr = 1,lsr = x,flag0 = 1. Prepare_match_event : au ert := ert + p; chan write_MER, PAC := no_change. Update_ps : if PSL = 1 then goto Set_P_bit15. ram p <- @PLV. (**********************************************************************) (* *) (* STATE : TRANS_PS_LOW *) (* *) (* PRELOAD PARAMETER : PLV *) (* *) (* ENTER WHEN : high_low transition is detected *) (* *) (* ACTION : Record the state of the pin *) (**********************************************************************) %entry ram p <- @PLV; start_address *; name = TRANS_PS_LOW; cond hsr1 = 0,hsr0 = 0,m/tsr = 1,lsr = x,pin = 0,flag0 = 0. Clr_P_bit15 : au p :=>> p ; (* shift right *) chan neg_tdl, neg_lsl, neg_mrl; chan cir. ram p -> @PLV; end. (**********************************************************************) (* *) (* STATE : TRANS_PS_HIGH *) (* *) (* PRELOAD PARAMETER : PLV *) (* *) (* ENTER WHEN : low_high transition is detected *) (* *) (* ACTION : Record the state of the pin *) (**********************************************************************) %entry ram p <- @PLV; start_address Set_P_bit15; name = TRANS_PS_HIGH; cond hsr1 = 0,hsr0 = 0,m/tsr = 1,lsr = x,pin = 1,flag0 = 0. Set_P_bit15 : au p :=>> p ; (* shift right *) chan neg_tdl, neg_lsl, neg_mrl; chan cir. au p := p + max; ram p -> @PLV; end. (**********************************************************************) (* *) (* STATE : LOW_PIN_REQUEST *) (* *) (* PRELOAD PARAMETER : PLV *) (* *) (* ENTER WHEN : HSR = 10 *) (* *) (* ACTION : Force the state of the pin low and record the state *) (**********************************************************************) %entry ram p <- @PLV; start_address *; name = LOW_PIN_REQUEST; cond hsr1 = 1,hsr0 = 0. LOW_PIN_REQUEST : chan pin := low, TBS := out_m1_c1, PAC := no_change; if TRUE then goto Clr_P_bit15, flush. (**********************************************************************) (* *) (* STATE : HIGH_PIN_REQUEST *) (* *) (* PRELOAD PARAMETER : PLV *) (* *) (* ENTER WHEN : HSR = 01 *) (* *) (* ACTION : Force the state of the pin high and record the state *) (**********************************************************************) %entry ram p <- @PLV; start_address *; name = HIGH_PIN_REQUEST; cond hsr1 = 0,hsr0 = 1. HIGH_PIN_REQUEST : chan pin := high, TBS := out_m1_c1, PAC := no_change; if TRUE then goto Set_P_bit15, flush. (**********************************************************************) (* UNUSED ENTRIES - execute an end. *) (**********************************************************************) %entry ram p<-prm0; start_address End_of_Link; name = dio_undef; cond hsr1 = 0,hsr0 = 0,m/tsr = 0,lsr =1.