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.

AFE7903: Unexpected SPIWrite usage in log files

Part Number: AFE7903


As suggested we use the log files generated by Latte to configure the AFE7903.

We are debugging some problems and are struggling with register values that are not as we expect.

In the AFE79XX Latte GUI Application Note you describe the use of the SPIWrite with the possibility to change only specific bits with the LSB and MSB parameter. Also this feature is implemented in your library. But the generated log file don't use this feature. Instead it writes to the same register multiple time without adjusting the LSB or MSB parameter. But the comment says that this command only changing some bits.

SPIWrite 00bc,e7,0,7 //tdd_tx_on_a_2t_ab_mux_sel=0x3; Address(0xbc[7:0])
SPIWrite 00bc,e7,0,7 //tdd_tx_on_b_2t_ab_mux_sel=0x1; Address(0xbc[7:2])
SPIWrite 00bc,e7,0,7 //tdd_tx_on_c_2t_ab_mux_sel=0x2; Address(0xbc[7:4])
SPIWrite 00bc,27,0,7 //tdd_tx_on_d_2t_ab_mux_sel=0x0; Address(0xbc[7:6])

This behaviour is not as expected, but can be ok if the former value of the register is always kept in mind. Is this as expected? Implementing and documenting such a feature and the never use it scares me a little bit. And by the way, it's highly ineffective to write the same register multiple times instead once.

Also adding

device.optimizeWrites =1

to the scripts didn't change a lot.

Is the behaviour we see ok and intended?

  • Hi Christian,

    Currently that is the way it is shown in the log so there should not be an issue related to performance, but I will reach to the software team to see if there is a specific reason as to why it is done this way.

    Best,

    Camilo

  • Hi Christian,

    I heard back from the software team and it seems like there is a problem in the current Latte that causes the bit fields in the comments to not be correct. This will be fixed in the next release. So, the correct values are as follows:

    SPIWrite 00bc,e7,0,7       //tdd_tx_on_a_2t_ab_mux_sel=0x3;       Address(0xbc[1:0])

    SPIWrite 00bc,e7,0,7       //tdd_tx_on_b_2t_ab_mux_sel=0x1;      Address(0xbc[3:2])

    SPIWrite 00bc,e7,0,7       //tdd_tx_on_c_2t_ab_mux_sel=0x2;       Address(0xbc[5:4])

    SPIWrite 00bc,27,0,7       //tdd_tx_on_d_2t_ab_mux_sel=0x0;      Address(0xbc[7:6])

    In regards to your observation that the log is writing the same register multiple times, it is as per expectation since this is the sequence in which these writes are called from our library.

    The SPIWrite command always specify the LSB and MSB as 0 and 7 since the SPI writes are 8 bits. There can be cases where specific bits can be specified in SPIWrite commands like “SPIWrite 00bc,e7,0,2” but in those cases the SW would have to first read back the current register value of register 0x00bc, store it somewhere, change only the bit 0 and 1 of that value and then write back the modified value on the register 0x00bc. This is done usually only for registers where we expect the FW to write something to avoid conflicting overwriting the values written by FW. But this register is not one of those.

    And, they have advised to avoid using the “device.optimizeWrites =1” for now as it still needs to be tested for some corner cases.

    Best,

    Camilo

  • Hi Camilo

    Thanks for the clarification.

  • Hi Christian,

    No problem.

    Best,

    Camilo