MSI Block Icon
The MSI block configures the Master Secondary Interface (MSI) for inter-core communication in dual-core dsPIC33CH devices, enabling data exchange between master and secondary cores.

Communication Methods

MethodSpeedSizeDirectionUse Case
MailboxesFast16 words × 16 boxesBidirectionalControl parameters, flags
FIFOMediumConfigurable bufferBidirectionalData streaming, logs
Protocol InterruptsImmediateN/ABidirectionalEvent notification, sync

Block Parameters

ParameterDescriptionOptions
Communication TypeSelect MSI communication methodMailbox / FIFO / Protocol Interrupt
Mailbox NumberMailbox index (0-15)0 to 15
DirectionData transfer directionMaster→Secondary
FIFO SizeFIFO buffer size16 to 256 words
Interrupt EnableGenerate interrupt on data availableon / off

Example Dual-Core Communication

% Master Core (33CH128MP508):
MSI_Mailbox0_Write:
  - Write speed reference to Mailbox 0
  - Trigger secondary interrupt

MSI_Mailbox1_Read:
  - Read current measurement from Mailbox 1
  - Update speed controller

% Secondary Core (33CH128MP508S1):
MSI_Mailbox0_Read:
  - Read speed reference from Mailbox 0
  - Execute in interrupt handler

MSI_Mailbox1_Write:
  - Write current measurement to Mailbox 1
  - Trigger master interrupt

Mailbox vs FIFO Selection

ScenarioRecommendedReason
Control loop parametersMailboxFast, deterministic, 16 words enough
Sensor data streamingFIFOBuffered, handles variable rates
Event flags, statusMailboxImmediate, small data
Data loggingFIFOLarge buffer, non-critical timing
Synchronization signalsProtocol InterruptNo data, just notification

Synchronization Example

% Master triggers secondary task execution

Master:
  compute_reference();
  MSI_SendProtocolInterrupt(SECONDARY_START);

Secondary (Interrupt Handler):
  if (protocol_interrupt == SECONDARY_START)
    execute_fast_control_loop();
    MSI_SendProtocolInterrupt(TASK_COMPLETE);
  end

% Result: Precise task synchronization between cores

See Also

  • [MCHP_SECONDARY_CORE] - Secondary core configuration
  • [MCHP_Master] - Dual-core device selection