I am working on a HW with powered up default in FDD mode. In some applications we need to switch to the TDD mode, is there a way to switch from the FDD mode to TDD mode and switch back?
Thanks, we are going to rebuild the kernel and try it.
What SW environment are you using? There are two options -- Linux or the no-os drivers.
Thanks for the reply. I am using Linux driver.
Then moving to the Linux driver support section.
There are various configuration options for TDD mode.
And some require the driver to reinitialize, based on a kernel debugfs value.
(This is what the IIO scope AD9361 advanced plugin does)
Why do you need to switch back and forth?
I'm asking since you could use for example FDD independent mode.
This allows you to turn off the TX or RX while still receiving or transmitting in FDD mode.
I think that your decision greatly depends on the timing you need to meet for the TDD <=> FDD switch. If timing is not a constraint you can re-initialize in TDD mode, but if timing is a constraint you can use FDD Independent mode.
UG-570 offers a more detailed description of this mode on page 28.
I just tried the FDD independent mode.
Before the setting I have the following registers readings from the SPI:
0x13 = 0x01, 0x14 = 0x68, 0x15=0x04, 0x16=0x00, 0x17=0x1A
So I start with setting the FDD independent mode as Force RX ON only by SPI writing:
0x15 = 0x84, 0x14 = 0x48
Then I got the ENSM state = Sleep state (0x17 = 0x10)
To get out of the Sleep State I have to set the Sampling Frequency, then ENSM goes to the Alert State.
Did I mis-understood the setting from page 28 of UG-570?
Please don't use direct register writes.
Please update your system using the adi_update_boot.sh and adi_update_tools.sh script.
In order to do that you need to use the latest SD Card image.
I recently fixed a few issues related to pin control mode and added a new ENSM mode (pinctrl_fdd_indep) described here:
To use this mode - you need to use GPIOs (connected to the ENABLE and TXNRX control pins)
to switch between the states. An example can be view here:
Once you run the update_tools script - sou should have that script in your system as well.
Hope this helps.
Thanks. We are not using FMCOMMS board, we have our own HW with AD9361 on it.
We just updated our kernel last week and when I "cat ensm_mode_available", I can see
"sleep alert fdd pinctrl fdd_pinctrl_indep", looks correct.
I start with the "fdd" mode.
Then I typed "echo fdd_pinctrl_indep > ensm_mode", and "cat ensm_mode", it still shows "fdd" mode.
At that point, I stop to set "ENABLE" and "TXNRX" pins since I am not in the correct ENSM mode.
Do we need another kernel update?
We uploaded a new update. It'll improve TX QUAD cal. But nothing related to this.
Reading the ensm_mode attribute does not necessarily return, what's written to!
There is no STATE called pinctrl*, ...
It returns the real ENSM state as in REG_STATE (0x17).
So in typical FDD mode based on ENABLE you should see ensm_mode showing either alert or fdd.
In independent mode - as long as either RX or TX is enabled it'll show fdd.
It took me a while to figure out which gpio's connected to ENABLE and TXNRX pins. So I did successfully run the srcipt you provide. After I did the following steps:
1. echo fdd_pinctrl_indep > ensm_mode
2. set "high" on the ENABLE (gpio_n1/direction) and "low" on the TXNRX(gpio_n2/direction) , I can see RX ON and TX OFF
3. "high" on TXNRX, I can see both RX/TX are ON
4. "low" on ENABLE, both RX/TX are OFF (???)
On step 4, I expected TX should be still ON since only the RX got turned off, but both are OFF. Do I need more steps to just turn on the TX?
According to the manual - You are right.
I'll have a look.
Found the problem:
In FDD Independent Mode - Enable ENSM Pin Control must not be set.
Otherwise ENSM transitions unintentional to ALERT state.
Fixed with this commit:
drivers/iio/adc/ad9361: Fix FDD independant mode · 83e9c13 · analogdevicesinc/linux · GitHub
With new kernel, the FDD independent mode works fine. I can turn on/off RX/TX independently.
Thanks for the support.
Retrieving data ...