1.1.2.3 Configuring The Library

G3 MAC RT Driver Specific User Configurations

G3 MAC RT Driver library is configured via MCC. Below is the snapshot of the MCC configuration window for G3 MAC RT driver and brief description.

Figure . G3 MAC RT Driver configuration options
G3_MACRT_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
      G3_MACRT_mcc_pl460_pins
    • Configuration for PL360 device:

      Figure . PL360 configuration options
      G3_MACRT_mcc_pl360_pins
  • PLIB Used:

    • Indicates the SPI peripheral instance used by the G3 MAC RT driver.

    • The name of the peripheral will vary from device to device.

  • SPI NPCS Used:

    • SPI chip select line to be used by the G3 MAC RT 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:

      • 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 Coupling Settings:

    • PLC Driver mode must have been selected before to obtain a valid PLC coupling settings for each mode

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

    • The options of this configuration will vary depending on the PLC Driver Mode selected

    • 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.
          Figure . G3 frequency table
          PLC_PHY_mcc_G3_frequencies
        • FCC high attenuation branch:

          • This option is visible only for FCC configured as the main branch.

          • The PL460 is capable of automatically managing two external filters in the filtering stage, each filter associated to an ASOx line.

        • Multiband:
          Figure . PL460: Hardware blocks in multiband
          PLC_PHY_mcc_pl460_aux_branch
          • This option is visible only for FCC as main branch.

          • Used to select CENELEC-A or CENELEC-B as the auxiliary PLC PHY band.

          • Auxiliary 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.

            • Set as default branch:

              • Used to establish auxiliary branch in the intialization of the G3 PLC MACRT driver.

      • PL360:

        • Main Branch:
          Figure . PL360: Hardware blocks in a single band with external coupling
          PLC_PHY_mcc_pl360_main_branch
          • This is the default branch for single-band applications either in CEN-A, CEN-B or FCC bands.

          • FCC high attenuation branch:

            • This option is visible only for FCC configured as the main branch

          • Internal Driver:

            • This option is visible only for PL360 driver mode and CEN-B configured as the main branch
              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.

          • Multiband:
            Figure . PL360: Hardware blocks in multiband with external coupling
            PLC_PHY_mcc_pl360_aux_branch
            • This option is visible only for FCC as main branch.

            • Used to select CEN-A or CEN-B as the auxiliary PLC PHY band

            • Auxiliary Branch:

              • The Auxiliary Transmission Branch can provide an additional output bit-stream, if required.

            • Set as default branch:

              • Used to establish Auxiliary branch in the intialization of the G3 PLC MACRT driver.

  • 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 G3 MAC RT 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 does 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 G3-PLC band used:

  • 8 MHz if CENELEC-A or CENELEC-B band is used.

  • 12 MHz if only FCC band is used.

When SPI dependency of G3 MAC RT 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 G3 MAC RT Driver
G3_MACRT_mcc_spi_configuration