ADF4002 Using Problem

Hi,

I'm using STC52 micro processors to write numbers to ADF4002 registers.

the code are below

#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
#define ulong unsigned long
sbit SCLK = P0^0;
sbit DATA = P0^1;
sbit LE = P0^2;
void delay(uint);
void initialization();
uint counter;
uint state;
ulong data_transfer;
ulong data_reg[]={0x000D80B3,0x000D80B2,0x00000201,0x00000004};//initialization latch; function latch;N divider latch; R divider latch;
void main()
{
initialization();
 while(1)
 {
 	delay(10);
 	if(data_transfer & 0x800000)
		DATA = 1;
		else DATA = 0;
	
	if(SCLK == 1)
		data_transfer = data_transfer << 1;

	counter++;
	switch(counter)
	{
		case(48):
			SCLK = 0;
			LE = 1;			
			break;
		case(49):
			LE = 0;
			SCLK = 0;
			counter = 0;
			
			switch(state)
			{
			case(0):
				{
				state = 1;
				data_transfer = data_reg[1];
				break;
				}
			case(1):
				{
				state = 2;
				data_transfer = data_reg[2];
				break;
				}
			case(2):
				{
				state = 1;
				data_transfer = data_reg[3];
				break;
				}
			}
		break;
	default:
		{
		LE = 0;
		SCLK = ~SCLK;
		}
	}
 }
}

void delay(uint x)
{
	uint i,j;
	for(i=x;i>0;i--)
		for(j=100;j>0;j--);
}

void initialization()
{
SCLK = 0;
LE = 0;
DATA = 0;
data_transfer = data_reg[0];
counter = 0;
}

I have checked the output in debug session in keil 4.

when i download the program to the microchip, the ADF4002 didn't perform in the right way, where i use 45 MHz @ 0 dBm as RFin and 89-91 MHz@ 0 dBm in sweeping mode

the output was zero forever, I'm so confused now...

Parents Reply Children
No Data