Model { Name "I2C_MultipleSequence_FinitStateMachine" Version 6.4 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.10" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "windows-1252" SaveDefaultBlockParams on SampleTimeColors on LibraryLinkDisplay "none" WideLines on ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Wed Mar 14 23:59:06 2007" Creator "Lubin" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Lubin" ModifiedDateFormat "%" LastModifiedDate "Mon Feb 18 22:57:59 2008" ModelVersionFormat "1.%" ConfigurationManager "None" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "normal" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigDurationFloating "auto" ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on BufferReuse on ProdHWDeviceType "16-bit Generic" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.2.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.2.0" StartTime "0.0" StopTime "10.0" AbsTol "auto" FixedStep "0.001" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ConsecutiveZCsStepRelTol "10*128*eps" MaxConsecutiveZCs "1000" ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" MaxConsecutiveMinStep "1" RelTol "1e-3" SolverMode "Auto" Solver "FixedStepDiscrete" SolverName "FixedStepDiscrete" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.2.0" Decimation "1" ExternalInput "[t, u]" FinalStateName "xFinal" InitialState "xInitial" LimitDataPoints on MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "Array" SaveOutput on SaveState off SignalLogging on InspectSignalLogs off SaveTime on StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "logsout" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" } Simulink.OptimizationCC { $ObjectID 4 Version "1.2.0" BlockReduction on BooleanDataType on ConditionallyExecuteInputs on InlineParams off InlineInvariantSignals off OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast on ExpressionFolding on FoldNonRolledExpr on LocalBlockOutputs on ParameterPooling on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode on LifeSpan "1" BufferReusableBoundary on } Simulink.DebuggingCC { $ObjectID 5 Version "1.2.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" ReadBeforeWriteMsg "UseLocalSettings" WriteAfterWriteMsg "UseLocalSettings" WriteAfterReadMsg "UseLocalSettings" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "TryResolveAllWithWarning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" MaxConsecutiveZCsMsg "error" SolverPrmCheckMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "error" MultiTaskCondExecSysMsg "error" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" SigSpecEnsureSampleTimeMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterUnderflowMsg "none" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" FcnCallInpInsideContextMsg "Use local settings" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SFcnCompatibilityMsg "none" UniqueDataStoreMsg "none" BusObjectLabelMismatch "warning" RootOutportRequireBusObject "warning" AssertControl "UseLocalSettings" EnableOverflowDetection off ModelReferenceIOMsg "none" ModelReferenceVersionMismatchMessage "none" ModelReferenceIOMismatchMessage "none" ModelReferenceCSMismatchMessage "none" ModelReferenceSimTargetVerbose off UnknownTsInhSupMsg "warning" ModelReferenceDataLoggingMessage "warning" ModelReferenceSymbolNameMessage "warning" ModelReferenceExtraNoncontSigs "error" StrictBusMsg "Warning" } Simulink.HardwareCC { $ObjectID 6 Array { Type "Cell" Dimension 2 Cell "ProdHWDeviceType" Cell "ProdEqTarget" PropName "DisabledProps" } Version "1.2.0" ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 16 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "Unspecified" ProdWordSize 16 ProdShiftRightIntArith on ProdHWDeviceType "16-bit Generic" TargetBitPerChar 8 TargetBitPerShort 16 TargetBitPerInt 32 TargetBitPerLong 32 TargetShiftRightIntArith on TargetIntDivRoundTo "Undefined" TargetEndianess "Unspecified" TargetWordSize 32 TargetTypeEmulationWarnSuppressLevel 0 TargetPreprocMaxBitsSint 32 TargetPreprocMaxBitsUint 32 TargetHWDeviceType "Specified" TargetUnknown off ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.2.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 8 Array { Type "Cell" Dimension 1 Cell "TargetLang" PropName "DisabledProps" } Version "1.2.0" SystemTargetFile "dspic.tlc" GenCodeOnly off MakeCommand "make_rtw" GenerateMakefile on TemplateMakefile "dspic_pic30_gcc.tmf" PostCodeGenCommand "dsPIC_Compile()" Description "Embedded Target for Microchip dsPIC (real-t" "ime)" GenerateReport off SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ProcessScript "dspic_make_rtw_hook" ConfigAtBuild off IncludeHyperlinkInReport off LaunchReport off TargetLang "C" IncludeBusHierarchyInRTWFileBlockHierarchyMap off Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Version "1.2.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses off IncHierarchyInIds off MaxIdLength 31 PreserveName off PreserveNameWithParent off ShowEliminatedStatement off IncAutoGenComments off SimulinkDataObjDesc off SFDataObjDesc off IncDataTypeInIds off PrefixModelToSubsysFcnNames on MangleLength 1 CustomSymbolStrGlobalVar "$R$N$M" CustomSymbolStrType "$N$R$M" CustomSymbolStrField "$N$M" CustomSymbolStrFcn "$R$N$M$F" CustomSymbolStrBlkIO "rtb_$N$M" CustomSymbolStrTmpVar "$N$M" CustomSymbolStrMacro "$R$N$M" DefineNamingRule "None" ParamNamingRule "None" SignalNamingRule "None" InsertBlockDesc off SimulinkBlockComments on EnableCustomComments off InlinedPrmAccess "Literals" ReqsInCode off } Simulink.STFCustomTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 10 Array { Type "Cell" Dimension 5 Cell "GenerateSampleERTMain" Cell "MatFileLogging" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } Version "1.2.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeERTFirstTime on ERTFirstTimeCompliant on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off SystemTargetFile "dspic.tlc" DialogCategory 0 Array { Type "Handle" Dimension 1 Simulink.ERTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 11 Array { Type "Cell" Dimension 8 Cell "GenerateSampleERTMain" Cell "GenerateErtSFunction" Cell "MatFileLogging" Cell "GRTInterface" Cell "ERTCustomFileTemplate" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } Version "1.2.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeERTFirstTime on ERTFirstTimeCompliant on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off GenerateErtSFunction off GenerateASAP2 off ExtMode off ExtModeTransport 0 ExtModeStaticAlloc off ExtModeStaticAllocSize 1000000 ExtModeTesting off ExtModeMexFile "ext_comm" InlinedParameterPlacement "NonHierarchical" TargetOS "BareBoardExample" MultiInstanceErrorCode "Error" RateGroupingCode on RootIOFormat "Individual arguments" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off ERTSrcFileBannerTemplate "dsPIC_code_template.cgt" ERTHdrFileBannerTemplate "dsPIC_code_template.cgt" ERTDataSrcFileTemplate "dsPIC_code_template.cgt" ERTDataHdrFileTemplate "dsPIC_code_template.cgt" ERTCustomFileTemplate "dsPIC_main.tlc" InitialValueSource "Model" ModuleNamingRule "Unspecified" SignalDisplayLevel 10 ParamTuneLevel 10 GlobalDataDefinition "Auto" DataDefinitionFile "global.c" GlobalDataReference "Auto" DataReferenceFile "global.h" GRTInterface off EnableUserReplacementTypes off Array { Type "Struct" Dimension 1 MATStruct { double "" single "" int32 "" int16 "" int8 "" uint32 "" uint16 "" uint8 "" boolean "" int "" uint "" char "" } PropName "ReplacementTypes" } MemSecPackage "--- None ---" MemSecDataConstants "Default" MemSecDataIO "Default" MemSecDataInternal "Default" MemSecDataParameters "Default" MemSecFuncInitTerm "Default" MemSecFuncExecute "Default" } PropName "Components" } CustomProperty { DataType "string" Name "GMAKE_PLACE" Value "C:\\PROGRA~1\\MATLAB\\R2007b\\bin\\wi" "n32\\gmake" } CustomProperty { DataType "string" Name "OPTIM_GCC" Value "-mcpu=30F3012 -O3 -fschedule-insns -f" "schedule-insns2" } CustomProperty { DataType "string" Name "LDFLAGS" Value "-t --report-mem -Map ../untitled.map " "--heap 0 -cref" } CustomProperty { DataType "string" Name "LDPICTYPE" Value "-T C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\" "support\\gld\\p30f3012.gld" } CustomProperty { DataType "string" Name "LDLIBPIC" Value "C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib" "\\libpic30-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libp30F3012-coff.a " "C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libc-coff.a C:\\PROGRA~1\\MICROC~1\\MP" "LABC~1\\lib\\libm-coff.a" } CustomProperty { DataType "string" Name "PIC_INCLUDES" Value "-IC:\\PROGRA~1\\MICROC~1\\MPLABC~1\\i" "nclude" } CustomProperty { DataType "string" Name "PIC_REF" Value "30f3012" } } PropName "Components" } } PropName "Components" } Name "Configuration" SimulationMode "normal" CurrentDlgPage "Real-Time Workshop" } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" $ObjectID 1 } BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Constant } Block { BlockType Demux Outputs "4" DisplayOption "none" BusSelectionMode off } Block { BlockType EnablePort StatesWhenEnabling "held" ShowOutputPort off ZeroCross on } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParameterDataTypeMode "Same as input" ParameterDataType "sfix(16)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "2^0" OutDataTypeMode "Same as input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Ground } Block { BlockType Inport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" LatchByDelayingOutsideSignal off LatchByCopyingInsideSignal off Interpolate on } Block { BlockType Logic Operator "AND" Inputs "2" IconShape "rectangular" AllPortsSameDT on OutDataTypeMode "Logical (see Configuration Parameters: Optimiza" "tion)" LogicDataType "uint(8)" SampleTime "-1" } Block { BlockType Merge Inputs "2" InitialOutput "[]" AllowUnequalInputPortWidths off InputPortOffsets "[]" } Block { BlockType Mux Inputs "4" DisplayOption "none" UseBusObject off BusObject "BusObject" NonVirtualBus off } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType RelationalOperator Operator ">=" InputSameDT on LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza" "tion)" LogicDataType "uint(8)" ZeroCross on SampleTime "-1" } Block { BlockType "S-Function" FunctionName "system" SFunctionModules "''" PortCounts "[]" } Block { BlockType SignalSpecification Dimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" PermitHierarchicalResolution "All" TreatAsAtomicUnit off SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Switch Criteria "u2 >= Threshold" Threshold "0" InputSameDT on OutDataTypeMode "Inherit via internal rule" RndMeth "Floor" SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } Block { BlockType UnitDelay X0 "0" SampleTime "1" StateMustResolveToSignalObject off RTWStateStorageClass "Auto" } } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Arial" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "I2C_MultipleSequence_FinitStateMachine" Location [139, 194, 885, 535] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Reference Name "Bitwise\nOperator" Ports [1, 1] Position [190, 116, 230, 154] SourceBlock "simulink/Logic and Bit\nOperations/Bitwise\nOpe" "rator" SourceType "Bitwise Operator" logicop "AND" UseBitMask on NumInputPorts "1" BitMask "1" BitMaskRealWorld "Stored Integer" } Block { BlockType Reference Name "Compare\nTo Zero\nTest Parity" Ports [1, 1] Position [280, 120, 310, 150] SourceBlock "simulink/Logic and Bit\nOperations/Compare\nTo " "Zero" SourceType "Compare To Zero" ShowPortLabels on SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" relop "~=" LogicOutDataTypeMode "uint8" ZeroCross off } Block { BlockType Reference Name "Configure Model \nfor dsPIC" Ports [] Position [210, 29, 322, 85] ForegroundColor "blue" BackgroundColor "yellow" SourceBlock "dsPICdrivers/Simulink Configuration/Configure M" "odel \nfor dsPIC" SourceType "" } Block { BlockType Constant Name "Constant2" Position [95, 160, 120, 180] Value "1" VectorParams1D on SamplingMode "Sample based" OutDataTypeMode "uint16" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" FramePeriod "inf" } Block { BlockType Reference Name "Counter\nLimited\nMy Simple\nStateMachine" Ports [0, 1] Position [30, 120, 60, 150] SourceBlock "simulink/Sources/Counter\nLimited" SourceType "Counter Limited" ShowPortLabels on SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" uplimit "5" tsamp ".001" } Block { BlockType Demux Name "Demux" Ports [1, 4] Position [555, 149, 560, 221] BackgroundColor "black" ShowName off DisplayOption "bar" } Block { BlockType SubSystem Name "Enabled Subsystem\nRead 2 data from I2C" Ports [0, 1, 1] Position [305, 256, 375, 304] FontSize 10 TreatAsAtomicUnit on MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off MaskHideContents off System { Name "Enabled Subsystem\nRead 2 data from I2C" Location [281, 407, 644, 631] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType EnablePort Name "Enable" Ports [] Position [130, 20, 150, 40] } Block { BlockType Constant Name "Constant1" Position [140, 185, 165, 205] Value "0" VectorParams1D on SamplingMode "Sample based" OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" FramePeriod "inf" } Block { BlockType Constant Name "Constant2" Position [140, 150, 165, 170] Value "0" VectorParams1D on SamplingMode "Sample based" OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" FramePeriod "inf" } Block { BlockType Gain Name "Gain" Position [225, 105, 255, 135] ParameterDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "I2C Bus Master" Tag "dsPIC_I2C_Master" Ports [0, 2] Position [25, 80, 150, 140] List { ListType RTWdata NbrInput8Data "0" NbrOutput8Data "2" LengthListeCmdI2C "5" NumI2C "1" Enable "0" Adress10Bits "0" I2CBusFreq " 227" SlewRate "0" Disable "0" WaitAfterEnable "1" SMBUSThreshold "0" OutputErrorFlag "0" Initialisation "1" } FontSize 10 SourceBlock "dsPICdrivers/BUS I2C/I2C Bus Master" SourceType "I2C Master" NumI2C "1" Sequence "'S A100 R R P'" InitializeOnceOnly "When PIC is initialized (only once)" Enable off WaitAfterEnable "1" Disable off AdressNbrBits "7 bits" I2CBusFreq " 227" SlewRate off SMBUSThreshold off OutputErrorFlag off SampleTime "-1" OrderingInOutPopup "None" Info "Fscl = 10.8578 KHz" } Block { BlockType Mux Name "Mux" Ports [4, 1] Position [200, 86, 205, 149] ShowName off DisplayOption "bar" } Block { BlockType Outport Name "Out1" Position [275, 113, 305, 127] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "I2C Bus Master" SrcPort 1 DstBlock "Mux" DstPort 1 } Line { SrcBlock "I2C Bus Master" SrcPort 2 Points [15, 0; 0, -15] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Constant2" SrcPort 1 Points [5, 0; 0, -35] DstBlock "Mux" DstPort 3 } Line { SrcBlock "Constant1" SrcPort 1 Points [15, 0] DstBlock "Mux" DstPort 4 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out1" DstPort 1 } Annotation { Name "Executed for FSM = 1 ; 3 and 5" Position [255, 30] UseDisplayTextAsClickCallback off } } } Block { BlockType SubSystem Name "Enabled Subsystem\nRead 4 data from I2C" Ports [0, 1, 1] Position [385, 152, 450, 198] FontSize 10 TreatAsAtomicUnit on MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off MaskHideContents off System { Name "Enabled Subsystem\nRead 4 data from I2C" Location [514, 400, 875, 578] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType EnablePort Name "Enable" Ports [] Position [130, 20, 150, 40] } Block { BlockType Gain Name "Gain" Position [225, 105, 255, 135] ParameterDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "I2C Bus Master" Tag "dsPIC_I2C_Master" Ports [0, 4] Position [25, 88, 150, 147] List { ListType RTWdata NbrInput8Data "0" NbrOutput8Data "4" LengthListeCmdI2C "7" NumI2C "1" Enable "0" Adress10Bits "0" I2CBusFreq " 227" SlewRate "0" Disable "0" WaitAfterEnable "1" SMBUSThreshold "0" OutputErrorFlag "0" Initialisation "1" } FontSize 10 SourceBlock "dsPICdrivers/BUS I2C/I2C Bus Master" SourceType "I2C Master" NumI2C "1" Sequence "'S A100 R R R R P'" InitializeOnceOnly "When PIC is initialized (only once)" Enable off WaitAfterEnable "1" Disable off AdressNbrBits "7 bits" I2CBusFreq " 227" SlewRate off SMBUSThreshold off OutputErrorFlag off SampleTime "-1" OrderingInOutPopup "None" Info "Fscl = 10.8578 KHz" } Block { BlockType Mux Name "Mux" Ports [4, 1] Position [200, 86, 205, 149] ShowName off DisplayOption "bar" } Block { BlockType Outport Name "Out1" Position [275, 113, 305, 127] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "I2C Bus Master" SrcPort 1 Points [0, 0] DstBlock "Mux" DstPort 1 } Line { SrcBlock "I2C Bus Master" SrcPort 2 Points [0, 0] DstBlock "Mux" DstPort 2 } Line { SrcBlock "I2C Bus Master" SrcPort 3 Points [0, 0] DstBlock "Mux" DstPort 3 } Line { SrcBlock "I2C Bus Master" SrcPort 4 Points [0, 0] DstBlock "Mux" DstPort 4 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out1" DstPort 1 } Annotation { Name "Executed for FSM = 1 ; 3 and 5" Position [255, 30] UseDisplayTextAsClickCallback off } } } Block { BlockType Logic Name "Logical\nOperator" Ports [1, 1] Position [324, 205, 356, 235] Orientation "down" NamePlacement "alternate" Operator "NOT" AllPortsSameDT off OutDataTypeMode "Boolean" } Block { BlockType Reference Name "Master" Tag "dsPIC_MASTER" Ports [] Position [40, 32, 149, 83] BackgroundColor "lightBlue" Priority "1" List { ListType RTWdata NumBusyPort "-1" } SourceBlock "dsPICdrivers/Master" SourceType "Master" TimeStepType "Timer1" picType "30f3012" fcy "2.5e6" Quartz_33f "5e6" PLLActive_33f off fcyDesired_33f "0" tmr1 "[1 2499 0]" tmr1Info "Time Step : 0.001 ; Error : 0% PR1=2499" tmr2345 "[0 0]" tmr2345cfg "[-1 -1]" IOautoConf on typePort "[ 0 0 0 0 0 0 0 0 0 0 0 0" " 0 0 0 0 0 0 0 0 20 20 0 0 0 0 0 0 0 0 0 " " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 4 0 0 0 " " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " " 0 0 0 0 ]" TRIS "[ 65535 65535 65535 65535 65535 65535 655" "35 ]" ADPCFG "0" MasterBusyPort "None" MasterOverloadPort "None" FOSC "HS" TempProtection_33f "TEMP_ON" FPBOR "PBOR_OFF" PWRT "PWRT_OFF" MCLR "MCLR_DIS" PowerSave off } Block { BlockType Merge Name "Merge" Ports [2, 1] Position [485, 165, 525, 205] FontSize 10 } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [135, 125, 155, 145] ShowName off IconShape "round" Inputs "|++" InputSameDT off OutDataTypeMode "uint16" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "TX Output Multiplexed\nfor Matlab / Labview" Tag "dsPIC_TX_Multiplexed" Ports [4] Position [605, 142, 740, 228] Priority "5" FontSize 10 SourceBlock "dsPICdrivers/Serial PORT/TX Output Multiplexed" "\nfor Matlab // Labview" SourceType "send structured data frame to Matlab / Labview" UART "1" CleverSpreadingChk on CleverSpreading "1" CHANNEL "[0 1 2 3]" BUFFERSIZE "16" CHANNELBLOCKED "[]" CHANNELBLOCKED_BITEWISE "0" Status "OK" } Block { BlockType Reference Name "UART Configuration" Tag "dsPIC_config_UART" Ports [] Position [620, 274, 721, 304] BackgroundColor "lightBlue" Priority "2" FontSize 10 SourceBlock "dsPICdrivers/Serial PORT/UART Configuration" SourceType "Configure UART" UART "1" proposed_BAUD "38400" ALT_TX_RX on TXInterruptPri "1" InterruptTxWhen "on TxBUF becoming empty" TXEN on RXInterruptPri "1" BAUD "38400" UxBRG "3" Info "UxBRG = 3 || Real Baud : 39063 || % error" " : 1.7253 || max 3.9063 Bytes / Step" RealBaud "0" } Line { SrcBlock "Counter\nLimited\nMy Simple\nStateMachine" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Constant2" SrcPort 1 Points [20, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 Points [15, 0] DstBlock "Bitwise\nOperator" DstPort 1 } Line { SrcBlock "Bitwise\nOperator" SrcPort 1 DstBlock "Compare\nTo Zero\nTest Parity" DstPort 1 } Line { SrcBlock "Compare\nTo Zero\nTest Parity" SrcPort 1 Points [0, 0; 25, 0] Branch { Points [75, 0] DstBlock "Enabled Subsystem\nRead 4 data from I2C" DstPort enable } Branch { DstBlock "Logical\nOperator" DstPort 1 } } Line { SrcBlock "Logical\nOperator" SrcPort 1 DstBlock "Enabled Subsystem\nRead 2 data from I2C" DstPort enable } Line { SrcBlock "Enabled Subsystem\nRead 4 data from I2C" SrcPort 1 DstBlock "Merge" DstPort 1 } Line { SrcBlock "Enabled Subsystem\nRead 2 data from I2C" SrcPort 1 Points [90, 0] DstBlock "Merge" DstPort 2 } Line { SrcBlock "Merge" SrcPort 1 DstBlock "Demux" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 Points [25, 0] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 1 } Line { SrcBlock "Demux" SrcPort 2 Points [25, 0] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 2 } Line { SrcBlock "Demux" SrcPort 3 Points [25, 0] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 3 } Line { SrcBlock "Demux" SrcPort 4 Points [25, 0] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 4 } Annotation { Name "Configure the Model for dsPIC Target (dbl click" " on the yellow block). \nThen, Compile using the incremental build icon \n(se" "cond icon on right of the simulation mode (Normal))" Position [512, 58] UseDisplayTextAsClickCallback off } } }