Post Go back to editing

ADAR1000 daisy chain works with GUI, but not with Matlab/Arduino SPI commands

Category: Hardware
Product Number: ADAR1000

Using examples from other threads in this forum, I managed to control individual ADAR1000-EVALZ boards with MATLAB, using an Arduino Nano to send the SPI signals.
In this case, the arduino D10-D13 pins are connected to P1's pins 16-19 on the EVAL-board, and the ground pins are connected as well.
This setup can succesfully control the gain and phase settings of all channels, and I've verified that each board only responds to commands with the correct address header (0x00, 0x20, 0x40 or 0x60).

I'd like to control the four boards in a daisy chain, and for that

  • I replaced the shorts R73 and R74 with 50 Ohms, as recommended to avoid damage due to bus contention
  • I gave each of our 4 boards a unique address using P10 (0x00, 0x20, 0x40 and 0x60)
  • Connectors P1 and P2 of adjacent boards are fully connected
  • The first board is connected to a lab supply (3.3V and -5V)

When I use the SPD-S and the ADAR1000 evaluation software GUI, with all of the boards daisy-chained, I’ve been able to manually write commands to each individual chip address, for example:

00 00 81   // Reset all chips
X0 00 18   // Activate SDO for Chip with address X0
X0 2F 7F   // All channels and subcircuits enabled
X0 31 42   // Turn on bias currents Tx
X0 38 60   // Select SPI instead of internal RAM for channel settings
X0 36 2D   // Write bias current settings
X0 37 06   // Write bias current settings
X0 1C 7F   // Set channel 1 gain value
X0 20 36   // Set channel 1 VM value I
X0 21 35   // Set channel 1 VM value  Q
X0 28 02   // Load values from registers

When I apply these manual commands, the bias current starts flowing (approx. 350 mA) and I see that the channel 1 of chip with address 0xX0 activates as expected.

Here's the problem: when I apply the exact same commands through through an Arduino, controlled via Matlab, the daisy-chaining does not seem to work.
Only chip 0x00 will respond to the commands, for chips 0x20, 0x40 and 0x60 the bias current will not even start flowing.

Example code for daisy chain:

ADDR = 0x20;                   % Options: 0x00, 0x20, 0x40, 0x60
a = arduino;
ADAR1000 = device(arduino, 'SPIChipSelectPin', 'D10','BitOrder','msbfirst','BitRate',0.5e6);

writeRead(ADAR1000, [0x00 0x00 0x81]); % Reset all chips in daisy chain
writeRead(ADAR1000, [ADDR 0x00 0x18]); % Activate SDO-pin for requested Chip
writeRead(ADAR1000, [ADDR 0x2F 0x7F]); % All Tx channels and subcircuits enabled
writeRead(ADAR1000, [ADDR 0x31 0x42]); % Current On, enable Tx, control TR through SPI
writeRead(ADAR1000, [ADDR 0x38 0x60]); % Select SPI instead of internal RAM for channel settings
writeRead(ADAR1000, [ADDR 0x36 0x2D]); % write bias current settings
writeRead(ADAR1000, [ADDR 0x37 0x06]); % write bias current settings
writeRead(ADAR1000, [ADDR 0x1C 0x7F]); % set gain value
writeRead(ADAR1000, [ADDR 0x20 36]);   % set VM I
writeRead(ADAR1000, [ADDR 0x21 35]);   % set VM Q
writeRead(ADAR1000, [ADDR 0x28 0x02]); % Load values from registers

I’ve read about the bus contention error, when the SDO pins of all ICs are active at the same time, and I’ve tried to ensure that only the IC being communicated with has an active SDO pin using the following code:

if ~ADDR       %% Use a different procedure for chip ADDR 0x00
     writeRead(ADAR1000, [0x00 0x00 0x18]);    % Activate SDO-pin for all chips in daisy chain
     writeRead(ADAR1000, [0x20 0x00 0x00]);    % De-activate SDO-pin for Chip 2

     writeRead(ADAR1000, [0x40 0x00 0x00]);    % De-activate SDO-pin for Chip 3
     writeRead(ADAR1000, [0x60 0x00 0x00]);    % De-activate SDO-pin for Chip 4
else

     writeRead(ADAR1000, [0x00 0x00 0x00]);    % De-activate SDO-pin for all chips in daisy chain
     writeRead(ADAR1000, [ADDR  0x00 0x18]);   % Activate SDO-pin for requested Chip
end

This made no difference.

I'm stuck, hoping someone here recognizes what the problem can be. Is there something I'm missing, that the GUI / SPD adapter does differently than my implementation of the four-wire SPI commands?

Thank you in advance.

Parents
  • Is the same Arduino used in both cases?  And is the connection the same to the P1 connector on the ADAR1000 board?  My first thought was that the Arduino is only setting the bottom two bytes with your writeRead() function and not setting the top byte that has the chip address bits in it, and that is why you are only able to control Chip 0x00.  But if you are using the same Arduino in both cases, this probably is not the cause?

    I would start by checking the SPI signals with an oscilloscope, particularly the input data line to make sure you are writing what you think you are writing.  I would start with your first case where it sounds like you only have one eval board connected on the SPI bus.  Make sure both the data is OK, and the SPI signals are basically a square wave.  You don't want to see large overshoots are long RC time constants in either case, which could violate the setup and hold times.  I want to make sure having extra chips on the SPI bus & the interconnecting wires between them isn't adding too much parasitic capacitance and inductance, which would degrade the signal fidelity of the SPI signals.

    I am assuming that the Arduino connects directly to the Chip 0x00 board, and then Chip 0x20, 0x40, and 0x60 are connected down the daisy chain line?  A quick check you could do is make the "Chip 0x00" board the "Chip 0x20" board, and vice versa so that the Arduino is first talking to Chip 0x20, then 0x00, 0x40, and finally 0x60.  If you can talk to the new Chip 0x20 and not Chip 0x00, the SPI signal quality is probably degrading as you going down the daisy chain line.

  • Thanks for your response, and apologies for the late reply due to a holiday.

    - The same Arduino is used in both cases, and the top byte seems to be set correctly as the board directly connected to the Arduino will only respond if its corresponding address is used.

    - When checking the SPI signals with an oscilloscope, I see square waves with mild overshoots at the edges. More importantly, I notice that even for a single board the SPI commands aren't processed properly sometimes (in most cases the Tx bias current doesn't even start flowing) when I touch the SPI MOSI line with the 100 MHz-rated oscilloscope probe. I've already limited the SPI to the minimum clock speed of 0.25 MHz. Seems indeed that there is a parasitic loading issue in the SPI lines. 

    - In the daisy-chained scenario, after some testing it indeed seems like the Arduino can only speak with the board it's directly connected to, when it's connected to the first or the last board in the chain (the only ones with an available P1/P2 header). This seems to support the degrading SPI quality along the path.

    - 3 out of my four boards are the 'REV E' version, with an additional pin header P11 to stack the boards and directly connect the SPI traces. Despite the shorter and more direct connection, I could not spot a difference between this connection and the ~7.5cm / 3'' 20-pos ribbon cables I was using before. 

    - Since both interconnect methods (headers & ribbon cables) work fine when I feed the SPI commands from the SPD-S board, I'm suspecting the Arduino or the jumper-wire connection to the first PCB is the main deterring factor. I've tried an Arduino Uno instead of a nano: no difference.

    Update: Whilst writing this reply I was continuously testing and double-checking the steps. For some reason, the Arduino nano seems to be able to control all 4 boards when it's connected to one of the two center boards via the REV-E P11-header. The SPI_SEL_A of one of the outer boards is used, as it is not available on P11. When it's connected to the first or the last board in the chain, only the directly connected board can be addressed.

    While it suddenly seems to work now, I'm not completely convinced yet that it's stable. I'll try a shorter jumper-wire connection from the Arduino tomorrow. Please let me know if you have any other suggestions based on the described results.

    Thanks, and best.

Reply
  • Thanks for your response, and apologies for the late reply due to a holiday.

    - The same Arduino is used in both cases, and the top byte seems to be set correctly as the board directly connected to the Arduino will only respond if its corresponding address is used.

    - When checking the SPI signals with an oscilloscope, I see square waves with mild overshoots at the edges. More importantly, I notice that even for a single board the SPI commands aren't processed properly sometimes (in most cases the Tx bias current doesn't even start flowing) when I touch the SPI MOSI line with the 100 MHz-rated oscilloscope probe. I've already limited the SPI to the minimum clock speed of 0.25 MHz. Seems indeed that there is a parasitic loading issue in the SPI lines. 

    - In the daisy-chained scenario, after some testing it indeed seems like the Arduino can only speak with the board it's directly connected to, when it's connected to the first or the last board in the chain (the only ones with an available P1/P2 header). This seems to support the degrading SPI quality along the path.

    - 3 out of my four boards are the 'REV E' version, with an additional pin header P11 to stack the boards and directly connect the SPI traces. Despite the shorter and more direct connection, I could not spot a difference between this connection and the ~7.5cm / 3'' 20-pos ribbon cables I was using before. 

    - Since both interconnect methods (headers & ribbon cables) work fine when I feed the SPI commands from the SPD-S board, I'm suspecting the Arduino or the jumper-wire connection to the first PCB is the main deterring factor. I've tried an Arduino Uno instead of a nano: no difference.

    Update: Whilst writing this reply I was continuously testing and double-checking the steps. For some reason, the Arduino nano seems to be able to control all 4 boards when it's connected to one of the two center boards via the REV-E P11-header. The SPI_SEL_A of one of the outer boards is used, as it is not available on P11. When it's connected to the first or the last board in the chain, only the directly connected board can be addressed.

    While it suddenly seems to work now, I'm not completely convinced yet that it's stable. I'll try a shorter jumper-wire connection from the Arduino tomorrow. Please let me know if you have any other suggestions based on the described results.

    Thanks, and best.

Children
No Data