Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Write to ADF4351

Hello everyone, My goal is to make Labview control 2 ADF4351 boards (chinese).

I have an Arduino uno connected to ADF4351 board using SPI interface. I have Arduino PINS 13,11,9 connected to voltage dividers(560,1k). to bring logic down to 3.3v. 

I followed 6+ webpages explaining how to connect and use the Uno with the ADF4351 and all the .ino files appear to be working. 

 

Next is to emulate this in labview maker hub. In some of those .ino files they use "uint32_t registers[6] =  {0x4580A8, 0x80080C9, 0x4E42, 0x4B3, 0xBC803C, 0x580005} " to be sent through the SPI channel.

I believe these are U32 values.  The input for the "SPI Write Read 1 Frame.vi" appears to be a U8. Now, since I am sending 6 registers (6 u32 indexes) do I use "N frame" instead of "1 Frame"?
I wrote a simple .vi to split the u32 value into 4 u8 values  
My background with SPI is very limited and the last project 4+ years ago used a single u8 value and also used an Aardvark.
Thank you

 

0 Kudos
Message 1 of 3
(325 Views)

Hello,
Your message is quite old, so I don't know if you've already found a solution or not.
In any case, according to the specification sheet, the ADF4251 is organized internally into 32-bit registers, so I imagine that each of the data points you mention corresponds to one of those registers.

The difference between SPI Write Read 1 Frame.vi and SPI Write Read N Frames.vi is that the former sends all the data in sequence, while the latter breaks the data array into sub-blocks of the specified size and sends them one by one in separate SPI frames.

I see two options:
- Convert each u32 into a size 4 u8 array and write each register separately with SPI Write Read 1 Frame.vi (you can create a subVI that takes the u32 data as input and performs the conversion and then the transmission).
- Convert the u32 array into a u8 array and write everything together with SPI Write Read N Frames.vi, specifying “SPI Frame Size” = 4.

Both options should be equivalent and work (without knowing the details of that integrated circuit).

0 Kudos
Message 2 of 3
(47 Views)

The labview task is still on the table. 

For now I wrote a simple Arduino code to just sent the 6x u32 values to the device every time the reset button is pressed. I was originally told I was going to sweep through different frequencies. then after a few days I was then told only 2 static frequencies are used. So makes it tons easier.

 

But eventually I'm sure there will be a project to do more in depth tests. I will take what you mentioned and try it now that I have a working reference.

 

Thank you

0 Kudos
Message 3 of 3
(27 Views)