ADRF6704 control program problems, ask for help.

Hello!

I designed and produced the circuit of ADRF670X according to the evaluation  schematic circuit,

The device can work properly ,debug this device by debugging software.

However,

When the controller 68013A  with my own written procedures ,ADRF6704 will not be able to work properly.

I write the main program fragment is as follows:

#define SETCLK                  IOA |= 0x04     

#define CLRCLK                 IOA &= 0xfb    

#define SETDIN                  IOA |= 0x02              

#define CLRDIN                 IOA &= 0xfd    

#define SETLE           IOA |= 0x01     

#define CLRLE           IOA &= 0xfe    

void TD_Init(void)   // Called once at startup

{

         Rwuen = TRUE;        // Enable remote-wakeup                

         //CPUCS = 0x02;  //12MHZ CLKOUT ENALBE  

    //CPUCS = 0x0a;  //24MHZ CLKOUT ENALBE

    //CPUCS = 0x10;  //0001 0000 48MHZ CLKOUT ENALBE

         //CPUCS = (CPUCS & 0xe7) | 0x10; // 48MHz

         CPUCS=(( CPUCS&~bmCLKSPD)| bmCLKSPD1);

         OEA = 0xff;                 //direction bits on portA, All outputs

         IOA = 0x9f;      //SYNC 1, SCLK 0, SDIN 0, LDAC 1, CLR 1, Bin2sC 1, RSTIN 1, CSADC 1

         OEB = 0x00;               //direction bits on portB, All inputs 

         //ContDataReady = FALSE;

         // Here Codes were Writen by FXM at 20130402

//  while(1)

         {

                   delay1us(1000000);

//void Write_SPI(int Bits,unsigned long Word)

//               Write_Control_Word_ADRF6701();

                   Write_Control_Word_ADRF6704();

                   delay1us(1000000);

        }

}

void Write_Control_Word_ADRF6704()

{

////ADRF6704,

///Reference Frequenc=25MHz,

////Center Frequence=2650MHz

//void Write_SPI(int Bits,unsigned long Word)

                   Write_SPI(24,0x000007);         //Write R7 register

                   Write_SPI(24,0x1edd06);         //Write R6 register

                   Write_SPI(24,0x0000e5);         //Write R5 register

                   Write_SPI(24,0x0aa7a4);         //Write R4 register

                   Write_SPI(24,0x70000b);         //Write R3 register

                   Write_SPI(24,0x002202);         //Write R2 register

                   Write_SPI(24,0x003001);         //Write R1 register

                   Write_SPI(24,0x000218);         //Write R0 register

}

void Write_Control_Word_ADRF6701()

{

////ADRF6704,

///Reference Frequenc=25MHz,

////Center Frequence=2650MHz

//void Write_SPI(int Bits,unsigned long Word)

                   Write_SPI(24,0x000007);         //Write R7 register

                   Write_SPI(24,0x1edd06);         //Write R6 register

                   Write_SPI(24,0x0000e5);         //Write R5 register

                   Write_SPI(24,0x0aa7a4);         //Write R4 register

                   Write_SPI(24,0x70000b);         //Write R3 register

                   Write_SPI(24,0x002a02);         //Write R2 register

                   Write_SPI(24,0x003001);         //Write R1 register

                   Write_SPI(24,0x000170);         //Write R0 register

}

  • 0
    •  Analog Employees 
    on Apr 3, 2013 9:57 PM

    I've attached the C code that I use to bit bang the 68013 outputs. Specifically, look for the functions BOOL DR_VendorCmnd(void) and void Write_SPI(unsigned long Word). A lot of the code in here is skeleton code from Cypress, doesn't do a whole lot for my application.

    Unfortunately, I can't spend a lot of time debugging your code, but please let me know if you have questions,

    Steve

     

    SPI.c.zip