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.

AFE8030EVM: override NCO

Part Number: AFE8030EVM

While trying to use the overrideTxNcoSel() and overrideRxNcoSel() we’re facing an issue and will really appreciate your help.

 

Before using it I configure NCO0 and NCO1 frequency with updateTxNcoSb() and then sending the overrideTxNcoSel() command with the parameters (afe_inst, txChSel=0xff,overrideEn=1,overrideVal=1) to switch the 2nd NCO.

Everything looks good on channels 0,1,2,3 but channels 4,5,6,7 remained on the first NCO frequency which means it didn’t switch to the 2nd NCO.

Reading both NCOs frequency was ok – so I assume it is not related to updateTxNcoSb() command.

I tried also to change the chSel to a single channel (for example txChSel=0x10) and it still didn’t work.

 

Any suggestions what could be the problem? (attached the hex file we’re using – we enabled both NCOs for single band)

  • Hello Ohad,

    We have received your request. Our apps team member will return from US holiday after 2/19, and we will be able to respond after Tuesday 2/20. Thank you

    -Kang

  • Hi Ohad,

    One thing to check on this is the NCO TX Mode - you can use the C API function get_ncoTxMode(afeInst, bandNo=0) to check this. If this returns a 0, TX NCO switching will not be enabled.

    From section 9.3 in the config guide, ncoTxMode, numTxNCO, txNco must all be set correctly to enable NCO switching. By default, ncoTxMode may not be set for NCO switching. 

    Please try using the C API command: set_ncoTxMode(afeInst, bandNo=0, val=2), and then run overrideTxNcoSel() and see if this enables the NCO switching for you.

    Please also ensure that numTxNco is set to 2 using the C API get_numTxNco(afeInst, bandNo=0). I believe the txNco should be set as you are using the updateTxNcoSb() function and reading back the NCOs correctly.

    If the above fix does not work for you, could you please try attaching your hex file again? I don't see it attached above. You can either drag and drop it into the reply box, or click Insert → Image/video/file to upload it in a reply on this thread.

    Thanks, 

    Aman

  • Hi,

    This issue has been reproduced on a default config using Latte 2.9.  This is probably a CAPI issue, because we can set the overrides via direct SPI and they work to switch the NCO.  This will be a workaround for you, while we work on the CAPI issue.

    Pls see the  attachment for the override SPi writes.

    regards,

    Ali

    GPIO_writes_for_NCO_switch.txt
    # Switch to NCO1
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x3)
    device.writeReg(0xA49,0x3)
    device.writeReg(0xA4D,0x3)
    device.writeReg(0xA51,0x3)
    device.writeReg(0xA55,0x3)
    device.writeReg(0xA59,0x3)
    device.writeReg(0xA5D,0x3)
    device.writeReg(0xA61,0x3)
    device.writeReg(0x1B,0x0)
    
    # Switch to NCO0
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x2)
    device.writeReg(0xA49,0x2)
    device.writeReg(0xA4D,0x2)
    device.writeReg(0xA51,0x2)
    device.writeReg(0xA55,0x2)
    device.writeReg(0xA59,0x2)
    device.writeReg(0xA5D,0x2)
    device.writeReg(0xA61,0x2)
    device.writeReg(0x1B,0x0)

         

  • Hi Ohad,

    I had provided these SPI writes to Ali earlier, but had mistakenly only given the register writes for TX. Please see the below attachment for register writes for NCO switching for both RX and TX. Sorry about the confusion on this.

    GPIO_writes_for_NCO_switch_RXTX.txt
    # Switch RX to NCO1
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA25,0x3)
    device.writeReg(0xA29,0x3)
    device.writeReg(0xA2D,0x3)
    device.writeReg(0xA31,0x3)
    device.writeReg(0xA35,0x3)
    device.writeReg(0xA39,0x3)
    device.writeReg(0xA3D,0x3)
    device.writeReg(0xA41,0x3)
    device.writeReg(0x1B,0x0)
    
    # Switch RX to NCO0
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA25,0x2)
    device.writeReg(0xA29,0x2)
    device.writeReg(0xA2D,0x2)
    device.writeReg(0xA31,0x2)
    device.writeReg(0xA35,0x2)
    device.writeReg(0xA39,0x2)
    device.writeReg(0xA3D,0x2)
    device.writeReg(0xA41,0x2)
    device.writeReg(0x1B,0x0)
    
    # Switch TX to NCO1
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x3)
    device.writeReg(0xA49,0x3)
    device.writeReg(0xA4D,0x3)
    device.writeReg(0xA51,0x3)
    device.writeReg(0xA55,0x3)
    device.writeReg(0xA59,0x3)
    device.writeReg(0xA5D,0x3)
    device.writeReg(0xA61,0x3)
    device.writeReg(0x1B,0x0)
    
    # Switch TX to NCO0
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x2)
    device.writeReg(0xA49,0x2)
    device.writeReg(0xA4D,0x2)
    device.writeReg(0xA51,0x2)
    device.writeReg(0xA55,0x2)
    device.writeReg(0xA59,0x2)
    device.writeReg(0xA5D,0x2)
    device.writeReg(0xA61,0x2)
    device.writeReg(0x1B,0x0)

    Thanks,

    Aman

  • Hi Aman,

     

    Thank you very much for the fast solution.

     

    I tested the work around and it works fine but now I’m facing another issue.

    I need to switch the NCO of each channel independently but on Tx every time that I switch 1 channel another channel is also switching.

    For example:

    Switch the NCO of ch0 is also switching ch1 , switch ch2 is also switching ch3 and so on.

    It looks like the behavior of Tx NCO mode 1 .

    I looked on the datasheet and it seems like I need to work with Tx NCO mode 2 (correct me if I’m wrong)  but the problem is that when I select it with ncoTxMode  the behavior remains like Tx NCO mode 1.

    Is there anything else I should do ? am I missing something ?

    (Rx is working ok )

    Thanks!

    Ohad

  • Hi Ohad,

    I've looked at this with your hex file on the EVM and see the same result. You are correct in changing to TX NCO mode 2, however it seems like using the C API command set_ncoTxMode() does not work after a bring up - I think this function is just used to change a parameter after loading parameters but before bring up. 

    I can fix this issue on my end by regenerating a hex file after changing the ncoTxMode parameter from [1,0] to [2,0]. This results in a more complicated hex file change than just going in and changing the value, so I'd recommend regenerating the hex file. I'm not sure how you prefer to set parameters, but here are three ways for going about this:

    1. If using Latte GUI: load parameters (can use the hex file), navigate to AFE80xx → Miscellaneous in the left panel (under "Tree View") and change the "TX NCO mode" drop down to 1pin/T.
    2. If using an Excel file: navigate to the "Digital Chain" spreadsheet and change the ncoTxMode parameter Band0 drop down to 1pin/1T.
    3. If using a JSON file: change ncoTxMode parameter to [2,0].

    After this, you can regenerate a hex file with ncoTxMode set to [2,0], which should allow for individual control of the TX NCO switching.  

    Also, I assume you know this based on your previous reply, but you can set the individual channel overrides by running the register writes I provided above individually. For example, the below writes will set TXA to NCO1 and RXB to NCO0. 

    # Set TXA to NCO1
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x3)
    device.writeReg(0x1B,0x0)
    
    # Set RXB to NCO0
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA29,0x2)
    device.writeReg(0x1B,0x0)

    Also, please see below for some register writes to remove the pin overrides (needed if you'd like to use the GPIOs to control the NCO selection):

    # Remove RX NCO select overrides
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA25,0x0)
    device.writeReg(0xA29,0x0)
    device.writeReg(0xA2D,0x0)
    device.writeReg(0xA31,0x0)
    device.writeReg(0xA35,0x0)
    device.writeReg(0xA39,0x0)
    device.writeReg(0xA3D,0x0)
    device.writeReg(0xA41,0x0)
    device.writeReg(0x1B,0x0)
    
    # Remove TX NCO select overrides
    device.writeReg(0x1B,0x1)
    device.writeReg(0xA45,0x0)
    device.writeReg(0xA49,0x0)
    device.writeReg(0xA4D,0x0)
    device.writeReg(0xA51,0x0)
    device.writeReg(0xA55,0x0)
    device.writeReg(0xA59,0x0)
    device.writeReg(0xA5D,0x0)
    device.writeReg(0xA61,0x0)
    device.writeReg(0x1B,0x0)

    I hope this helps, please let me know if you need any more assistance/clarification on this!

    Thanks,

    Aman