Slijedi program za Arduino Nano . Radi se o osnovnom SW koji ne radi ništa posebno već samo na početku upiše registre u ADF4153.
NIže je prikaz slanja registra na osciloskopu i rezultat poboljšanja faznog šuma uključenjem opcije fastlock
o. /*
******************************************************
Sketch for controlling an AD ADF4153 Frac-N synthesiser
over its SPI bus.
This module uses the Arduino SPI library (comes bundled with
the Arduino IDE) to enable communication between an
Arduino program and an SPI enabled peripheral chip.
The routine reads in the hex vales from the sketch and sends
them to the chip. The hex programming values can be generated
in the AD programme "ADF4153-4-6-7 PL Software" which can be
downloaded here
http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-ADF4153.html#eb-overview The SPI library uses pin 13 of the Arduino Uno for clock.
Serial data is sent out on pin 11.
This routine uses pin 10 as the chip select for the
SPI device to be programmed.
add by Luci 9A1Z: it is important to folow the procedure which registers to be programed in which order.
program under this order: R3 empty , R3 real data, R2 real value with reset counter, R1 , R0 , r2 again reset counter off.
Values for 2592,22 MHz / what give x4 10368.880 Mhz >beacon band
LO ref = 20 Mhz
Channel spacing= 10 kHz
Charge pump 2,5
Disable , disable, positive, 24 PFD, disable, lowest noise mode, digital lock detect
Fast lock : Enabled
R3 000003
R3 0003C7
R2 0017C6
R1 145F41
R0 A05318
R2 0017C2
******************************************************
*/
#include <SPI.h> // Links prewritten SPI library into the code
void setup()
{
delay(1000);
pinMode(10, OUTPUT); // Set SPI pins to be outputs
pinMode(11, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(13, HIGH);
SPI.begin(); // Initialize SPI parameters
SPI.setBitOrder(MSBFIRST); // MSB to be sent first
SPI.setDataMode(SPI_MODE0); // Set for SPI Mode 0
//SPI.setClockDivider(SPI_CLOCK_DIV128); // Set clock divider (optional) ovo iskljuci
// See Arduino site or Wikipedia for more info on these settings
// postavljanje frekvencije posebna procedura v vidi PDF strana 19
digitalWrite(10, LOW);
SPI.transfer(0x00); // Do SPI transfer of variable pot R3 reset
SPI.transfer(0x00);
SPI.transfer(0x03);
digitalWrite(10, HIGH);
//delay(1);
digitalWrite(10, LOW);
SPI.transfer(0x00); // Do SPI transfer of variable pot R3 real value
SPI.transfer(0x03);
SPI.transfer(0xC7);
digitalWrite(10, HIGH); // Raise chip-select to 1
//delay(1);
digitalWrite(10, LOW);
SPI.transfer(0x00);// Do SPI transfer of variable pot R2 > reset counter
SPI.transfer(0x17);
SPI.transfer(0xC6);
digitalWrite(10, HIGH); // Raise chip-select to 1
//delay(1);
digitalWrite(10, LOW);
SPI.transfer(0x14); // Do SPI transfer of variable pot R1
SPI.transfer(0x5F);
SPI.transfer(0x41);
digitalWrite(10, HIGH); // Raise chip-select to 1
//delay(1);
digitalWrite(10, LOW);
SPI.transfer(0xA0); ////// // Do SPI transfer of variable pot R0
SPI.transfer(0x53);
SPI.transfer(0x18);
digitalWrite(10, HIGH); // Raise chip-select to 1
//delay(1);
digitalWrite(10, LOW);
SPI.transfer(0x00); // Do SPI transfer of variable pot R2 again counter reset off
SPI.transfer(0x17);
SPI.transfer(0xC2);
digitalWrite(10, HIGH);
}
void loop()
{
// Raise chip-select to 1
delay(100); // Delay loop 1 seconds (pick your time frame)
} // Data will be read and sent once every 1 seconds based on this
JOŠ ĆU MORATI NEKOLIKO PUTA STISNUTI UREDI TE ISPRAVITI GREŠKE A IMAM JOŠ I SLIKOVNOG MATERIJALA.. STIŽE