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.

AFE4300: Choose IQ_DEMOD_CLK_DIV_FAC

Part Number: AFE4300
Other Parts Discussed in Thread: MSP430G2553,

Hey guys,

I have a problem using a MSP430G2553 and an AFE4300 Front-End. I would like to use the IQ-Demodulation, but I have some problems with it.

I want to use a measurement frequency of 32kHz and in the datasheet I can read, that I have to set the right bits in the register DEVICE_CONTROL2 (Bits 11-13) to use the IQ-Demodulation. I don't know, what is meant by "devide by x", but I understood, that the frequency of the IQ-Demodulator needs to be the measurement frequency multiplied by 4. Could you help me to chosse the right divider?

Another question would be, how the ADC-values for I and Q will be saved in the result register. When I read the register, how can I seperate the two values?


Thanks for your help!


Best regards,

Simon

  • Hi Simon,

    If you want excitation frequency of 32KHz, then your BCM_DAC_FREQ will be 32KHz and clock for IQ demodulator should be four times of BCM_DAC_FREQ . So CLK for IQ demodulator will be = 4*32 = 128KHz.
    For IQ clock of 128KHz, the divider will be = 1024/128 = 8 (i.e. IQ_DEMOD_CLK_DIV_FAC = 011).

    AFE4300 has only one output register , so based on "PERIPHERAL_SEL" either you will get I value or Q value. Also these will be 16 bits values ( either I or Q).

    Regards,
    Prabin
  • Hey Prabin,

    thanks for your help!

    Ok, to get the I- and the Q-values I have to start the measurement and then use PERIPHERAL_SEL with "00011" and "00101" to get the values? Do I have to measure two times or just one time and then read the result register for PERIPHERAL_SEL=00011 and after that PERIPHERAL_SEL=00101?


    Best regards,
    Simon
  • Hi Simon,

    You have to read twice.
    1) set PERIPHERAL_SEL with "00011" and read the I component.
    2) set PERIPHERAL_SEL with "00101" and read the Q component.

    Regards,
    Prabin
  • Hi Prabin,

    I have another question: during my research I read something like this in code for the AFE4300:

    int result = read(ADC_DATA_RESULT);
    if (result >=32768)
    result -= 65536;

    I don't understand that kind of code, could you help me with this?

    Thanks,

    Simon
  • Hi Simon,

    AFE4300 represents the negative number in 2's compliment binary format.
    Above piece of code is used to convert the ADC output into a signed decimal format.
    For further details please refer to Table 1 of the datasheet.

    Regards,
    Prabin