Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 90425

Forum Post: RE: How to read ADC value from LMP90080

$
0
0

Hello Mike,

I tried that (lmp90080) by  using vref=1v(It is constant voltage supply)and gain =8 and for every adc count, I am getting 0.005mv resolution(nearly).

But the adc value not constant though I am using odr=1.6775sps. Adc value is varying continuously with 20 bits range. How to make it stable. 

In thermocouple(R type), for every 0.005mv change gives 1degree variation. In this project we have to measure voltage in 0.005mv range.

So i want to make this with 0.005mv resolution and Constant output.

This is my coding part, Please tell me any mistake is there in my code and Give a solution for my problem.

void ADC_chnl_init(void)
{
ADC_Write(0x10,0x00,0x00,0xC3);//reset
ADC_Write(0x10,0x01,0x02,0x20);//ADC_AUXCN
ADC_Write(0x10,0x01,0x00,0x02);//BGCALCN
ADC_Write(0x10,0x01,0x0F,0x00);//CH_SCAN

ADC_Write(0x10,0x02,0x00,0x08);//ch0_inputcn
// ADC_Write(0x10,0x02,0x01,0x00);//ch0_config gain= 0,odr=1.6775sps
ADC_Write(0x10,0x02,0x01,0x06);//ch0_config gain= 8,odr=1.6775sps
// ADC_Write(0x10,0x02,0x01,0x36);//ch0_config gain= 8,odr=13.42sps;
// ADC_Write(0x10,0x02,0x01,0x76);//ch0_config gain= 8,odr=214.65sps
//ADC_Write(0x10,0x02,0x01,0x30);//ch0_config gain=0;
//ADC_Write(0x10,0x02,0x01,0x70);//ch0_config
ADC_Write(0x10,0x00,0x0B,0x01); //adc restart
}

void ADC_Write(unsigned char cmd1,unsigned char cmd2,unsigned char cmd3,unsigned char cmd4)

{
YRDKRX62N_RSPI_Select(1);//this is for chip select

*addr=cmd1;
ADC_RSPI_Write(addr,1);
// Delay_Mrite_Memory();

*addr=cmd2;
ADC_RSPI_Write(addr,1);
// Delay_Mrite_Memory();

*addr=cmd3;
ADC_RSPI_Write(addr,1);
// Delay_Mrite_Memory();

*addr=cmd4;
ADC_RSPI_Write(addr,1);

YRDKRX62N_RSPI_Deselect(1);//this is for chip deselect
}
void ADC_READING(unsigned char cmd1,unsigned char cmd2,unsigned char cmd3,
unsigned char*read,unsigned char bytes_no)
{
YRDKRX62N_RSPI_Select(1);//this is for chip select

*addr=cmd1;
ADC_RSPI_Write(addr,1);
// Delay_Mrite_Memory();

*addr=cmd2;
ADC_RSPI_Write(addr,1);
// Delay_Mrite_Memory();

*addr=cmd3;
ADC_RSPI_Write(addr,1);
Delay_Mrite_Memory();
ADC_RSPI_Read(read,bytes_no);

YRDKRX62N_RSPI_Deselect(1);//this is for chip deselect
}

void ADC_ch0_sel(unsigned char * data)
{
ADC_Write(0x10,0x02,0x00,0x08);//ch0_inputcn
// ADC_Write(0x10,0x00,0x0B,0x01);//restart
ADC_READING(0x10,0x01,0xAA,(data),2);

}

void Delay_Mrite_Memory(void)

{
uint32_t Dly_Cnt = 0xFFFFF;
while(Dly_Cnt--);
}

In my main function after initilization I am calling "ADC_ch0_sel(unsigned char * data) " function continuously with a delay of 10ms.

Thanks in Advance

Vijay kumar


Viewing all articles
Browse latest Browse all 90425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>