6.6.9. Custom board definition format

Custom board definition files follow a prescribed format in motorBench® Development Suite. They are human-readable and hand-editable, but they are based on a defined data structure, organized as a data model.

The following sections describe these constraints.

6.6.9.1. Working with Serialized Data Models

6.6.9.1.1. Introduction

The term data model refers to any hierarchical tree structure used to model a system. In motorBench® Development Suite we use several data models, for processes such as code generation, parameter customization and custom board support.

Some data models can be serialized into text formats such as JSON, YAML, and TOML, which facilitates use of version control and hand-editing where appropriate. The custom board feature in motorBench® Development Suite 2.50 supports importing files in YAML format.

The data model for board definitions in motorBench is

  • serializable to JSON and deserializable from JSON, including support for the following types of values

    • numbers

    • strings

    • booleans (true and false)

    • null

    • lists of values (= arrays / ordered sequences)

    • maps of values (= dictionaries / unordered sets of key-value pairs)

  • generally described in YAML format (easier to read/write than JSON)

  • referenced by a path separated by dots, for example characteristics.current.phase.fullscale

6.6.9.1.2. Example in YAML

Here is an excerpt containing a partial board definition in YAML. Its hierarchical structure is expressed through levels of indentation.

Note

When editing, we suggest using an editor that supports YAML, such as VSCode or Notepad++, with syntax highlighting and ability to expand/collapse sections of the hierarchy.

Warning

To avoid misalignment and incompatibility, use spaces for indentation, not tabs.

Listing 6.3  
 identification:
   id: custom_board
   displayName: "Custom Board"
   description: "Custom Board"
 characteristics:
   device: dsPIC33CK256MP508
   # This is a comment
   current:
     phase:
       fullscale: 21.8
       maximum:
         # WOO HOO HOO
         continuous: 14.1
       timeConstant: 184.0e-9
     dcLink:
       fullscale: 21.8
       timeConstant: 184.0e-9
 peripherals:
   adc:
     current:
       a:
         channel: AN0
         inverted: true
         signed: true
       b:
         channel: AN1
         inverted: true
         signed: true
   opamp:
     enabled:
     - 1
     - 2
     - 3
  • Comments are expressed as a # followed by arbitrary text that will be ignored until the end of the line

  • Numbers are expressed as integers, floating-point values, or scientific notation

    • Floating-point values may be expressed as decimals (examples: 0.38, 8702.1) or as scientific notation (examples: -3.02e-5, 4.73e3).

      Note

      When using scientific notation, make sure to use a decimal before the exponent, for example 3.0e-5 rather than 3e-5. This avoids issues in some software libraries.

  • Booleans are expressed as the fixed text true and false (note: content is case-sensitive)

  • Null values are expressed as the fixed text null

  • Strings are expressed as text that is not a number or a boolean or null.

    • To be safe in YAML, use quotes to delimit the string; YAML includes other confusing and quirky representations like on and off (for booleans) or 12:00 which is a time.

    • There are several other ways to express multiline strings in YAML; you won’t need them for board definition files and should not use them.

  • Lists are ordered sequences of indented values, each of which is preceded by a hyphen character (the 1,2,3 at the end under opamp.enabled)

    • Lists may also be represented by an alternate compact syntax [value1, value2, value3] as in Javascript and Python, but we generally don’t use this in our examples.

  • Maps are unordered sequences of indented key/value pairs, where the key is a string, followed by a colon, followed by a value that is separated from the colon by a space or newline.

    • The example document above is a map with three keys, identification, characteristics, and peripherals.

    • The value associated with the identification key is itself a map containing three keys: id, displayName, and description. These keys each refer to a string value that immediately follows the key, after a space.

    • Maps may also be represented by an alternate compact syntax as in Javascript, but we generally don’t use this in our examples:

      {key1: value1, key2: value2, key3: value3}
      
    • The ordering of elements in a map is not important, and may be permuted without changing the value, even though the resulting serialized YAML file is different.

  • Values within a data model may be referenced by a path, which is a string that uses a period/dot . to denote indexing a map by key, and brackets [] to denote indexing a list by an integer value. In the example data model above:

    • the path identification.id refers to the string custom_board

    • the path peripherals.opamp.enabled[1] refers to the number 2

    • the path peripherals.adc.current.a refers to the following map:

      channel: AN0
      inverted: true
      signed: true
      

For a more detailed introduction on YAML, there are various public sources; these appear to be among the more readable tutorials:

6.6.9.2. Custom board schema

The data models in custom board definitions are hierarchical tree structures that conform to the schema listed in the table below, organized under three top-level sections:

  • identification — covers data associated with the name and description of a board

  • characteristics — covers parameters associated with a board, such as maximum PWM frequency, full-scale DC link voltage, maximum continuous phase current, etc.

  • peripherals — covers peripheral configuration choices, such as UART pin assignment, ADC channel mapping, PWM fault source and polarity, etc.

Each row of the table describes an entry in the tree, which has several properties:

  • a type, which is either one of the standard data model types or one of the following:

    • a named type, such as [digitalPolarity], that has a constrained structure. These types are listed at the end of the table.

    • an enum, which is a choice from among several fixed options (these are listed in the description)

    • a constrained numeric range, shown here as an inequality in either \(n\) or \(x\):

      • \(n\): integer range, for example \(1 \le n \le 3\)

      • \(x\): floating-point range, for example \(0.0 \le x \le 1.0\) or \(x \ge 0.0\)

  • units, if applicable — for example V (volts) or A (amperes) or s (seconds)

  • whether the entry is required (Req’d, denoted by a green checkmark greencheck) or optional

    Note

    Entries are required or optional in the context of their parent entries. For example, peripherals.qei is optional, but if it is present, then peripherals.qei.pins is required.

  • further descriptive notes under “Description”

Path

Type

Units

Req’d

Description

identification

map

../../_images/icon-green-check.svg

Board identification object.

  .id

string

../../_images/icon-green-check.svg

Unique ID for a given instance of a board. This parameter is restricted to printable ASCII characters (codes 32-126, including space but excluding DELETE (127)).

regex:descriptor = ^[ -~]+$

  .displayName

string

../../_images/icon-green-check.svg

Board name that will appear in motorBench when the board configuration file is loaded. This parameter is restricted to printable ASCII characters (codes 32-126, including space but excluding DELETE (127)).

regex:descriptor = ^[ -~]+$

  .description

string

Description of the board configuration.

characteristics

map

../../_images/icon-green-check.svg

Board characteristics object.

  .device

string

../../_images/icon-green-check.svg

Microcontroller part number. Restricted to dsPIC33CKxxxM(P/C)xxx discrete devices and dsPIC33CDV, dsPIC33CDVC, and dsPIC33CDVL SiP devices.

Use the device name as in MPLAB X, without any part suffixes to indicate packaging or temperature range. For example, dsPIC33CK256MP508 rather than dsPIC33CK256MP508T-I/PT.

regex:deviceName = ^(dsPIC33)([A-Za-z]+)([0-9]+)([A-Za-z]+)([0-9]+)$

  .gateDriver

map

PWM gate driver object for boards with MCP802(1/2/7) gate drivers or SiP-based boards.

    .device

string

../../_images/icon-green-check.svg

Gate driver device name. Restricted to MCP8021, MCP8022, MCP8027.

regex:identifier = ^[A-Za-z_][A-Za-z0-9_]*$

    .configuration

map

Gate driver configuration object. See device datasheet for more information on each parameter.

      .sleepMode

enum

../../_images/icon-green-check.svg

Device mode when disabled (SLEEP).

Options:

  • 'sleep'
  • 'standby'
  •       .shortCircuitDetect

    boolean

    ../../_images/icon-green-check.svg

    Enable external MOSFET short circuit detection (EXTSC).

          .underVoltageLockout

    boolean

    ../../_images/icon-green-check.svg

    Enable external MOSFET under-voltage lockout (EXTUVLO).

          .opampEnabledDuringDeviceStandby

    boolean

    Enable op amps during device standby mode (OPAMP). Only required if using MCP8022.

          .linPullUpsEnabled

    boolean

    Enable LIN pull-up resistors (PU30K). Only required if using MCP8027.

          .dacReference

    float

    V

    Sets the DAC current reference value (DACREF). Only required if using MCP8027.

        .pins

    map

    ../../_images/icon-green-check.svg

    Pin assignment for the MCP802x gate driver RX, TX, fault, and device enable pins. If using a SiP device, refer to the internal connections block diagram of the device datasheet.

          .RX

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .TX

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .fault

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .outputEnable

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

      .voltage

    map

    ../../_images/icon-green-check.svg

    Contains board voltage measurement characteristics.

        .phase

    map

    Specifies phase voltage measurement characteristics.

          .timeConstant

    float

    s

    ../../_images/icon-green-check.svg

    Time constant of phase voltage measurement circuit.

          .fullscale

    float

    V

    ../../_images/icon-green-check.svg

    Full scale value of phase voltage measurement.

        .dcLink

    map

    ../../_images/icon-green-check.svg

    Specifies DC link voltage measurement characteristics.

          .timeConstant

    float

    s

    ../../_images/icon-green-check.svg

    Time constant of DC link voltage measurement circuit.

          .fullscale

    float

    V

    ../../_images/icon-green-check.svg

    Full scale value of DC link voltage measurement. 0V-to-3.3V range at ADC corresponds to 0V-to-fullscale range.

          .minimum

    float

    V

    ../../_images/icon-green-check.svg

    Minimum allowable value of DC link voltage.

          .maximum

    float

    V

    ../../_images/icon-green-check.svg

    Maximum allowable value of DC link voltage.

          .default

    float

    V

    ../../_images/icon-green-check.svg

    Default value of DC link voltage. Used to initialize the system parameter for “Nominal DC link voltage” when motorBench starts a new project.

      .current

    map

    ../../_images/icon-green-check.svg

    Contains board current measurement characteristics.

        .dcLink

    map

    Specifies DC link current measurement characteristics.

          .fullscale

    float

    A

    ../../_images/icon-green-check.svg

    Full scale value of DC link current measurement.

          .timeConstant

    float

    s

    ../../_images/icon-green-check.svg

    Time constant of DC link current measurement circuit.

        .phase

    map

    Specifies phase current measurement characteristics.

          .fullscale

    float

    A

    ../../_images/icon-green-check.svg

    Full scale value of phase current measurement.

          .timeConstant

    float

    s

    ../../_images/icon-green-check.svg

    Time constant of phase current measurement circuit.

          .maximum

    map

    ../../_images/icon-green-check.svg

    Specifies maximum phase current characteristics.

            .continuous

    float

    A

    ../../_images/icon-green-check.svg

    Maximum continuous phase current. This value must be well below the full scale phase current measurement range to account for current ripple and hardware tolerances while leaving enough margin for current controller overshoot.

            .peak

    float

    A

    Maximum peak phase current. This value must be well below the full scale phase current measurement range to account for current ripple and hardware tolerances while leaving enough margin for current controller overshoot.

          .gainCorrectionFactors

    map

    Phase current measurement gain correction factors. These five parameters form a 3x3 matrix (Kac, Kbc, Kca, and Kcb are set to zero) used for current measurement compensation. Optional; if not present, the 3x3 identity matrix is used.

            .Kaa \(0.5 \le x \le 1.5\)

    ../../_images/icon-green-check.svg

            .Kab \(-0.5 \le x \le 0.5\)

    ../../_images/icon-green-check.svg

            .Kba \(-0.5 \le x \le 0.5\)

    ../../_images/icon-green-check.svg

            .Kbb \(0.5 \le x \le 1.5\)

    ../../_images/icon-green-check.svg

            .Kcc \(0.5 \le x \le 1.5\)

    Optional; supports boards that measure phase C current and need gain correction.

      .pwm

    map

    ../../_images/icon-green-check.svg

    Contains 3-phase PWM characteristics.

        .frequency

    [rangeWithDefault]

    ../../_images/icon-green-check.svg

    Switching frequency of 3-phase PWM signals.

          .minimum \(x \ge 0.0\)

    Hz

    ../../_images/icon-green-check.svg

    Minimum allowable value.

          .maximum \(x \ge 0.0\)

    Hz

    ../../_images/icon-green-check.svg

    Maximum allowable value.

          .default \(x \ge 0.0\)

    Hz

    ../../_images/icon-green-check.svg

    Default value.

        .deadTime

    [rangeWithDefault]

    ../../_images/icon-green-check.svg

    Dead time of 3-phase PWM signals. Brief period of time when the high and low PWM signals in a phase are off, preventing conduction and short circuits between the DC link voltage and ground.

          .minimum \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Minimum allowable value.

          .maximum \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Maximum allowable value.

          .default \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Default value.

        .dutyCycle

    map

    ../../_images/icon-green-check.svg

    PWM duty cycle characteristics.

          .minimum

    float

    ../../_images/icon-green-check.svg

    Minimum duty cycle supported by the board, taking into consideration the minimum pulse width limitations of the inverter stage.

          .maximum

    float

    ../../_images/icon-green-check.svg

    Maximum duty cycle supported by the board, taking into consideration the minimum pulse width limitations of the inverter stage, bootstrap limitations of the gate driver (if present) and current measurement limitations of low-side shunt-based current amplifier circuits (if present).

    peripherals

    map

    ../../_images/icon-green-check.svg

      .debugger

    map

    ../../_images/icon-green-check.svg

    Programming/Debugging configuration.

        .channel \(1 \le n \le 3\)

    ../../_images/icon-green-check.svg

    PGDx/PGCx channel used for Programming/Debugging. Refer to device datasheet for which Programming/Debugging channels are available.

      .oscillator

    map

    ../../_images/icon-green-check.svg

    Oscillator configuration.

        .clockSource

    string

    ../../_images/icon-green-check.svg

    Clock source selection. Possible options are crystal oscillator, internal FRC, or external clock.

    crystal oscillator

    Primary Oscillator with PLL

    internal FRC

    FRC Oscillator with PLL

    external clock

    External Oscillator with PLL

    regex:clockSource = ^[ -~]+$

        .inputClockFrequency

    integer

    Hz

    ../../_images/icon-green-check.svg

    Frequency of input clock used to generate system clock frequency.

      .adc

    map

    ../../_images/icon-green-check.svg

    Configuration of ADC peripheral and ADC channels. See device datasheet for which ADC channels are available on the selected device.

        .samplingTime

    [rangeWithDefault]

    ../../_images/icon-green-check.svg

    Sampling time of ADC channels.

          .minimum \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Minimum allowable value.

          .maximum \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Maximum allowable value.

          .default \(x \ge 0.0\)

    s

    ../../_images/icon-green-check.svg

    Default value.

        .current

    map

    ../../_images/icon-green-check.svg

    Configures ADC channels for current measurement. This determines which current measurement methods are available.

          .dcLink

    [adcChannelCurrent]

    Current measurement ADC channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .inverted

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC channel measurement is inverted. true = inverted, false = not inverted

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .a

    [adcChannelCurrent]

    Current measurement ADC channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .inverted

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC channel measurement is inverted. true = inverted, false = not inverted

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .b

    [adcChannelCurrent]

    Current measurement ADC channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .inverted

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC channel measurement is inverted. true = inverted, false = not inverted

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .c

    [adcChannelCurrent]

    Current measurement ADC channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .inverted

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC channel measurement is inverted. true = inverted, false = not inverted

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

        .voltage

    map

    ../../_images/icon-green-check.svg

    Configuration of ADC channels for voltage measurement. DC link voltage measurement is required, all other voltage measurements are optional.

          .dcLink

    [adcChannelVoltage]

    ../../_images/icon-green-check.svg

    DC link voltage measurement channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .a

    [adcChannelVoltage]

    Phase A voltage measurement channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .b

    [adcChannelVoltage]

    Phase B voltage measurement channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .c

    [adcChannelVoltage]

    Phase C voltage measurement channel configuration.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .absoluteReference

    map

    Absolute voltage reference channel configuration.

            .nominal

    float

    V

    ../../_images/icon-green-check.svg

    Nominal analog voltage (AVdd).

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

        .other

    map

    ADC measurements supported by MCAF that don’t fit into the current or voltage categories. The ADC measurements in this category are optional.

          .bridgeTemperature

    map

    Bridge temperature measurement channel configuration.

            .offset

    float

    V

    ../../_images/icon-green-check.svg

    Offset of bridge temperature measurement.

            .gain

    float

    ../../_images/icon-green-check.svg

    Gain of bridge temperature measurement.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

          .potentiometer

    map

    Potentiometer measurement channel configuration.

            .inverted

    boolean

    Polarity of measurement. true = inverted, false = not inverted

            .minimum \(0.0 \le x \le 1.0\)

    Minimum measured voltage as a fraction of AVdd. Defaults to 0.0.

            .maximum \(0.0 \le x \le 1.0\)

    Maximum measured voltage as a fraction of AVdd. Defaults to 1.0.

            .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

            .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

        .custom

    Custom ADC channel configuration. These ADC channels are not used by MCAF, and may be managed by the application. They are sampled at the same frequency (PWM frequency) as other MCAF ADC channels. The custom name of the channel must be a valid C identifier.

          .*

    [adcChannelCustom]

    key = regex:cStandardName = ^[A-Za-z_][A-Za-z0-9_]*$

      .pwm

    map

    ../../_images/icon-green-check.svg

    3-phase PWM configuration.

        .polarity

    map

    ../../_images/icon-green-check.svg

    Polarity of the upper (PWMxH) and lower (PWMxL) PWM signals.

          .upper

    [digitalPolarity]

    ../../_images/icon-green-check.svg

    Digital polarity.

          .lower

    [digitalPolarity]

    ../../_images/icon-green-check.svg

    Digital polarity.

        .generators

    map

    ../../_images/icon-green-check.svg

    PWM generator to motor phase mapping. See device datasheet for which PWM generators are available on the selected device.

          .a

    integer

    ../../_images/icon-green-check.svg

    PWM generator number. See device datasheet for which PWM generators are available on the selected device.

          .b

    integer

    ../../_images/icon-green-check.svg

    PWM generator number. See device datasheet for which PWM generators are available on the selected device.

          .c

    integer

    ../../_images/icon-green-check.svg

    PWM generator number. See device datasheet for which PWM generators are available on the selected device.

        .outputSwap

    map

    Swap the outputs of the upper (PWMxH) and lower (PWMxL) signals for each generator.

          .a

    boolean

    Determines if the PWMxH and PWMxL signals are swapped.

          .b

    boolean

    Determines if the PWMxH and PWMxL signals are swapped.

          .c

    boolean

    Determines if the PWMxH and PWMxL signals are swapped.

        .fault

    map

    ../../_images/icon-green-check.svg

    PWM fault configuration. This signal will cause the PWM generators to shut down when the digital signal transitions (low or high, depending on the polarity configuration).

          .polarity

    [digitalPolarity]

    Digital polarity.

          .source

    string

    ../../_images/icon-green-check.svg

    Fault source selection.

    none

    Fault source tied to 0V

    CMP1

    Comparator 1 Output

    CMP2

    Comparator 2 Output

    CMP3

    Comparator 3 Output

    PCI19

    Device pin, PCI19

    PCI20

    Device pin, PCI20

    PCI21

    Device pin, PCI21

    PCI22

    Device pin, PCI22

    CLC1

    Configurable logic cell 1

    PCI18R

    Remappable peripheral function input, PCI18R

    PCI17R

    Remappable peripheral function input, PCI17R

    PCI16R

    Remappable peripheral function input, PCI16R

    PCI15R

    Remappable peripheral function input, PCI15R

    PCI14R

    Remappable peripheral function input, PCI14R

    PCI13R

    Remappable peripheral function input, PCI13R

    PCI12R

    Remappable peripheral function input, PCI12R

    PCI11R

    Remappable peripheral function input, PCI11R

    PCI10R

    Remappable peripheral function input, PCI10R

    PCI9R

    Remappable peripheral function input, PCI9R

    PCI8R

    Remappable peripheral function input, PCI8R

    regex:faultSource = ^[ -~]+$

      .opamp

    map

    Internal op amp configuration.

        .enabled

    list

    ../../_images/icon-green-check.svg

    A list of which op amps are enabled.

          .* \(1 \le n \le 3\)

      .comparator

    map

    Internal comparator/DAC configuration. The comparator/DAC can be configured for the PWM fault source.

        .source

    string

    ../../_images/icon-green-check.svg

    Source that triggers the comparator output.

    regex:cmpTrigSource = ^CMP[1-3][A-D]$

        .inverted

    boolean

    ../../_images/icon-green-check.svg

    Polarity of the comparator output. true = inverted, false = non inverted

        .threshold \(0.0 \le x \le 1.0\)

    Fraction of AVDD

    ../../_images/icon-green-check.svg

    Trigger threshold as a fraction of AVdd.

      .gpio

    GPIO configuration.

        .*

    [gpio]

    key = regex:cStandardName = ^[A-Za-z_][A-Za-z0-9_]*$

      .qei

    map

    QEI configuration. Must be configured to use the QEI estimator. See device datasheet for which pins are available on the selected device.

        .pins

    map

    ../../_images/icon-green-check.svg

    QEI pin configuration.

          .A

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .B

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .Z

    string

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

      .uart

    map

    UART configuration. Must be configured if real-time debugging is desired. See device datasheet for which pins are available on the selected device.

        .pins

    map

    ../../_images/icon-green-check.svg

    UART pin configuration.

          .RX

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

          .TX

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

    Referenced types
    [generator]

    integer

    PWM generator number. See device datasheet for which PWM generators are available on the selected device.

    [pin]

    string

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

    [adcChannelCustom]

    map

      .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

      .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

    [adcChannelVoltage]

    map

      .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

      .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned

    [digitalPolarity]

    enum

    Digital polarity.

    Options:

  • 'active-high'
  • 'active-low'
  • [gpio]

    map

      .pin

    string

    ../../_images/icon-green-check.svg

    GPIO pin name. See device datasheet for which pins are available on the selected device.

    regex:pin = ^R([A-HJK])([0-9]|1[0-5])$

      .direction

    enum

    ../../_images/icon-green-check.svg

    Direction of GPIO.

    Options:

  • 'input'
  • 'output'
  •   .polarity

    [digitalPolarity]

    ../../_images/icon-green-check.svg

    Digital polarity.

      .openDrain

    boolean

    Open drain pin configuration.

      .weakPullUp

    boolean

    Enable internal weak pull-up resistor.

      .weakPullDown

    boolean

    Enable internal weak pull-down resistor.

      .startHigh

    boolean

    Start condition of pin (LATx).

    [generatorOutputsSwap]

    boolean

    Determines if the PWMxH and PWMxL signals are swapped.

    [rangeWithDefault]

    map

      .minimum \(x \ge 0.0\)

    ../../_images/icon-green-check.svg

    Minimum allowable value.

      .maximum \(x \ge 0.0\)

    ../../_images/icon-green-check.svg

    Maximum allowable value.

      .default \(x \ge 0.0\)

    ../../_images/icon-green-check.svg

    Default value.

    [adcChannelCurrent]

    map

    Current measurement ADC channel configuration.

      .channel

    string

    ../../_images/icon-green-check.svg

    Desired ADC channel to sample.

    regex:adcChannel = ^((ANA?)|(AD[0-5]ANN?))([0-9]|([1-3][0-9]))$

      .inverted

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC channel measurement is inverted. true = inverted, false = not inverted

      .signed

    boolean

    ../../_images/icon-green-check.svg

    Determines if the ADC measurement is treated as a signed value relative to mid-scale (AVdd/2) or an unsigned value relative to AVss. true = signed, false = unsigned