PBL_AST

Problem AD9833

Discussion created by PBL_AST on Mar 6, 2015
Latest reply on Mar 9, 2015 by PBL_AST

Hi all,

 

I am trying to create an application with AD9833 and i can´t change frequency. I think my problem is in the inicializaciton process. When I send Reset command to device it start generating an output signal even without release reset bit.

 

My code for  inicializacion is:

 

unsigned char AD9833_Init(short modulo){

 

        EscribeCMD(0x2100);            // D28=1 / RESET=1

        EscribeCMD(0x2000);

      

    return (1);

}

 

and

 

void EscribeCMD(unsigned short modulo, int cmd){

    unsigned short i=0;

    int aux=0;

   

    FSYNC=0;

   

    for(i=0;i<16;i++){

        aux=(cmd&(0x8000>>i))>>(15-i);

        SDATA=aux;

        __delay_us(1);

        SCLK=0;

        __delay_us(5);

        SCLK=1;

    }

 

    SDATA=1;

    SCLK=1;

    FSYNC=1;

 

    return;

}

 

I think my signals in scope are correctscope_0.png

 

this is the reset comand, after this AD9833 start to generate an output signal

Outcomes