This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE031 receiving data

Other Parts Discussed in Thread: AFE031

Dear colleagues,

I'm trying to make PLC communication between two PLC modems based on AFE031. I connected everything in accordance to TI app note document sboa130a.pdf. I succesfully configured IC via SPI interface and also successfully used DAC to send the data (When I write something in DAC the voltage which represent written data is present on TX_PGA).

After that, next step is to receive the data from AFE031 on microcontroller ADC. There I have some problems. I configuredAFE031 in RX calibration mode, which means that all the data I'm sending to AFE031 DAC are bridged to the AFE031 receiver module. The problem is that I don't understand how to synchronize transmitted and received data.

I will write some questions I have below:

1) When is the time to sample received data on the microcontroller ADC? AFE031 doesn't have an interrupt output which will signal that some new data is ready to be received via microcontroller ADC input. How to know when is the time to expect the data which is sent from another modem in network?

2) How to interpret the data? Do I have to read the voltage on PGA2_OUT and make conversation to digital form? The number I'm geting after the ADC is the number I sent, am I correct? For example, I want to send 0xFF (255 Decimal). If we except gain and if I'm using 10bits resolution of ADC and 3.3V AGND, the voltage which I will get on ADC input is 3.3V / 1024 * 255 = 0.821V, is this calculation is correct?

I will give you some more details about what I'm doing.

REGISTERS:

ENABLE1                   0x0127 //enable TX, RX, DAC, PA

ENABLE2                   0x0307 //enable ZC, REF1, REF2

GAIN SELECT           0x0232

CONTROL1                0x0402 //RX calibration mode Control 1 reg

After configuring the AFE031 as is shown above I read and checked the values of registers, and they are stored correctly.

Then I toggle DAC pin of AFE031 to HIGH state, and send the data over SPI in zero bit mode. I always sending 2x10 bits as you can see on given images.

Below you can find the signals captured on SCLK (pin 3) and RX_PGA2 (pin 20) when I'm sending 0x1111, 0x5522, 0x0000, 0xFFFF.

Sending 0x1111

Sending 0x5522

Sending 0x0000

Sending 0xFFFF

The signal on RX_PGA2 (blue one) is a bit strange for me. How is this signal in conjunction with the signal I sent?

I hope that I give enough information's. If you need some more details, do not hesitate to ask me.

Best regards.

  • Hello Miroslav Bozic,

    Regarding

    Miroslav Bozic
    The problem is that I don't understand how to synchronize transmitted and received data.

    There is no inherent mechanism to synchronize transmitted and received data at the AFE031 (physical layer) level. Synchronization of the received data in most PLC applications for automated metering depends on the type of modulation scheme used. For example, in narrowband OFDM the synchronization is performed in two steps:

    1) The transmitter sends a preamble signal (for example a succession of interleaved up-chirps) with very specific characteristics (length, initial frequency and frequency ramp rate, etc.).

    2) The receiver has a preamble detection routine that extracts frequency and phase information from the preamble.

    After the preamble, there is typically a frame control header followed by a MAC header, a series of payload symbols and the transmission is finalized with a frame check sequence. Except for the preamble, all other symbols in a transmission are differentially decoded through their phase (an FFT is performed to obtain the phase in each carrier).

    Note that the AFE031 performs none of the symbol creation operation; its job is to transmit onto a power line the symbols transmitted to its DAC. The preamble, frame control header, MAC header, payload symbols and frame check sequence are all created in the microcontroller in charge of implementing the MAC layer of the modem.

    Regarding

    Miroslav Bozic
    1) When is the time to sample received data on the microcontroller ADC? AFE031 doesn't have an interrupt output which will signal that some new data is ready to be received via microcontroller ADC input. How to know when is the time to expect the data which is sent from another modem in network?

    The time to expect data to be received via the microcontroller ADC input is any time the modem is not transmitting. In other words, every modem in the network should be set to receiver mode every time it is not actively transmitting; otherwise the modem runs the risk of missing a data packet addressed to it. This question is more related to the architecture of your PLC network rather than the AFE031 per se. There are different types of network architectures. For example, the G3 standard forms a “mesh” PLC network in which there could be multiple paths to transfer information between two non-adjacent nodes. PRIME is, for example, another standard that creates a “tree” network in which certain modems operate as switch nodes and some others as terminal modes. Depending on the topology of the network there may be periods of time when certain modems in the network are commanded to transmit information. That is the point in time when the controller in charge of the AFE031 would be commanded to switch the modem from receiver to transmitter.

    Regarding

    Miroslav Bozic
    2) How to interpret the data? Do I have to read the voltage on PGA2_OUT and make conversation to digital form? The number I'm geting after the ADC is the number I sent, am I correct?

    For a typical OFDM PLC modem, the process is as follows: the ADC will be continuously acquiring data. Once the microcontroller identifies the reception of a preamble, it transitions to the process of demodulating the received symbols.

    Symbol length and encoding depends on the standard you are implementing but in general the microcontroller will acquire a given number of samples (for example 512), then it performs an FFT onto these 512 samples. The modem should know the frequency of the tones used in the network; therefore, out of the 256 frequency components it obtains as a result of the FFT, the modem selects a subset of carries ( suppose for example the system uses 36 carriers). The microcontroller looks at the phase (angle of the FFT operation) of the 36 subcarriers selected and compares it to the angles from the previous symbol. The angle difference for each carrier is mapped to a specific bit sequence depending on the type of modulation (for example DBPSK, DQPSK, D8PSK, etc.) With this in mind, the modem obtains either 36, 72, or 144 bits of raw information for the 512 time-domain samples acquired by the ADC and processed by the microcontroller. (Note that there is nothing magic about the 512 or 36 numbers; I chose them just to exemplify with concrete numbers).

    Note that information is carried in the phase difference between two consecutive symbols and not in the amplitude of the signal.

    The output of the Tx_PGA is given by the following equation.

    The output after any other gain stage will be the Tx_PGA_OUT value multiplied by the corresponding gain.

    In order to properly receive data the AFE031 needs to be in receiver mode; it cannot be place in calibration mode. The only purpose of calibration mode is to verify the gains in the signal chain.

    Hope this helps.

    Best regards,

    Jose

  • Hi Jose,
    now it's clear what I have to do. Thank you very much for answering.

    Maybe is good idea to put some of your post in afe031 datasheet and application note. I didn't find any of this information in datasheet.

    Best regards.
  • Hello Miroslav Bozic,

    You are very welcome; I'm glad that it helped and thank you for the suggestion.

    Best regards,

    Jose