dsPIC33F128MC804 getting inclication from ADIS16209

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
pietaL
Posts: 4
Joined: 26 Jan 2010 08:42

dsPIC33F128MC804 getting inclication from ADIS16209

#1 Post by pietaL » 27 Jan 2010 16:33

Hello,

I am new to programming and I am trying to obtain the inclination data from ADIS16209 from analog device. Here is the code:

Code: Select all


int HiByte; 

void readADIS() 
{ 
   _SPI1IP = 4; 
   _SPI1IE = 1; 
   _SPI1IF = 0; 

   SPI1CON1bits.MSTEN = 1; 
   SPI1CON1bits.MODE16 = 1; 
   SPI1CON1bits.PPRE = 0; 
   SPI1CON1bits.SPRE = 2; 
   SPI1CON1bits.CKE = 1; 
   SPI1CON1bits.CKP = 1; 
   SPI1STATbits.SPIEN = 1; 

   _LATB10 = 0;         // Set RB10 as CS pin          
   SPI1BUF = 0x0C;         // Accelerometer's register address 
   _LATB10 = 1; 
    
   _LATB10 = 0; 
   HiByte = SPI1BUF; 
   _LATB10 = 1; 

   HiByte = (HiByte & 0b0011111111111111);       //Strip off the ND and EA flags    
} 

I use the CRO and find that there is signal output from the CS pin and a clock pulse is also generated. However, there is still no response from the accelerometer and no signal can be received. Can anyone help? here is the information of the Accelerometer:

http://www.analog.com/static/imported-f ... S16209.pdf

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”