1.1.1.3 Configuring The Library

PLC PHY Driver Specific User Configurations

PLC PHY Driver library is configured via MCC. Below is the snapshot of the MCC configuration window for PLC PHY driver and brief description.

Figure . PLC PHY Driver configuration options
PLC_PHY_mcc_configuration
  • PLC Driver Mode:

    • Specifies the PLC device physically connected (PL360 or PL460).

    • The pins in use will vary depending on the device selected.

    • Configuration for PL460 device:

      Figure . PL460 configuration options
      PLC_PHY_mcc_pl460_pins
    • Configuration for PL360 device:

      Figure . PL360 configuration options
      PLC_PHY_mcc_pl360_pins
  • PLIB Used:

    • Indicates the SPI peripheral instance used by the PLC PHY driver.
    • The name of the peripheral will vary from device to device.
  • SPI NPCS Used:

    • SPI chip select line to be used by the PLC PHY driver.
    • It is only visible if the connected peripheral supports multiple chip select lines.
  • External Interrupt Pin:

    • GPIO pin to be used as external interrupt interface (active low).

    • This pin automatically indicates that the firmware running in the PLC device has one or more pending events to be consulted.

    • This pin must be configured as GPIO input in "Pin Settings" configuration. Set Pull Down and Low Level Interrupt configuration:

      Figure . PLC PIO Interrupt settings
      PLC_PHY_mcc_pl460_INT_pin_settings
  • Reset Pin:

    • GPIO pin to be used as reset (active low).
    • This pin resets the core and the peripherals of the PLC device.
    • This pin must be configured as GPIO output in "Pin Settings" configuration.
  • LDO Enable Pin:

    • GPIO pin to be used as LDO enable (active high).
    • This pin provides power to the core voltage regulator embedded in the PLC device.
    • This pin must be configured as GPIO output in "Pin Settings" configuration.
  • TX Enable Pin:

    • GPIO pin to allow PLC transmissions (active high).
    • This pin must be configured as GPIO output in "Pin Settings" configuration.
    • It is only visible if PLC Driver Mode is configured as PL460.
  • Sleep Mode:

    • Enables the Sleep mode. In Sleep mode, the core and peripherals of the PLC device are reset, reducing power consumption.

    • Standby Pin:

      • GPIO pin to be used as sleep mode enable (active high).
      • This pin must be configured as GPIO output in "Pin Settings" configuration.
      • It is only visible if Sleep Mode is enabled.
  • Thermal Monitor:

    • Enables Thermal Monitor. It allows to check the Thermal Monitor pin of PL460 and not allow transmissions if Thermal Warning is indicated.

    • It is only visible if PLC Driver Mode is configured as PL460.

    • Thermal Monitor Pin (PL460 mode):

      • GPIO pin to check the status of the Thermal Monitor.
      • This pin must be configured as GPIO input in "Pin Settings" configuration. Set Pull Up configuration.
      • It is only visible if Thermal Monitor is enabled.
  • PLC Profile:

    • This option is used to select the PLC standard to comply with such as G3-PLC (ITU G.9903), PRIME (ITU G.9904) or Meters And More.
  • PLC Coupling Settings:

    • PLC Driver Mode and PLC Profile must have been selected before obtaining a valid PLC coupling settings.

    • Used to establish the hardware configuration associated to the PLC frequency bands to use.

    • The options of this configuration will vary from the selected PLC Driver Mode and PLC profile.

    • PL460:

      • Main Branch:
        Figure . PL460: Hardware blocks in a single band
        PLC_PHY_mcc_pl460_main_branch
        • The Main Transmission Branch uses the embedded class-D PLC line driver to optimize performance in terms of efficiency and EMC compliance, while reducing BOM cost and PCB complexity.
        • This is the default branch for single-band applications either in CENELEC-A, CENELEC-B or FCC bands.
        • With FCC High Attenuation Branch, the PL460 is capable of automatically managing two external filters in the filtering stage, each filter associated to an ASOx line.
      • Auxiliary Branch:
        Figure . PL460: Hardware blocks in multiband
        PLC_PHY_mcc_pl460_aux_branch
        • The Auxiliary Transmission Branch can provide an additional output bit-stream, if required.
        • The Auxiliary Transmission path cannot use the embedded PLC driver in the PL460 and requires an external circuit for signal amplification, in addition to the standard filtering and coupling stages.
        • CENELEC-A or CENELEC-B bands are available with the Auxiliary Transmission Branch.
    • PL360:

      • Single Branch:
        Figure . PL360: Hardware blocks in a single branch with external coupling
        PLC_PHY_mcc_pl360_main_branch
        • This is the default branch for single-band applications either in CENELEC-A (PLCOUP007) or CENELEC-B (PLCOUP014).
      • Double Branch:
        Figure . PL360: Hardware blocks in double branch with external coupling
        PLC_PHY_mcc_pl360_aux_branch
        • This coupling configuration is used for FCC (PLCOUP006) or Multiband FCC & CENELEC-A (PLCOUP011)
      • Internal Driver:
        Figure . PL360: Hardware blocks in a single band with internal coupling
        PLC_PHY_mcc_pl360_main_branch_internal
        • In case of using a coupling with internal driver, only one branch is allowed and all the four EMIT pins must be connected to the same point and transmission control is indicated by TXRX0.
        • This branch can be used for CENELEC-B (PLCOUP012)
    • The PLC Coupling Settings vary depending on the PLC Profile

    • G3-PLC profile:

      • CENELEC-A, CENELEC-B and FCC bands ara available in G3-PLC
        Figure . G3-PLC frequency table
        PLC_PHY_mcc_G3_frequencies
        Figure . G3-PLC Coupling and Band Settings
        PLC_PHY_mcc_coupling_G3
      • PLC Coupling and Band Settings:
        • It selects the PLC Coupling variant used and consequently the G3-PLC PHY band or bands.
        • The available options will vary depending on the PLC Driver Mode selected.
        • PL460:
          • CEN-A (CENELEC-A only; main branch),
          • CEN-B (CENELEC-B only; main branch)
          • FCC default (FCC only; main branch)
          • FCC high attenuation (FCC only; main branch)
          • Multiband FCC default & CEN-A (FCC + CENELEC-A; main branch + auxiliary branch)
          • Multiband FCC default & CEN-A (CENELEC-A only; auxiliary branch)
          • Multiband FCC default & CEN-B (FCC + CENELEC-B; main branch + auxiliary branch)
          • Multiband FCC default & CEN-B (CENELEC-B only; auxiliary branch)
          • Multiband FCC high attenuation & CEN-A (FCC + CENELEC-A; main branch + auxiliary branch)
          • Multiband FCC high attenuation & CEN-A (CENELEC-A only; auxiliary branch)
          • Multiband FCC high attenuation & CEN-B (FCC + CENELEC-B; main branch + auxiliary branch)
          • Multiband FCC high attenuation & CEN-B (CENELEC-B only; auxiliary branch)
          • Multiband single-branch FCC & CEN-A (FCC + CENELEC-A; main branch)
          • Multiband single-branch FCC & CEN-A (FCC only; main branch)
          • Multiband single-branch FCC & CEN-A (CENELEC-A only; main branch)
        • PL360:
          • PLCOUP007 (CENELEC-A only; single branch; external driver)
          • PLCOUP014 (CENELEC-B only; external driver)
          • PLCOUP012 (CENELEC-B only; single branch; internal driver)
          • PLCOUP006 (FCC only; double branch; external driver)
          • PLCOUP011 (FCC + CENELEC-A; double branch; external driver)
          • PLCOUP011 (FCC only; single branch; external driver)
      • Default G3-PLC Band:
        • In case of Multiband PLC Coupling, this option selects the G3-PLC PHY band used by default.
    • PRIME profile:

      • PRIME profile divides the frequency spectrum in 8 channels.
        Figure . PRIME Frequency channels
        PLC_PHY_mcc_PRIME_frequencies
        Figure . PRIME PLC Coupling Settings
        PLC_PHY_mcc_coupling_PRIME
      • PLC Coupling Variant:
        • It selects the PLC Coupling variant used and consequently the available PRIME PLC channels.
        • The available options will vary depending on the PLC Driver Mode selected.
        • PL460:
          • CEN-A (CHN1 only; main branch)
          • FCC default (FCC channels only; main branch)
          • FCC high attenuation (FCC channels only; main branch)
          • Multiband FCC default & CEN-A (all channels; main branch + auxiliary branch)
          • Multiband FCC high attenuation & CEN-A (all channels; main branch + auxiliary branch)
          • Multiband single-branch FCC & CEN-A (all channels; main branch)
        • PL360:
          • PLCOUP007 (CHN1 only; single branch; external driver)
          • PLCOUP006 (FCC channels only; double branch; external driver)
          • PLCOUP011 (all channels; double branch; external driver)
      • Single Channel
        • PLC frames will be transmitted and received using 1-channel frequency range.
        • Channel "i"
          • Enable Channel "i" to be used by the PLC PHY Driver.
      • Double Channel
        • PLC frames will be transmitted and received using 2-channel frequency range.
          • Channel "i - j"
            • Enable Channels "i" and "j" to be used by the PLC PHY Driver.
      • Default Channel
        • Selects the PRIME PLC channel used by default.
    • Meters&More profile:

      • Meters And More uses a single frequency in the CENELEC-A Band, using a BPSK modulation.
        Figure . Meters And More PLC Coupling Settings
        PLC_PHY_mcc_coupling_MM
      • PLC Coupling Settings:
        • It selects the PLC Coupling variant used.
        • This option is not available for PL360 because only PLCOUP007 can be used.
        • PL460:
          • CEN-A (CENELEC-A only; main branch)
          • Multiband FCC default/high attenuation & CEN-A (FCC + CENELEC-A; auxiliary branch)
          • Multiband single-branch FCC & CEN-A (FCC + CENELEC-A; main branch)
  • RTOS Settings

    • Stack Size (in bytes):
      • Specifies the number of bytes to be allocated on the stack for the driver task.
    • Task Priority:
      • Specifies priority for the driver task thread. The value can vary based on RTOS used.

NVIC Configurations (Interrupt Priorities)

  • The PLC PHY driver has a strong dependency with a delay function implemented in the HAL module. This delay function is called from the interrupt handler associated with the External Interrupt pin.
  • In the Microchip implementation, the delay function uses the Time system service, which uses a timer peripheral. The timer interrupt priority must be higher (lower value) than the interrupt priority associated with the External Interrupt pin in order to ensure the correct operation.
  • For MCUs that do not have DMA (PIC32CXMT for example), the SPI interrupt priority must be higher (lower value) than the interrupt priority associated with the External Interrupt pin in order to ensure the correct operation.

SPI Peripheral Configuration

For correct operation it is important that the SPI is properly configured in MCC. If the used peripheral supports multiple chip select lines, the corresponding NPCS has to be enabled and configured.

The maximum SPI clock frequency allowed depends on the PLC protocol and band used:

  • G3-PLC:

    • 8 MHz if CENELEC-A or CENELEC-B band is used.
    • 12 MHz if only FCC band is used.
  • PRIME:

    • 8 MHz if Single Channel 1 used.
    • 12 MHz if Sinche Channel 1 is not used.
  • Meters And More:

    • 8 MHz.

When SPI dependency of PLC PHY driver is connected to a peripheral with SPI capability, some SPI options are automatically configured. The SPI clock frequency is configured to 8 MHz by default. There is not any requirement in terms of low SPI baudrate, the user can reduce it if needed. However, it is recommended to configure it as high as possible because the lower the SPI baudrate, the slower the response time. The other SPI configuration options should not be changed.

The following snapshot shows an example of valid SPI configuration for a PIC32CXMT device:

Figure . SPI configuration options for PLC PHY Driver
PLC_PHY_mcc_spi_configuration