The dsPIC33CH family integrates two CPU cores on one device โ a Main core and a Secondary core โ that run independently and exchange data through the hardware Main-Secondary Interface (MSI). The MPLAB Blockset supports this architecture with two Simulink models (one per core) plus two dedicated blocks.
Dual-core applies only to dsPIC33CH devices. On single-core parts the MSI peripheral is absent and these blocks report not available.
โโโโโโโโโโโโโโโโ dsPIC33CHxxxMP5xx (one chip) โโโโโโโโโโโโโโโโ
โ โ
โ MAIN core โโโโโโโ MSI mailboxes / protocols โโโโโโโบ SECONDARY core โ
โ (master model) (secondary model) โ
โ - comms, supervision - real-time PWM loop โ
โ - high-level control - high-speed ADC โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Each core is programmed from its own Simulink model. The Main project links the Secondary core’s compiled image so a single build produces one device firmware.
| Block | Model it goes in | Role |
|---|---|---|
| MAIN-SECONDARY INTERFACE (MSI) | both | exchanges data between the cores via mailboxes |
| SECONDARY CORE | Main model | links the secondary core’s .s image into the Main project |
The secondary device part number carries an S1 suffix:
| Core | Example chip in its Master block |
|---|---|
| Main | dsPIC33CH512MP508 |
| Secondary | dsPIC33CH512MP508**S1** |
Both models target the same physical device โ the suffix selects which core the model compiles for.
โฆS1
secondary part (e.g. dsPIC33CH512MP508S1)..s file).dsPIC33CH512MP508, no suffix)..s
image from step 1 (absolute or relative path).Build the Main model with Build, Deploy & Start. The build links the
secondary image (via the SECONDARY CORE block, which sets the model’s
SlaveModelReference) so a single programming operation flashes both
cores.
The MSI block moves named data items between the cores:
Define matching data items on the MSI block in both models โ the Main MSI sends what the Secondary MSI receives, and vice-versa.
Output pins must be driven by exactly one core. Input pins may be read by both cores simultaneously.
When allocating peripherals across the two models, give each output-driving peripheral (PWM, digital out, UART Tx, โฆ) to a single core. Use Port Info on each model to verify the pin map and catch conflicts before building.
| Concern | Core |
|---|---|
| High-speed ADC sampling + PWM current loop | Secondary (deterministic, isolated from comms jitter) |
| Speed/position outer loop, state machine | Main or Secondary, per design |
| UART / CAN telemetry, External Mode, supervision | Main |
| Reference setpoints โ Secondary | Main โ MSI โ Secondary |
| Measured currents / status โ Main | Secondary โ MSI โ Main |
This keeps the time-critical inner loop on a core that is never stalled by communication or housekeeping running on the other core.