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.

Question on sample code f28004x dac mode for boostxl-afe031

Other Parts Discussed in Thread: BOOSTXL-AFE031, AFE031

Hello,

I have question about the sample code for the boostxl-afe031. Currently, i'm trying to understand this code to create mine for my application. The problem is that i have found some incoherent things on the sample code and the data sheet. 

First about the SPI communication, in the datasheet we have two mode for our SPI communication (0,0) or (1,1) and normally it correspond to the clock polarity and the clock phase. I don't see any hard pin or register to set one of this two mode. But in the sample code, we have the clock polarity at 1 and the clock phase at 0 so it doesn't match with the datasheet. 

Secondly, it's about a function called HAL_spi_writeGain, which correspond to the function used to write the gain on the AFE031. Normally the data should be like this :

 R/W bit - 7-bit Register - 8-bit Data

But in this function (HAL_spi_writeGain) we write in reverse whereas we have macro definition in the hal_afe031.h that work like it is written in the datasheet. 

Also, can you explain me what does the " TEST " pin correspond ?

Regards,

Abed

  • Hi Abed,

    First about the SPI communication, in the datasheet we have two mode for our SPI communication (0,0) or (1,1) and normally it correspond to the clock polarity and the clock phase.

    See section '22.3.6 SPI Clocking Schemes' and 'Figure 22-7. SPICLK Signal Options' of the F28004x device Technical Reference Manual. The description of CLK_PHASE and CLKPOLARITY appears to differ between the two devices. For proper operation, select the desired waveform to determine the clock phase and clock polarity settings.

    I think our F28004x mode (1,0) matches with the AFE031's mode (1,1).

    But in this function (HAL_spi_writeGain) we write in reverse whereas we have macro definition in the hal_afe031.h that work like it is written in the datasheet. 

    I'm not sure what you mean. This function looks like it used 'HAL_afe031_regWrite()' to write to the AFE031's gain register just like the other functions that write to AFE registers.

    Also, can you explain me what does the " TEST " pin correspond ?

    You're meaning 'GPIO_TEST_MODE'? See the code comments below for its purpose:

        //
        // Initialize transmit data buffer based on test mode jumpers, Notes:
        // 1. Test Mode selected with jumper across J6.60-J8.80
        // 2. Tx Mode selected with jumper across J2.20-J4.40
        // 3. Input grounded with jumper installed, otherwise pulled high
        // 4. Pin states inverted in test mode computation (NO jumper='0')
        //    Test Mode   Tx Mode   Function
        //    ---------   -------   --------
        //        0          0      Logic "1" Word (Default, w/NO jumpers)
        //        0          1      Logic "0" Word
        //        1          0      Continuous MARK
        //        1          1      Continuous SPACE
        //

    Best,

    Kevin