Model { Name dsPIC_32MX460F512L_Explorer16_HyperSampling Version 6.4 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.290" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "windows-1252" SaveDefaultBlockParams on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" Created "Thu Nov 02 00:36:52 2006" Creator "Lubin" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Administrateur" ModifiedDateFormat "%" LastModifiedDate "Sun Mar 01 17:22:03 2009" ModelVersionFormat "1.%" ConfigurationManager "None" SampleTimeColors on LibraryLinkDisplay "none" WideLines on ShowLineDimensions on ShowPortDataTypes on ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off 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 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 ".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 on InlineInvariantSignals on OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast off ExpressionFolding on FoldNonRolledExpr on LocalBlockOutputs on RollThreshold 5 SystemCodeInlineAuto off StateBitsets on DataBitsets on UseTempVars on ZeroExternalMemoryAtStartup off ZeroInternalMemoryAtStartup off InitFltsAndDblsToZero off 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" TimeAdjustmentMsg "none" 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" UnknownTsInhSupMsg "warning" ModelReferenceDataLoggingMessage "warning" ModelReferenceSymbolNameMessage "warning" ModelReferenceExtraNoncontSigs "error" StrictBusMsg "Warning" ModelReferenceSimTargetVerbose off } Simulink.HardwareCC { $ObjectID 6 Version "1.2.0" Array { Type "Cell" Dimension 2 Cell "ProdHWDeviceType" Cell "ProdEqTarget" PropName "DisabledProps" } ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 32 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "Unspecified" ProdWordSize 32 ProdShiftRightIntArith on ProdHWDeviceType "32-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 "32-bit Generic" 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 9 Version "1.2.0" Array { Type "Cell" Dimension 1 Cell "TargetLang" PropName "DisabledProps" } SystemTargetFile "pic32.tlc" GenCodeOnly off MakeCommand "make_rtw" GenerateMakefile on TemplateMakefile "pic32_gcc.tmf" PostCodeGenCommand "dsPIC_Compile()" Description "Embedded Target for Microchip dsPIC (real-time)" GenerateReport on SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ProcessScript "pic32_make_rtw_hook" ConfigAtBuild off IncludeHyperlinkInReport on LaunchReport on TargetLang "C" IncludeBusHierarchyInRTWFileBlockHierarchyMap off IncludeERTFirstTime off Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 10 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 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 11 Version "1.2.0" Array { Type "Cell" Dimension 5 Cell "GenerateSampleERTMain" Cell "MatFileLogging" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off AutosarCompliant off SystemTargetFile "pic32.tlc" DialogCategory 0 Array { Type "Handle" Dimension 1 Simulink.ERTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 12 Version "1.5.1" Array { Type "Cell" Dimension 8 Cell "GenerateSampleERTMain" Cell "GenerateErtSFunction" Cell "MatFileLogging" Cell "GRTInterface" Cell "ERTCustomFileTemplate" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off AutosarCompliant off GenerateErtSFunction off GenerateASAP2 off ExtMode off ExtModeTransport 0 ExtModeStaticAlloc off ExtModeStaticAllocSize 1000000 ExtModeTesting off ExtModeMexFile "noextcomm" ExtModeIntrfLevel "Level1" 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" ModuleNamingRule "Unspecified" SignalDisplayLevel 10 ParamTuneLevel 10 GlobalDataDefinition "Auto" DataDefinitionFile "global.c" GlobalDataReference "Auto" DataReferenceFile "global.h" GRTInterface off PreserveExpressionOrder off PreserveIfCondition 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\\R2008b\\bin\\win32\\gmake" } CustomProperty { DataType "string" Name "OPTIM_GCC" Value "-mprocessor=32MX460F512L -O3 -fschedule-insns -fschedule-insns2" } CustomProperty { DataType "string" Name "LDFLAGS" Value "-t --report-mem -cref" } CustomProperty { DataType "string" Name "LDLIBPIC" Value "C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\pic32mx\\lib\\speed\\libc.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\pic32mx\\l" "ib\\speed\\libmchp_peripheral_32MX460F512L.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\pic32mx\\lib\\speed\\libm.a C:\\PROGR" "A~1\\MICROC~1\\MPLABC~1\\pic32mx\\lib\\speed\\libm.a" } CustomProperty { DataType "string" Name "PIC_INCLUDES" Value " -IC:\\PROGRA~1\\MICROC~1\\MPLABC~1\\pic32mx\\include -IC:\\PROGRA~1\\MICROC~1\\MPLABC~1\\pic32mx\\includ" "e\\peripheral" } CustomProperty { DataType "string" Name "PIC_REF" Value "32MX460F512L" } CustomProperty { DataType "string" Name "GCCPATH" Value "''" } } PropName "Components" } } PropName "Components" } Name "Configuration" ExtraOptions "-aGenerateTraceInfo=1 -aIgnoreTestpoints=0 " CurrentDlgPage "Solver" SimulationMode "normal" } 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 } 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" } BlockParameterDefaults { Block { BlockType Constant Value "1" VectorParams1D on SamplingMode "Sample based" OutDataTypeMode "Inherit from 'Constant value'" OutDataType "fixdt(1,16,0)" ConRadixGroup "Use specified scaling" OutScaling "[]" SampleTime "inf" FramePeriod "inf" } Block { BlockType DataTypeConversion OutDataTypeMode "Inherit via back propagation" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off ConvertRealWorld "Real World Value (RWV)" RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } } System { Name dsPIC_32MX460F512L_Explorer16_HyperSampling Location [286, 274, 994, 750] 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 Constant Name "(Low) Duty cycle\n(50 us)" Position [305, 337, 400, 363] Value "OCmax/2-1" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "ADC Input" Tag "dsPIC_ADC" Ports [0, 1] Position [55, 163, 150, 197] Priority "5" List { ListType RTWdata DMAChannel "0" } SourceBlock "dsPICdrivers/Peripheral I//O/ADC Input" SourceType "dsPIC : ADC10" ADC_TYPE "10 bits" ADC_MODE "Continuous sampling & get last channel value" NbrSampleStep "1" VoltRefpopup "AVdd - AVss" OutFormatBitspopup "0000 00dd dddd dddd : Integer" InterruptPriority "6" ANCHANNELS "5" MaxName "ANmax = 1024" Rin "5e6" ADCS "29" SAMC "31" Temperature "25" DMAChannel "0" SampleTime ".001" Status "OK | Tsmp=4.844e-006 | T/Channel=6.719e-006 | Tall=6.719e-006" SSRC "Timer3 (OC_HW PWM)" Port { PortNumber 1 Name "Sampled value" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Reference Name "Blinking LED at 2Hz" Tag "dsPIC_Digital_Output" Ports [1] Position [560, 404, 675, 446] Priority "5" SourceBlock "dsPICdrivers/Digital I//O/Digital Output Write" SourceType "" PORT "A" Simultaneous off OrderingInOutPopup "None" } Block { BlockType Reference Name "Configure Model \nfor dsPIC1" Ports [] Position [160, 69, 272, 125] BackgroundColor "yellow" SourceBlock "dsPICdrivers/Simulink Configuration/Configure Model \nfor dsPIC" SourceType "" } Block { BlockType Constant Name "Constant1" Position [75, 239, 125, 271] Value "OCmax" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Counter\nLimited" Ports [0, 1] Position [350, 410, 380, 440] SourceBlock "simulink/Sources/Counter\nLimited" SourceType "Counter Limited" ShowPortLabels "on" SystemSampleTime "-1" uplimit "1" tsamp ".25" } Block { BlockType DataTypeConversion Name "Data Type Conversion3" Position [430, 408, 505, 442] OutDataTypeMode "boolean" OutDataType "sfix(16)" OutScaling "2^0" RndMeth "Floor" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "Master" Tag "dsPIC_MASTER" Ports [] Position [35, 72, 144, 123] BackgroundColor "lightBlue" Priority "1" List { ListType RTWdata NumBusyPort "-1" } SourceBlock "dsPICdrivers/Master" SourceType "Master" TimeStepType "Timer1" picType "32MX460F512L" fcy "96000000" Quartz_33f "8e6 " PLLActive_33f on fcyDesired_33f "96e6" tmr1 "[8 11999 0]" tmr1Info "Time Step : 0.001 ; Error : 0% PR1=11999" tmr2345 "[0 1 0 0]" tmr2345cfg "[-1 -1 -1 -1]" IOautoConf on typePort "[ 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 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 24 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 4 5 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 "[ 65534 65535 65535 65534 65535 65535 65535 ]" ADPCFG "0" MasterBusyPort "None" MasterOverloadPort "None" FOSC "Quartz (XT - HS)" ClockSwitchMonitor "Both disabled" TempProtection_33f "TEMP_ON" FPBOR "" PWRT "disable" MCLR "" PowerSave off OverrideFcy off NewFcy "1e6" PR2345 "[65535 9599 65535 65535]" } Block { BlockType Reference Name "Offset Sampling\nfrom 0 to OCmax" Ports [0, 1] Position [85, 295, 115, 325] SourceBlock "simulink/Sources/Counter\nLimited" SourceType "Counter Limited" ShowPortLabels "on" SystemSampleTime "-1" uplimit "OCmax" tsamp ".001" } Block { BlockType Reference Name "Output Compare HW\nPeriode is 100us" Tag "dsPIC_OC_HW_out" Ports [2] Position [510, 261, 660, 334] Priority "5" SourceBlock "dsPICdrivers/Peripheral I//O/Output Compare HW" SourceType "Output Capture Peripheral - Hardware only (without interrupt) " OC_Mode "PWM Time Set-Reset (glitch possible)" Timer "3" CHANNEL "[1 ] " Channel_UP_Down_Periode "[16]" PeriodeInput off MaxChannel "0.0001" MaxName "' OCmax '" Precision "[13.2288]" Status "OK" SafeMarge "[0]" PortLetter "[68]" PortNumber "[0]" MaxValues "[9599]" NPORTS "2" } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [450, 305, 470, 325] ShowName off IconShape "round" Inputs "|++" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [165, 259, 185, 301] ShowName off Inputs "+-" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off Port { PortNumber 1 Name "Sampling Offset within PWM" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Reference Name "TX Output Multiplexed\nfor Matlab / Labview" Tag "dsPIC_TX_Multiplexed" Ports [2] Position [305, 169, 445, 211] Priority "5" SourceBlock "dsPICdrivers/Serial PORT/TX Output Multiplexed\nfor Matlab // Labview" SourceType "send structured data frame to Matlab / Labview" UART "2" CleverSpreadingChk on CleverSpreading "1" CHANNEL "[0 1]" CHANNELBLOCKED "[]" CHANNELBLOCKED_BITEWISE "0" Status "OK" } Block { BlockType Reference Name "UART Configuration" Tag "dsPIC_config_UART" Ports [] Position [520, 169, 621, 199] BackgroundColor "lightBlue" Priority "2" List { ListType RTWdata RxBufferSize "32" } SourceBlock "dsPICdrivers/Serial PORT/UART Configuration" SourceType "Configure UART" UART "2" proposed_BAUD "115200" ALT_TX_RX on InterruptTxWhen "When Transmit Buffer is empty" TXInterruptPri "1" TxBufferSize "32" TXEN on InterruptRxWhen "When Receive Buffer is full (contain 4 characters)" RXInterruptPri "2" RxBufferSize "32" BAUD "115200" UxBRG "51" Info "UxBRG = 51 || Real Baud : 115385 || % error : 0.16026 || max 11.5385 Bytes / Step" RealBaud "0" } Line { SrcBlock "Counter\nLimited" SrcPort 1 DstBlock "Data Type Conversion3" DstPort 1 } Line { Name "Sampled value" Labels [0, 0] SrcBlock "ADC Input" SrcPort 1 DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 1 } Line { SrcBlock "(Low) Duty cycle\n(50 us)" SrcPort 1 Points [55, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Output Compare HW\nPeriode is 100us" DstPort 2 } Line { Name "Sampling Offset within PWM" Labels [0, 0] SrcBlock "Sum1" SrcPort 1 Points [85, 0] Branch { Points [125, 0] Branch { DstBlock "Output Compare HW\nPeriode is 100us" DstPort 1 } Branch { Points [0, 35] DstBlock "Sum" DstPort 1 } } Branch { Points [0, -80] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 2 } } Line { SrcBlock "Constant1" SrcPort 1 Points [20, 0] DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Offset Sampling\nfrom 0 to OCmax" SrcPort 1 Points [30, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Data Type Conversion3" SrcPort 1 DstBlock "Blinking LED at 2Hz" DstPort 1 } Annotation { Name "Demo (Explorer 16 Board) - Updated 13/02/2009" Position [351, 26] BackgroundColor "lightBlue" FontSize 14 } Annotation { Position [241, 101] } Annotation { Position [194, 97] } Annotation { Name "Configure the Model for dsPIC Target (dbl click on the yellow block). \nThen, Compile using the inc" "remental build icon \n(second icon on right of the simulation mode (Normal))" Position [467, 98] } Annotation { Name "OC (HW) Use Timer 3\nADC is synchronised with TMR3\nADC start sampling and converting when TMR3 = O" "Cmax (=PR3)" Position [158, 398] } } }