- 🟡 19:31 Відбій тривоги в Харківська область.Зверніть увагу, тривога ще триває у:- Куп’янський район- Харківський район- Липецька територіальна громада- Вовчанська територіальна громада#Харківська_область
- #1
Работа с AD7714
Работает без инициализации (странно, почему). Как только инициализация чипа пропадают импульсы на DRDY
void InitAD7714()
{
spiWrite( 0x24 ); /* set the channel AIN1-AIN2 and set the next operation as write to the filter high */
spiWrite( 0x6F ); /* set Differencial mode, 24 bits, boost off, all 4 MSBs of filterword to 1 */
spiWrite( 0x34 ); /* set the channel AIN1-AIN2 the next operation as a write to the filter low register channel AIN1/AIN2 */
spiWrite( 0xA0 ); /* max filter word allowed for low part of the filterword */
spiWrite( 0x14 ); /* set the channel AIN1-AIN2 the operation as a write to the mode register.*/
spiWrite( 0x20 ); /* set gain to 1, burnout current off, no filter sync, and do a self calibration */
}
unsigned char spiWrite(unsigned char cData)
{
/* Start transmission */
cs_Low();
delay_us(5);
SPDR = cData;
/* Wait for transmission complete */
while(!(SPSR & (1<<SPIF)));
delay_us(5);
cs_Hight();
return(SPDR);
}
Работает без инициализации (странно, почему). Как только инициализация чипа пропадают импульсы на DRDY
void InitAD7714()
{
spiWrite( 0x24 ); /* set the channel AIN1-AIN2 and set the next operation as write to the filter high */
spiWrite( 0x6F ); /* set Differencial mode, 24 bits, boost off, all 4 MSBs of filterword to 1 */
spiWrite( 0x34 ); /* set the channel AIN1-AIN2 the next operation as a write to the filter low register channel AIN1/AIN2 */
spiWrite( 0xA0 ); /* max filter word allowed for low part of the filterword */
spiWrite( 0x14 ); /* set the channel AIN1-AIN2 the operation as a write to the mode register.*/
spiWrite( 0x20 ); /* set gain to 1, burnout current off, no filter sync, and do a self calibration */
}
unsigned char spiWrite(unsigned char cData)
{
/* Start transmission */
cs_Low();
delay_us(5);
SPDR = cData;
/* Wait for transmission complete */
while(!(SPSR & (1<<SPIF)));
delay_us(5);
cs_Hight();
return(SPDR);
}