AnsweredAssumed Answered

A question about the ADSP-21479 be a slave device!

Question asked by pingu on May 16, 2011
Latest reply on May 19, 2011 by Mitesh

Dear All :

               I want the ADSP-21479 be a slave device and the ADSP-21479 can recevice the master command and transfer data to master !

Attached file is my sample code!

 

My question is I don't know why ? when I send read command I always need send the command twice ans the data value will be correct !

 

for example :

    To read Data_Temp[2] value(0xcc) ,master send the read command -> 030200

    03 -  INSTR

    02 -  Address                                                         

    00 -  Value - for write command          

                                                            

    // In begin the *pTXSPIB is 0 and  in switch case set *pTXSPIB = Data_Temp[Address] (0xcc)

    // MISO pin measure is 0,but the *pTXSPIB is 0xcc, get fail value(0x00) ?

              

    send the read command aging -> 030200              

    // the *pTXSPIB is 0xcc and in switch case set *pTXSPIB = Data_Temp[Address] (0xcc)

    // MISO pin measure is 0xcc,and the *pTXSPIB is 0xcc, get correct data in this time(0xcc)!

 

    But, continue to read other Data_Temp value

 

    To read Data_Temp[0] value(0xaa)     master send the read command -> 030000

              

    // the *pTXSPIB is 0xcc now and  in switch case set *pTXSPIB = Data_Temp[Address] (0xaa)

    // MISO pin measure is 0xcc,but the *pTXSPIB is 0xaa ,get fail value(0xcc) ?

 

    send the read command aging -> 030000

 

    // the *pTXSPIB is 0xaa and in switch case set *pTXSPIB = Data_Temp[Address] (0xaa)

    // MISO pin measure is 0xaa,and the *pTXSPIB is 0xaa, get correct data in this time(0xaa)!

 

    I don't know why I want to get correct data always need to send the master command twice?

    Where is the problem? Who can tell me?

 

    Thanks !!

Outcomes