BreakPoints are the "hot items" in the whole program. The ShutterWheel breakpoints are used to measure the times. The times measured are the time the shutter takes to go to the "OPEN" position and the time it takes to go to "CLOSE" position again. On the first breakpoint the time is read out of the timer and stored in an global varaible called "ExposureTimerOpen". It goes on timing and when it passes the Close Breakpoint it then registrates the time again, now its store in the global varaible called "ExposureTimeClose". These two values then will be ask for by MCAD somewhere later.
For measuring the timing, the system uses a second interrupt function which is called "Shutter_Timing_Open_Close". This function is called on a overflow interrupt from timer2 which MCAM uses to measure the time. This function is also included inhere and is that small that I won't provide a flowchart for it.
The whole sequence starts as follows; (Starting from Startup)
/**********************************************************************/ /* FunctionName : Shutter LM628 Position Interrupt */ /* FunctionInput : None (Not Allowed Either) */ /* FunctionOutput : None. */ /* FunctionCall : Write_Address, Rsti, Turn_Off_Ltrj, Sbpa, Pos_Ltrj*/ /* CommonVarUse : ExposureRequest, OpenFlag, THTL2, ExposureTiming- */ /* : Open & Close. ShutOpenPulses, ShutClosePulses. */ /* : It's using registerset number 2 of the 80535 */ /* StructureUse : ServoSetting (On Shutter) */ /* Description : This Function is created to get a almost perfect */ /* : timing from the shutter. First it measures the time*/ /* : to the open position. Second it measures the time */ /* : to the close position. */ /* : MaxTime = 65535*65535=4294836225 mSec. */ /* LastUpdates : 15/08/96. */ /**********************************************************************/ void Shutter_LM628_Pos_Int(void) interrupt 2 using 2 { Address=ShutterAddress; /* Set address to the shutter */ Write_Address(); /* Make electronics set to shut*/ Rdstat(); /* Get the LM628 status */ if ((OpenFlag==1) && (status & 0x40)) /* Breakpoint Interrupt ? */ { ExposureTimingOpen=THTL2; /* Get Time from Timer */ OpenFlag=0; /* Next time should be close */ stscpy(ShutterToAct); /* Use Actual Data for shutter*/ Rdrp(); /* Read Real Position */ while (ShutClosePulses < act.realpos) ShutClosePulses=ShutClosePulses+7200; act.breakpoint=ShutClosePulses; /* Set next breakpoint to close*/ Address=ShutterAddress; /* Set address to the shutter */ Write_Address(); /* Make electronics set to shut*/ Sbpa(); /* And write to LM628 */ stscpy(ActToShutter); /* Copy back to shutter struc */ } else { if ((OpenFlag==0) && (status & 0x40)) { ExposureTimingClose=THTL2; T2I0 = 0; OpenFlag=1; stscpy(ShutterToAct); Rdrp(); while (ShutOpenPulses < act.realpos) ShutOpenPulses=ShutOpenPulses+7200; act.breakpoint=ShutOpenPulses; Address=ShutterAddress; /* Set address to the shutter */ Write_Address(); /* Make electronics set to shut*/ Sbpa(); stscpy(ActToShutter); } } Rsti(); /* Clear Interrupt Reg's LM628 */ Mski(); /* Write Mask again */ return; } /**********************************************************************/ /* FunctionName : Shutter Timing Open Close. */ /* FunctionInput : None (Not Allowed To) */ /* FunctionOutput : None. */ /* FunctionCall : None */ /* CommonVarUse : THTL2, and 80535 registerset 1. */ /* StructureUse : None. */ /* Description : This Function is to measure the perfect timing */ /* : for opening and closing the shutter. It's int. */ /* : Driven and therefore more perfect then anything */ /* : else. */ /* LastUpdates : 14/08/96. */ /**********************************************************************/ void Shutter_Timing_Open_Close(void) interrupt 5 using 1 { THTL2++; TF2=0; /* Clear Interrupt Flag */ return; }