I try to compile the ts-7250 program and does not get the exact value as the
power supply value..
Power supply ---> SBC
0.0V ---> 1.567V
1.0V ---> 2.158V
2.0V ---> 2.745V
3.3V ---> 3.430V
Why the full scale need to add with 0x10000?
What is the value 2.5? and is't 3.3 is the Vref?
Why is 0x10000, 0x7000, 0x9E58 and 0xC350 functions?
read_7xxx_adc(adc_result);
if(virgin == TRUE)
printf("No calibration values found...\n");
else
printf("Board has been calibrated by Technologic Systems...\n");
//Convert to voltage
for(i = 0; i < 5; i++)
{
avg = 0;
full_scale = (((((double)(stored_cal[i][1] + 0x10000)
- stored_cal[i][0]) / 2.5 ) * 3.3 ));
for(j = 0; j < 10; j++)
avg = adc_result[i][j] + avg;
avg = avg / 10;
if(avg < 0x7000)
avg = avg + 0x10000;
if(virgin == TRUE) //use approximation
{
avg = avg - 0x9E58;
val = ((double)avg * 3.3) / 0xC350;
}
else //use calibration values
{
avg = avg - stored_cal[i][0];
val = ((double)avg * 3.3) / full_scale;
}
printf("Channel %d: %3.3fV\n", i, val);
}
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|