MCU Overload Block Icon
The MCU OVERLOAD block detects when scheduled tasks miss their deadlines and provides diagnostic information for identifying the cause of overload conditions.

Output Signals

OutputData TypeDescription
Overload_Flagboolean1 = Task missed deadline, 0 = Normal operation
Overload_TaskIDuint8ID of task that caused overload (if known)
Overload_Countuint32Cumulative count of overload events

Overload Conditions

ConditionDetection MethodResponse
Task execution exceeds periodCompare execution time vs sample timeSet flag, log task ID
Queue overflowTask triggered while already queuedSet flag, increment counter
Preemption cascadeMultiple nested preemptionsSet flag, identify root task

Example Usage

% Overload detection and safe shutdown

Overload_Flag → LED (visual warning)
Overload_Flag → Switch
if (1): Enter safe mode
                        Disable non-critical tasks
                        Log diagnostics

% Recovery strategy:
if Overload_Count > 10
    % Persistent overload - reduce functionality
    Disable_MotorControl();
    Enable_SafeShutdown();
end

Debugging with Overload Block

% Analysis workflow:
1. Connect outputs to scopes/displays
2. Run model and observe overload events
3. Identify TaskID causing overload
4. Use MCHP_Tasks_State to see task interactions
5. Optimize identified task or reduce sample rate

% Common overload patterns:
TaskID=1, Count growing → Base rate task too slow
TaskID varies randomly → Interrupt storms
TaskID=0 (idle) → Should never happen (check config)

See Also

  • [MCHP_MCU_LOAD] - CPU utilization monitoring
  • [MCHP_Tasks_State] - Task state visibility
  • [MCHP_Scheduler_Options] - Overload behavior config