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.

AFE5851: Static PGA Mode doesn't write

Part Number: AFE5851

I've been working with getting a AFE5851EVM board connected to custom logic.  I have no issues except programming the TGC; I've only tried setting static gain.

I first set the TGC_REGISTER_WREN bit in reg0, then write the coarse gain at 0x9A and fine gain (and STATIC_PGA bit) at 0x99, then clear the TGC_REGISTER_BIT:

//gain is ((-5 to 31.875)+5)*8

void setGain(uint16_t *g)
{
    spiWrite(0, 1 << 2);
    spiWrite(0x9A, (*g >> 3) & 0x3F);
    spiWrite(0x99, (*g & 0x7) | (1 << 3));
    spiWrite(0, 0);
}

The output of the AFE always stays at the same magnitude, regardless of what is written here!  Any ideas?

  • Hi John,

    Thanks for reaching out and I'm sorry for the delay in response. Somehow this E2E is missed.

    I got your problem, let me go through your settings and think of the possible reason. I will get back to you by tomorrow.

    Thanks & regards,

    Abhishek

  • Abhishek, Thank you.  You are always helpful.

    Also, I do not have contact for you.  We have NDA parts I would like to discuss with you.  Could you send me an email? mowerj@uw.edu

  • Hello Abhishek.  Checking in again. 

    I have used the GUI for the AFE5851EVM and it does what I am doing here.  Writes to the TGC_REGISTER_WREN bit, then the tgc registers, then clears the TGC_REGISTER_WREN bit with zeros. 

    I have not verified performance with a TSW board yet

    I did note that it peculiar that the GUI only allows to write the  coarse gain to -6 to 30 dB when the datasheet states it should be -5 to 31 dB (noting that the GUI is writing hex values 0x00 - 0x24)

  • Hi John,

    It should be -5dB to 31 dB as mentioned in the datasheet. Somehow the GUI shows -6 dB, I looked in the user guide in one of the images. 

    Most likely it is an error. 

    The datasheet plat also shows -5 to 31 dB variation as shown below, which is a measured number.

    I think the GUI will set gain to -5 dB only even if it is saying -6 dB. Of course, you can verify the same with a signal.

    Thanks & regards,

    Abhishek