AnsweredAssumed Answered

spi code for adas1000

Question asked by BME>Mostafavi on Sep 13, 2016
Latest reply on Sep 17, 2016 by BME>Mostafavi

HI Everyone

I am using adas1000 for ECG measurement with microcontroller atmega16
after configure ADAS1000 how can i show signal on the output?
my spi code gives me 0 on output
this is a part of my code and I using graphic LCD;

 

 

void ADAS1000_GetValue(unsigned char regAddress,
unsigned long* regVal)
{
unsigned char readData[4] = {0, 0, 0, 0};
// Read the data from the device.
SPI_Read(readData, 4);
*regVal = ((unsigned long)readData[1] << 16) +
((unsigned long)readData[2] << 8) +
((unsigned long)readData[3] << 0);
}

void main(void)
{
ADAS1000_SetRegisterValue(0x01, 0b100000000000000001100110 ); // ECGCTL config
ADAS1000_SetRegisterValue(0x40, 0x00); // Start command
while (1)
{  ADAS1000_GetValue(0x00,reg);
//jj=*reg;
sprintf(buffer, " Pace 2= %i ", jj );
glcd_outtext(buffer);
delay_ms(50);      }  }

 

 

 

Thanks.

Outcomes