Other Parts Discussed in Thread: ADS1248
Dear all,
i'm trying to communicate with the ADS1248 by writing one register and read it again, i'd like to know what is the code that i read in read operation is it 8bit as per data sheet or two's compliment of my stored register data?
this code written by CODE Vision AVR tool
conv_en=1; //start goes high
spi_en=0; //spi enable low
spi(16); //SDATAC command
spi_en=1;
delay_ms(2000);
while (1)
{
// Place your code here
spi_en=0;
spi(0x4B); //write ot IDAC1
spi(0x00);
spi(255);
spi_en=1;
spi_en=0;
spi(0x2B); //read IDAC1
spi(0x00);
x=(signed)spi(0xFF)<<8;
spi_en=1;
sprintf(lcd_buf,"%03d",x); //display IDAC1 value on lcd
lcd_gotoxy(5,0);
lcd_puts(lcd_buf);
};



