10-11-2012 04:58 AM
Of course, the code will work in the full range -10V..10V. It's really simple math.
The value will fluctuate, that's just in the nature of measurements. If you think there is an offset then you can correct for it.
Look at the DMA examples for how to transfer values to the host system.
10-11-2012 05:11 AM
I would just like to say that it is best to do as much calculations and processing using the raw value as possible. This will use less gates (very important in FPGA) and be more accurate. Once you transfer the data to the host, let the host convert into a double. This will give you the best accuracy.
10-11-2012 05:14 AM
hey i am not able to correct it for 2.50....what is the maths behind dis can you please explain it once
10-11-2012 06:21 AM
You shouldn't correct a value just because you expect it to be 2.5V. It's possible that the analog inputs have an offset, but that's usually below a mV for that FPGA card.
How do you know the value is actually 2.50V?
10-11-2012 07:59 AM
actually i measured it via multimeter ...it shows 2.5 v....
10-11-2012 08:04 AM - edited 10-11-2012 08:04 AM
How precise is your multimeter? What's the resolution, 12bits?
If you think your reading is off by -0.01V then add 0.01V to it.
You might also want to think about averaging several readings from the FPGA analog input if you're interested in the DC value. Or use a low-pass filter.