[MODULE]/AD/DA2018.02.25 07:07

Analog Devices 16Bit ADC AD7606 테스트

Analog Devices 16Bit ADC AD7606 테스트



RESET 핀

Reset Input. When set to logic high, the rising edge of RESET resets the AD7606/AD7606-6/AD7606-4. The device should receive a RESET pulse directly after power-up. The RESET high pulse should typically be 50 ns wide. If a RESET pulse is applied during a conversion, the conversion is aborted. If a RESET pulse is applied during a read, the contents of the output registers reset to all zeros.






클럭 나오는것 까지 확인 

AD쪽에 +-15V가 필요하다



AD7606 핀맵 정의


//------------------------------------------------------------------------------

//ADC AD7606 Driver

#define AD7606_CS_HI()       (LATD |= BIT0)

#define AD7606_CS_LO()       (LATD &= ~BIT0)


#define AD7606_RST_HI()       (LATD |= BIT1)

#define AD7606_RST_LO()       (LATD &= ~BIT1)


#define AD7606_START_HI()       (LATD |= BIT2)

#define AD7606_START_LO()       (LATD &= ~BIT2)


#define AD7606_CS_INIT()     (TRISD &= ~BIT0)

#define AD7606_RST_INIT()    (TRISD &= ~BIT1)

#define AD7606_START_INIT()    (TRISD &= ~BIT2)

#define AD7606_SPI_INIT         SPI1_Init

//------------------------------------------------------------------------------





AD7606 Data Read 코드


void AD7606_ReadBuf(short *pBuff)

{

    AD7606_START_LO();

     Delay_Us(10);

     AD7606_START_HI();


     AD7606_CS_LO();

     pBuff[0] = SPI1_WriteReadByte(0);

     pBuff[0] |= SPI1_WriteReadByte(0)<<8;


     pBuff[1] = SPI1_WriteReadByte(0);

     pBuff[1] |= SPI1_WriteReadByte(0)<<8;


     pBuff[2] = SPI1_WriteReadByte(0);

     pBuff[2] |= SPI1_WriteReadByte(0)<<8;


     pBuff[3] = SPI1_WriteReadByte(0);

     pBuff[3] |= SPI1_WriteReadByte(0)<<8;

     

     //-----------------------------------------

     pBuff[4] = SPI1_WriteReadByte(0);

     pBuff[4] |= SPI1_WriteReadByte(0)<<8;


     pBuff[5] = SPI1_WriteReadByte(0);

     pBuff[5] |= SPI1_WriteReadByte(0)<<8;


     pBuff[6] = SPI1_WriteReadByte(0);

     pBuff[6] |= SPI1_WriteReadByte(0)<<8;


     pBuff[7] = SPI1_WriteReadByte(0);

     pBuff[7] |= SPI1_WriteReadByte(0)<<8;      

     AD7606_CS_HI();

}


Posted by nexp
TAG ,

댓글을 달아 주세요