# microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform architecture

> Architecture diagram of the GitHub repository microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform
- Repository: https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform

## Overview

This repository is firmware for a dsPIC33C digitally controlled Dual Active Bridge converter, supporting forward and reverse power flow. The principal workflow is Power Board Visualizer commands and references reaching the controller, which regulates the converter using sampled feedback and PWM control; fault handling and telemetry support that operation. The README documents GUI control over CANFD, while excerpts show control-loop calculations and UART protocol handling. Many runtime files are unsampled, so edges that their contents would need to establish are omitted.

Main entry points: [`dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c`](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c) (Control Loop ISR), [`dspic33ck-dab.X/sources/pwrctrl/dcdt/pwrctrl_dcdt.c`](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/dcdt/pwrctrl_dcdt.c) (Controller Setup), [`dspic33ck-dab.X/sources/comm/PBV_interface.c`](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_interface.c) (PBV Interface), [`dspic33ck-dab.X/sources/comm/PBV_UART.c`](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_UART.c) (PBV UART Transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Power Control"]
  node_pwrctrl["Power Controller<br/>[pwrctrl.c]"]
  node_control_isr["Control Loop ISR"]
  node_control_state["Power Control State<br/>[pwrctrl_sm.c]"]
  node_dcdt["Controller Setup<br/>[pwrctrl_dcdt.c]"]
  node_compensators["DAB Compensators<br/>[dab_psio_dcdt.h]"]
  node_forward_coeffs["Forward Coefficients<br/>[dab_pspo_dcdt.h]"]
  node_reverse_coeffs["Reverse Coefficients<br/>[dab_sppo_dcdt.h]"]
  node_pwm["PWM Control<br/>[pwrctrl_pwm.c]"]
end

subgraph group_comms["Communications"]
  node_pbv_interface["PBV Interface<br/>[PBV_interface.c]"]
  node_pbv_can["PBV CAN Transport<br/>[PBV_CAN.c]"]
  node_pbv_uart["PBV UART Transport<br/>[PBV_UART.c]"]
  node_frame_map["DAB Frame Map"]
end

subgraph group_safety["Sensing And Faults"]
  node_voltage_sense["Isolated Voltage Sense"]
  node_fault_checks["Fault Evaluation<br/>[fault_common.c]"]
  node_fault_control["Fault Controller<br/>[fault.c]"]
end

subgraph group_platform["Device Platform"]
  node_adc["ADC Peripheral<br/>[adc1.h]"]
  node_pwm_peripheral["PWM Peripheral<br/>[pwm.h]"]
  node_uart_peripheral["UART Peripheral<br/>[uart1.h]"]
  node_crc["CRC Peripheral<br/>[crc.h]"]
end

node_pbv(("Power Board Visualizer"))
node_power_board["DAB Power Board"]

node_pbv -->|"sends CANFD commands"| node_power_board
node_pbv_uart -->|"uses UART"| node_uart_peripheral
node_pbv_uart -->|"uses CRC"| node_crc
node_dcdt -->|"includes controllers"| node_compensators
node_dcdt -->|"includes coefficients"| node_forward_coeffs
node_dcdt -->|"includes coefficients"| node_reverse_coeffs
node_control_isr -->|"reads conversions"| node_adc
node_control_isr -->|"updates loops"| node_compensators
node_voltage_sense -->|"initializes fault object"| node_fault_checks
node_fault_checks -.->|"supports fault handling"| node_fault_control
node_pwrctrl -.->|"runs control"| node_control_state
node_control_isr -.->|"updates modulation"| node_pwm
node_pwm -.->|"drives outputs"| node_pwm_peripheral
node_pbv_interface -.->|"routes transport"| node_pbv_can
node_pbv_interface -.->|"routes transport"| node_pbv_uart
node_pbv_interface -.->|"maps messages"| node_frame_map

click node_pwrctrl "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl.c"
click node_control_isr "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c"
click node_control_state "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_sm.c"
click node_dcdt "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/dcdt/pwrctrl_dcdt.c"
click node_compensators "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_psio/dcdt_generated_code/dab_psio_dcdt.h"
click node_forward_coeffs "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_pspo/dcdt_generated_code/dab_pspo_dcdt.h"
click node_reverse_coeffs "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_sppo/dcdt_generated_code/dab_sppo_dcdt.h"
click node_pwm "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_pwm.c"
click node_pbv_interface "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_interface.c"
click node_pbv_can "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_CAN.c"
click node_pbv_uart "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_UART.c"
click node_frame_map "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_dab_frame_map.c"
click node_voltage_sense "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/device/dev_iso_voltage_sense.c"
click node_fault_checks "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/fault/fault_common.c"
click node_fault_control "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/fault/fault.c"
click node_adc "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/adc/adc1.h"
click node_pwm_peripheral "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/pwm_hs/pwm.h"
click node_uart_peripheral "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/uart/uart1.h"
click node_crc "https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/crc/crc.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pwrctrl,node_control_isr,node_control_state,node_dcdt,node_compensators,node_forward_coeffs,node_reverse_coeffs,node_pwm toneBlue
class node_pbv_interface,node_pbv_can,node_pbv_uart,node_frame_map toneAmber
class node_voltage_sense,node_fault_checks,node_fault_control toneMint
class node_adc,node_pwm_peripheral,node_uart_peripheral,node_crc toneRose
class node_pbv,node_power_board toneIndigo
```

## Components

### Power Control

- [Power Controller](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl.c): `dspic33ck-dab.X/sources/pwrctrl/pwrctrl.c`
- [Control Loop ISR](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c): `dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c`
- [Power Control State](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_sm.c): `dspic33ck-dab.X/sources/pwrctrl/pwrctrl_sm.c`
- [Controller Setup](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/dcdt/pwrctrl_dcdt.c): `dspic33ck-dab.X/sources/pwrctrl/dcdt/pwrctrl_dcdt.c`
- [DAB Compensators](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_psio/dcdt_generated_code/dab_psio_dcdt.h): `dspic33ck-dab.X/dcdt/dab_psio/dcdt_generated_code/dab_psio_dcdt.h`
- [Forward Coefficients](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_pspo/dcdt_generated_code/dab_pspo_dcdt.h): `dspic33ck-dab.X/dcdt/dab_pspo/dcdt_generated_code/dab_pspo_dcdt.h`
- [Reverse Coefficients](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/dcdt/dab_sppo/dcdt_generated_code/dab_sppo_dcdt.h): `dspic33ck-dab.X/dcdt/dab_sppo/dcdt_generated_code/dab_sppo_dcdt.h`
- [PWM Control](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/pwrctrl/pwrctrl_pwm.c): `dspic33ck-dab.X/sources/pwrctrl/pwrctrl_pwm.c`

### Communications

- [PBV Interface](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_interface.c): `dspic33ck-dab.X/sources/comm/PBV_interface.c`
- [PBV CAN Transport](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_CAN.c): `dspic33ck-dab.X/sources/comm/PBV_CAN.c`
- [PBV UART Transport](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_UART.c): `dspic33ck-dab.X/sources/comm/PBV_UART.c`
- [DAB Frame Map](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/comm/PBV_dab_frame_map.c): `dspic33ck-dab.X/sources/comm/PBV_dab_frame_map.c`

### Sensing And Faults

- [Isolated Voltage Sense](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/device/dev_iso_voltage_sense.c): `dspic33ck-dab.X/sources/device/dev_iso_voltage_sense.c`
- [Fault Evaluation](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/fault/fault_common.c): `dspic33ck-dab.X/sources/fault/fault_common.c`
- [Fault Controller](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/sources/fault/fault.c): `dspic33ck-dab.X/sources/fault/fault.c`

### Device Platform

- [ADC Peripheral](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/adc/adc1.h): `dspic33ck-dab.X/mcc_generated_files/adc/adc1.h`
- [PWM Peripheral](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/pwm_hs/pwm.h): `dspic33ck-dab.X/mcc_generated_files/pwm_hs/pwm.h`
- [UART Peripheral](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/uart/uart1.h): `dspic33ck-dab.X/mcc_generated_files/uart/uart1.h`
- [CRC Peripheral](https://github.com/microchip-pic-avr-examples/dspic33ck-power-dcdc-dual-active-bridge-development-platform/blob/main/dspic33ck-dab.X/mcc_generated_files/crc/crc.h): `dspic33ck-dab.X/mcc_generated_files/crc/crc.h`

### Other components

- **Power Board Visualizer**
- **DAB Power Board**

## Connections

- Power Board Visualizer → DAB Power Board: sends CANFD commands
- PBV UART Transport → UART Peripheral: uses UART (evidence: `dspic33ck-dab.X/sources/comm/PBV_UART.c`)
- PBV UART Transport → CRC Peripheral: uses CRC (evidence: `dspic33ck-dab.X/sources/comm/PBV_UART.c`)
- Controller Setup → DAB Compensators: includes controllers
- Controller Setup → Forward Coefficients: includes coefficients
- Controller Setup → Reverse Coefficients: includes coefficients
- Control Loop ISR → ADC Peripheral: reads conversions (evidence: `dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c`)
- Control Loop ISR → DAB Compensators: updates loops (evidence: `dspic33ck-dab.X/sources/pwrctrl/pwrctrl_isr_extension.c`)
- Isolated Voltage Sense → Fault Evaluation: initializes fault object (evidence: `dspic33ck-dab.X/sources/device/dev_iso_voltage_sense.c`)
- Fault Evaluation → Fault Controller: supports fault handling
- Power Controller → Power Control State: runs control
- Control Loop ISR → PWM Control: updates modulation
- PWM Control → PWM Peripheral: drives outputs
- PBV Interface → PBV CAN Transport: routes transport
- PBV Interface → PBV UART Transport: routes transport
- PBV Interface → DAB Frame Map: maps messages
