| Variant | Module Type | ADC Cores | Max Channels per Core | Example Device |
|---|---|---|---|---|
| Perseus (STX04) | DOS_03459_adc_pc_ctrl_upb_v2 | 2 (ADC1, ADC2) | 20 each | 33AK128MC106 |
| Pegasus (STX32) | DOS_02976_adc_12b_upb_v2 | 5 (ADC1-5) | 16 each | 33AK512MPS512 |
| Blue Ridge (STX33) | DOS_05972_adc_12b_upb_v3_itc | 3 (ADC1-3) | 12 each | 33AK256MPS306 |
| Serpens (STX21) | DOS_05972_adc_12b_upb_v3_adc | 2 (ADC1, ADC2) | 20, 39 | 33AKV512GM510 |
| Application | Recommended Strategy | Key Configuration |
|---|---|---|
| 3-Phase FOC Motor Control | β PWM β ADC β Task | ADC1_seq0: AN0,AN1,AN2Trigger: 'PWM1 Special Event'SEVTCMP: 0 (PWM valley) |
| Single-Shunt FOC | Multiple Triggers/Period | seq0-2: AN0 (shunt)Triggers: TRIG1, SEVTCMP, TRIG23 samples/PWM cycle |
| Dual Motor Control | Independent ADC cores | ADC1: Motor1 (SCCP1 trigger)ADC2: Motor2 (SCCP5 trigger)Parallel sampling |
| Multi-Channel DAQ | Timer β ADC β Task | 18 channels across seq0-2Trigger: SCCP1Simultaneous acquisition |
| DC-DC Converter | PWM β ADC β Task | seq0: Vout, IoutTrigger: PWM Special EventSample during FET ON |
β Most Common: Use PWM Special Event trigger at valley (SEVTCMP: 0) for center-aligned motor control PWM
Resolution Fixed 12-bit high-precision Sequencing 6 sequences Γ 6 conversions per sequence Flexibility Any channel to any sequence slot Synchronization SCCP/SSC timer trigger integration Multiple Cores 2-5 independent ADC cores High Speed Optimized for FOC motor control
| Parameter | Description | Options |
|---|---|---|
| ADC1_Enable - ADC5_Enable | Enable individual ADC cores | on / off (availability depends on chip variant) |
| Parameter | Description | Details |
|---|---|---|
| ADCx_seq0 | Channel for sequence 0, conversion 0 | Dropdown with available ANx channels (e.g., “Not Used”, “AN0”, “AN1”, …) |
| ADCx_seq0_1 to ADCx_seq0_5 | Additional conversions in sequence 0 | Up to 6 conversions total per sequence |
| ADCx_seq1 through ADCx_seq5 | Additional sequences with 6 conversions each | Complete flexibility in channel assignment |
| Parameter | Description | Available Triggers |
|---|---|---|
| ADCx_seq0_Trig | Trigger source for sequence 0 | β’ Manual (software) |
| ADCx_seq1_Trig - ADCx_seq5_Trig | Triggers for sequences 1-5 |
Proper ADC trigger configuration is critical for motor control and power conversion. The dsPIC33A ADC supports multiple synchronization strategies, each optimized for different control requirements. Understanding when and how to trigger ADC conversions directly impacts control accuracy and performance.
The MCHP_ADC_HS_12b block supports four fundamental synchronization strategies:

ADC Configuration:
ADCx_seq0_Trig = 'SCCP1' or 'SSC1'When to Use:
Limitations:
ADC Configuration:
Key Benefit: Zero latency - control task always uses the most recent ADC data (no stale samples).
Configuration Example:
% ADC Block Configuration:
ADC1_Enable = 'on';
ADC1_seq0 = 'AN0'; % First channel
ADC1_seq0_1 = 'AN1'; % Second channel
ADC1_seq0_Trig = 'SCCP1'; % Timer trigger
% SCCP1 Timer Block:
Period = 1/10e3; % 10 kHz sampling rate
% Scheduler Configuration:
% Set control task to be triggered by ADC1 interrupt
% Task sample time = 'Inherited' (follows ADC trigger rate)
Best For:
β This is the STANDARD approach for motor control and power conversion applications.
Key Benefits:
ADC Configuration Example (3-Phase FOC):
% PWM Block Configuration (MCHP_PWM_HS_FEP):
PWM_Mode = 'Center-aligned';
PWM_Frequency = 20e3; % 20 kHz
SEVTCMP = 0; % Trigger at PWM valley (center point)
% ADC Block Configuration:
ADC1_Enable = 'on';
% Phase current sensing (triggered by PWM valley):
ADC1_seq0 = 'AN0'; % Phase A current (Iu)
ADC1_seq0_1 = 'AN1'; % Phase B current (Iv)
ADC1_seq0_2 = 'AN2'; % Phase C current (Iw)
ADC1_seq0_Trig = 'PWM1 Special Event'; % PWM valley trigger
% DC bus voltage (same trigger):
ADC1_seq1 = 'AN5'; % DC bus voltage
ADC1_seq1_Trig = 'PWM1 Special Event'; % Same instant as currents
% Result: ADC samples all signals at PWM valley (20 kHz rate)
% Control task triggered by ADC1 interrupt completion
Why Sample at PWM Valley? In center-aligned PWM for 3-phase motor control, the valley (center) is when all three low-side FETs are simultaneously ON. This is the only time when phase currents flow through shunt resistors, enabling accurate current measurement. Sampling at any other time results in incorrect or zero current readings. Trigger Sources for dsPIC33A:
| PWM Block | Trigger Configuration | ADC Trigger Selection |
|---|---|---|
| MCHP_PWM_HS_FEP | Set | SEVTCMP |
| MCHP_MCPWM | Set | TRIG1/2/3 |
Use Case: High-performance control requiring multiple measurements per PWM cycle.
Key Applications:
ADC Configuration Example (Single-Shunt FOC):
% PWM Block (MCHP_PWM_HS_FEP):
PWM_Mode = 'Center-aligned';
TRIG1 = Period * 0.4; % Before valley
SEVTCMP = 0; % Valley
TRIG2 = Period * 0.6; % After valley
% ADC Block Configuration:
ADC1_Enable = 'on';
% Sequence 0: First current sample (sector 1)
ADC1_seq0 = 'AN0'; % Shunt current
ADC1_seq0_Trig = 'PWM1 TRIG1';
% Sequence 1: Second current sample (sector 2)
ADC1_seq1 = 'AN0'; % Same shunt (different sector)
ADC1_seq1_Trig = 'PWM1 Special Event'; % Valley
% Sequence 2: Third current sample (sector 3)
ADC1_seq2 = 'AN0'; % Same shunt (different sector)
ADC1_seq2_Trig = 'PWM1 TRIG2';
% Result: 3 current measurements per PWM period
% Reconstruct 3-phase currents from single shunt
Advantages:
Considerations:
| Application | Recommended Strategy | ADC Configuration |
|---|---|---|
| 3-Phase FOC Motor Control | PWM β ADC β Task (Strategy 3) | β’ seq0: 3 phase currents |
| Single-Shunt FOC | Multiple Triggers (Strategy 4) | β’ seq0-2: Shunt current at 3 sector transitions |
| BLDC Motor Control | PWM β ADC β Task (Strategy 3) | β’ seq0: DC bus current |
| PFC Boost Converter | PWM β ADC β Task (Strategy 3) | β’ seq0: Input current, output voltage |
| DC-DC Buck/Boost | PWM β ADC β Task (Strategy 3) | β’ seq0: Output voltage/current |
| Multi-Axis Motion Control | Multiple independent PWMβADC chains | β’ ADC1: Motor 1 (PWM1 trigger) |
| General Data Acquisition | Timer β ADC β Task (Strategy 2) | β’ Multiple sequences at fixed rate |
| Problem | Likely Cause | ADC Configuration Fix |
|---|---|---|
| Phase currents read as zero | ADC not triggered at PWM valley | β’ Verify: |
| Noisy ADC readings | Sampling during switching transients | β’ Change trigger to PWM valley or after settling |
| No ADC trigger available in dropdown | PWM block not configured with triggers | β’ In PWM block: Enable |
| Control task not synchronized with ADC | Task triggered by timer, not ADC interrupt | β’ In Scheduler: Set task trigger to ADC interrupt |
| Missing ADC samples | ADC overrun (next trigger before conversion complete) | β’ Reduce number of conversions per sequence |
| Inconsistent trigger timing | Multiple sequences with overlapping triggers | β’ Verify ADC conversion time + margin between triggers |
SEVTCMP = 0'PWM1 Special Event'The block supports 1 output datatype representation:
| Output Type | Range | Description |
|---|---|---|
| uint16 | 0 to 4095 | 12-bit right-aligned raw ADC counts |
Integer values transferred directly from ADC data registersβno runtime computation. Users handle conversion to physical units (voltage, current, temperature).
Scaling formula: Voltage = ADC_counts Γ (VREF / 4095)
Hardware Considerations: dsPIC33A devices have hardware FPUβfloat scaling is processed efficiently.
The block creates output ports automatically based on sequence configuration:
Configuration:
Motor 1 (ADC1):
Configuration:
| Register | Purpose | Configuration |
|---|---|---|
| ADCxCON | ADC control | Enable, clock source, resolution |
| ADCxSEQCON | Sequence control | Sequence enable, length, trigger assignment |
| ADCxCHANNEL[0-5] | Channel assignment for each sequence conversion | ANx channel selection per conversion slot |
| ADCxTRIG | Trigger selection | SCCP/SSC timer or external source |
| ADCxDATA[0-5] | Conversion results | 12-bit data registers (one per conversion in sequence) |
ADC Blocks Overview | [Block Reference](../