AnsweredAssumed Answered

Problem in getting data from ADIS16209

Question asked by pietaleung on Feb 17, 2010
Latest reply on Jan 29, 2014 by NevadaMark

Dear all,




I am new to programming and I am trying to obtain the inclination data from ADIS16209 using the MCU dsPIC33FJ128MCX04 from Microchip . Here is the code:


void ADISSetup(void) {      SPI1CON1bits.MSTEN = 1;      SPI1CON1bits.MODE16 = 1;      SPI1CON1bits.PPRE = 0;      SPI1CON1bits.SPRE = 2;      SPI1CON1bits.CKE = 1;      SPI1CON1bits.CKP = 1;      SPI1STATbits.SPIEN = 1; } void readADIS(void) {           SPI1BUF = 0x0C00;               // Accelerometer's register address      SPI1STATbits.SPITBF = 1;           if (SPI1STATbits.SPITBF != 1)      {      SPI1STATbits.SPITBF = 1;      }      while (SPI1STATbits.SPIRBF !=1){}      HiByte[0] = SPI1BUF;      HiByte[1] = SPI1BUF;      HiByte &= 0b0011111111111111;           //Strip off the ND and EA flags           SPI1STATbits.SPIRBF = 0; }


I am not so clear about the way to obtain the data about the x-axis inclination from the accelerometer using SPI modulation. Is there anything left in the above functions?


here is the information of the Accelerometer:


the datasheet of the MCU dsPIC33FJ128MCX04


the reference manual of the MCU


Hope anyone can give me a hand in solving this problem. Thank you very much for your help. Besides, I am new to this forum and I am not so clear about which category should this topic be in. Thanks for you guys help again.