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 PLC Modem

Other Parts Discussed in Thread: ENERGIA, TM4C123GH6PM, AFE031

There is not much explanations about the SPI of AFE031 in the Datasheet or on Internet. Can I have a detailed explanation of how SPI of AFE031 works? I need an example in detail with exact code (Energia and Code Composer Studio) of how data can be sent from TIVA Cseries launchpad  TM4C123GH6PM microcontroller to AFE031 and data can be received by AFE031.

  • Hello Rebanta,

    We do not have code examples specifically for the AFE031.  However, the basic SPI hardware modules built into the TIVA embedded processor you've selected will directly interface with the AFE031.  

    First, configure the SPI clock frequency, clock edge, and phase registers based on the information on pages 11 and 12 of the AFE031 datasheet.  

    There are two basic modes of communication based on the status of the "DAC" pin (pin 7).  

    1.)  DAC pin LOW:  

    When the DAC pin is LOW, the AFE031 communicates over a 4-wire SPI interface as described in the "SERIAL INTERFACE" section of the product datasheet (page 35).  It is a 16-bit protocol with a read/write bit (R/W) followed by a 7-bit address and an 8-bit data word.  An example of this is shown below (top row shows bit index):

    15

    14

    13

    12

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

    R/W

    Address, right justified
    (0x01 would be "0000001")

    Data

    2.)  DAC pin HIGH:

    When the DAC pin is high the data sent over the SPI bus is directed straight to the DAC register without the need for addressing.  This is a 10-bit communication protocol as shown in Figure 35 in the datasheet.  Since most processors send data out in 8-bit increments, configure the processor for two 8-bit words to send out 16-bits to the AFE031.  The first 10 bits will be the DAC data and the 6 LSBs will be truncated and ignored.

    15

    14

    13

    12

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

    Data (10-bit)

    0

    0

    0

    0

    0

    0