Re: ADF4351 boards again


Neil Smith G4DBN
 

Hi Gordon, for the initial tests, I used an Arduino.  The 4351 runs on 3.3V so you have to put in resistors to drop the 5V outputs to 3.3, I used something like 2.1k and 3.3k.

I then coded up a thing to send the right strings to the 4351 using the SPI clock, data and enable pins.

Once I had that sorted and working with the Arduino, I used a PIC12F629 built on Veroboard, with the header pins for in-circuit programming and the sockets connecting to the pins on the 4351 board.  There is a 5V regulator soldered to the tin box near the feedthru.  The coils and caps are one of the 150MHz LPFs.  This was before I added the second LPF.  Sorry I don't have a circuit diagram.



I used the little C program listed below.  I could have run the PIC at 3.3V, but then it cannot be programmed in-circuit, so I did the same with pairs of resistors to drop the voltages.  It waits a bit for things to settle, then programs the chip, then goes into SLEEP mode so there are no spurs and almost zero consumption.  I've done another version using a 12F675 which looks at an analogue voltage level using an A/D input so I can select multiple frequencies with a single pin and some resistors and jumpers, or a pot.

I checked the ISOTEMP OCXO and found the voltage was a little high, so I added in a 3dB 50 ohm pad to drop it to about 2V pk-pk

You can use the utility on the Analog website to calculate the required parameters.
 http://www.analog.com/media/en/evaluation-boards-kits/evaluation-software/ADF435x_v4_5_0.zip



XC8 program running under MPLAB-X IDE

/******************************************************************************/
/* Files to Include                                                           */
/******************************************************************************/
#pragma config FOSC=INTRCIO, WDTE=OFF, PWRTE=ON, MCLRE=OFF, BOREN=OFF, CP = OFF, CPD = OFF
#define _XTAL_FREQ 1000000
///////////////////////////////////////////////////////
//  Change these parameters                          //
///////////////////////////////////////////////////////
#define FRAC 1
#define INT 371
#define MOD 5
#define DIV 32
///////////////////////////////////////////////////////
#define R0 (INT*32768)+(FRAC*8)
#define R1 (0x08008001)+(MOD*8)
#define R2 0x78004E42
#define R3 0xB
#define R5 0x580005
#if DIV == 64
#define DIVX 6
#elif DIV == 32
#define DIVX 5
#elif DIV == 16
#define DIVX 4
#elif DIV == 8
#define DIVX 3
#elif DIV == 4
#define DIVX 2
#elif DIV == 2
#define DIVX 1
#elif DIV == 1
#define DIVX 0
#endif
#define R4 (0x84003C)+(DIVX*1048576)
#define SEN GPIO5
#define SCL GPIO4
#define SDA GPIO2
#if defined(__XC)
    #include          /* XC8 General Include File */
#elif defined(HI_TECH_C)
    #include         /* HiTech General Include File */
#endif

#include         /* For uint8_t definition */
#include        /* For true/false definition */

#include "system.h"        /* System funct/params, like osc/peripheral config */
#include "user.h"          /* User funct/params, such as InitApp */



void send(void)
{
    SCL=1;
    SCL=0; 
}
void SPIsend(uint32_t reg)
{
    SEN=0;
    for(int n=31;n>=0;n--)
    {
        SDA=(reg&0x80000000)?1:0;
        send();
        reg<<=1;
    }
    SEN=1;
    SEN=0;
    SDA=0;
}
void SPIsetup(void)
{
    TRISIO5=0;
    TRISIO4=0;
    TRISIO2=0;
    SCL=0;
}
void main(void)
{
    __delay_ms(1000);
    SPIsetup();
    SPIsend(R5);
    SPIsend(R4);
    SPIsend(R3);
    SPIsend(R1);
    SPIsend(R0);
    SLEEP();
}




Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com


Join UKMicrowaves@groups.io to automatically receive all group messages.