adc reading value oscillation

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
bmfs
Newbie
Posts: 8
Joined: Fri Jan 23, 2009 2:40 pm

adc reading value oscillation

Post by bmfs » Mon May 18, 2009 9:42 am

Hi,
I\'m using the function EE_trimmer_get_volt() to read an input signal, using reference voltages of 3 and 0. I found one problem.

The read value is oscillating, for example, for a input signal of 2 V the value read is : 2, 2, 3, 2, 2, 3, 3, 2, 2, 2 (one sample per second, during 10 seconds). what might be the problem?

and can the sensor read, for example, an integer value like 2.2? instead of rounding the value to 2?

thanks,
Bruno Santos

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:adc reading value oscillation

Post by paolo.gai » Wed Jun 10, 2009 8:29 am

Dear bruno,

please check the file ee/pkg/board/ee_flex/inc/ee_board.h

The function is returning a float (32 bit value IEEE floating point) which is computed as \"(adcdata * VREF) / 4096\"

where VREF is \"3.3\", because the demo board uses the 3.3 V power supply.

Please check your code, I guess it is a rounding problem.

Ciao,

PJ

Post Reply