AnsweredAssumed Answered

AD9912 Problem with Buffer transfer

Question asked by Razal on Feb 16, 2011
Latest reply on Jun 5, 2012 by lds

Hello, I am working with a AD9912 controlled over SPI with a PIC24F.  I can write the live Register directly and read them. I also can write the buffer of the mirrored register and read the Buffer. The new values are in the buffer. Now I make an I/O Update. Read the mirrored register directly and see no chance. Also I have tested software register update, but no transfer from buffer to register. May someone can help me ?

 

example write FTW:

 

    Nop();
    daten = 0x051E;
    Send_SPI( 0x01AB, &daten, 2 , 'w');        //highest 16Bit
    daten = 0xB851;
    Send_SPI( 0x01A9, &daten, 2 , 'w');        //middle 16Bit
    daten = 0xEB85;
    Send_SPI( 0x01A7, &daten, 2 , 'w');        //lower 16Bit
    daten = 0x0020;
    Send_SPI( 0x0011, &daten, 2 , 'w');

 

// read data in buffer 
    daten = 0x0001;
    Send_SPI( 0x0005, &daten, 2 , 'w');
    Nop();
   
    Send_SPI( 0x01A9, &daten2, 2 , 'r');          // result: 0xEB85
    Nop();

 


//////////////////////////////
//Hardware I/O Update
    LATFbits.LATF3 = 1;
    for(i=0; i<1000; i++)
    {
        Nop();
    }
    LATFbits.LATF3 = 0;
//////////////////////////////

 

 

/*
//////////////////////////////
//Software I/O Update
    daten = 0x0100;
    Send_SPI( 0x0005, &daten, 2 , 'w');
    daten = 0xFFFF;
    Send_SPI( 0x0005, &daten, 2 , 'r');
    while( daten != 0x0000 )
    {
            Send_SPI( 0x0005, &daten, 2 , 'r');   
    }
//////////////////////////////

*/

 

// read data in register  
    daten = 0x0000;
    Send_SPI( 0x0005, &daten, 2 , 'w');
    Nop();
    daten2= 0xFFFF;
    Send_SPI( 0x01A9, &daten2, 2 , 'r');               // result: 0x0000
    Nop();
    Nop();

Outcomes