SPRAC94D September   2018  – March 2022 AFE030 , AFE031 , TMS320F28075 , TMS320F28075-Q1 , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S

 

  1.   Trademarks
  2. FSK Overview
  3. Hardware Overview
    1. 2.1 Block Diagram
    2. 2.2 Hardware Setup
  4. Interfacing With the AFE03x
    1. 3.1 Configuring the AFE031
  5. Transmit Path
    1. 4.1 FSK Example Specifications
    2. 4.2 PWM Mode
      1. 4.2.1 Software Implementation
      2. 4.2.2 Testing Results
      3. 4.2.3 HRPWM vs. EPWM
    3. 4.3 DAC Mode
      1. 4.3.1 Software Implementation
      2. 4.3.2 Testing Results
      3. 4.3.3 OFDM Ability
    4. 4.4 Porting TX to LAUNCHXL-F280049C
      1. 4.4.1 PWM Mode Specific Porting
      2. 4.4.2 DAC Mode Specific Porting
  6. Receive Path
    1. 5.1 Receive Path Overview
    2. 5.2 Receiver Software Implementation
      1. 5.2.1 Initial Setup and Parameters
      2. 5.2.2 Interrupt Service Routines
      3. 5.2.3 Run Time Operation
      4. 5.2.4 Testing Results
      5. 5.2.5 System Utilization
      6. 5.2.6 Device Dependency and Porting
    3. 5.3 Tuning and Calibration
      1. 5.3.1 Setting the AFE03X's PGAs
      2. 5.3.2 Automatic Gain Control (AGC)
      3. 5.3.3 Setting the Bit Detection Threshold
      4. 5.3.4 FSK Correlation Detector Library
    4. 5.4 Porting RX to LAUNCHXL-F280049C
  7. Interfacing With a Power Line
    1. 6.1 Line Coupling
    2. 6.2 Coupling to an AC Line
      1. 6.2.1 Low Voltage Capacitor
      2. 6.2.2 The Ratio of the Transformer
      3. 6.2.3 HV Capacitor
      4. 6.2.4 HV Side Inductor
    3. 6.3 Coupling to DC Line
    4. 6.4 Protection Circuit
      1. 6.4.1 Metal Oxide Varistors
      2. 6.4.2 Transient Voltage Suppressors
      3. 6.4.3 Current Steering Diodes
    5. 6.5 Determining PA Power Supply Requirements
  8. Summary
  9. References
  10. Schematics
    1. 9.1 Schematics (PWM Mode)
    2. 9.2 Schematics (DAC Mode)
  11. 10Revision History

Configuring the AFE031

There are two main steps to configure the AFE device. First, ensure that the GPIOs are configured correctly. On the AFE device, two main GPIOs are set up: DAC Mode Select and System Shutdown. Both of these pins are pulled low. All other GPIOs connected can also be pulled low.

The next step is to configure the device over SPI. In the software example, the HAL_afe031Init() function configures the AFE031 and is defined within AFE03x_Config.c.

The steps below show the sequence the function follows to correctly configure the device:

  1. Configure GPIOs.
    1. Setup SD and DAC pins on the AFE device. Both these pins need to be brought low.
    2. Software example function: HAL_afe031_cfgGpio();
  2. Configure SPI.
    1. Configure SPI module for 16-bit characters. For more information regarding SPI requirements, see the AFE031 Powerline Communications Analog Front-End Data Sheet.
    2. Software example function: HAL_spi_cfg();
  3. Perform a soft reset on the AFE device.
    1. Write 0x14 to the reset register.
    2. Software example function: HAL_afe031_softReset();
  4. Enable the Bias.
    1. Write 0x03 to the enable2 register.
    2. Software example function: HAL_afe031_biasEnable();
  5. Select a Frequency Band.
    1. Write either 1 or 0 to the CA_CBCD bit inside the Control1 Register. If a 1 is written, the frequency response of the TX and RX filters will be configured to CENELEC B,C,D. If a 0 is written, then CENELEC A will be configured.
    2. Software example function: HAL_afe031_bandSelect(1);
  6. Clear all interrupts
    1. Write 0x00 to the control2 register.
    2. Software example function: HAL_afe031_clrAllInt();
  7. Configure all interrupts.
    1. Interrupts can be configured by wrtiting to the control2 register. The software example function currently only enables the T_flag that indicates thermal overload.
    2. Software example function: HAL_afe031_cfgInt();
  8. Enable zc.
    1. Write a 1 to the ZC bit in the enable2 register.
    2. Software example function: HAL_afe031_zcEnable();
  9. Write TX Gain - If Transmitting
    1. Write either a 0, 1, 2, or 3 to the TXG bits in the gain select register. The gains are as follows:
      1. 0 =0.25 V/V
      2. 1 = 0.5 V/V
      3. 2 = 0.707 V/V
      4. 3 = 1 V/V
    2. Software example function: HAL_afe031_writeTxGain(UINT16 gain);
      1. Note that the software example function uses an array to write the 0-3. Thus when using the function, the input parameter corresponds to the indice of the desired HAL_afe031_txGainLut array element. For example passing 0 to the function corresponds to a gain of 0.25 V/V.
  10. Write RX Gain - If Receiving.
    1. Write 0-15 to the RXG bits in the gain select register. The gains range from 0.25 V/V, when RXG is set to 0x0, to 128 V/V, when RXG is set to 0xF.
      1. Refer to the Table 5-1 for specific gains.
    2. Software example function: HAL_afe031_writeRxGain(UINT16 gain);
      1. Note that the software example function uses an array to write the 0-15. Thus, when using the function, the input parameter corresponds to the indice of the desired HAL_afe031_rxGainLut array element. The included array does not have values for all RX gain configurations.

Once the above is complete, begin the final few configurations needed based on the transmit or receive implementation being used.