a to d converters
ADC1, ADC2
operational |
|
The input voltage range is 0V to 3VDC max. Ref voltage is filtered from
3.3VDC.
ADC1 and ADC2 are sampled each 1ms using 10bit successive approximation.
If the result is copied to an 8 bit variable, the high order bits are used.
setup( adc )
{
active=12;
//set none, ADC1,
ADC2 or both
calib1=0.4; //set value
to use for calibration/scaling of ADC1
calib2=0.2; //set value to use for calibration/scaling of ADC2
avg1=16; //number of samples read and then averaged for ADC1
avg2=16 //number of samples read and then averaged for ADC2
} |
 |
example usage
//TU480A.MNU Menu file for TU480X272C with single red pen.
STYLE(BlackPg,
Page) { Back=\\00FF66;}
//green background
STYLE(stGraphRed,DRAW){type=graph;
col=red; width=4; maxX=490; maxY=300; curRel=CC; } //red pen for graph
SETUP(
adc ){active=1; calib1=0.2; avg1=8; }
VAR(varADC1,0,U16);
VAR(PixXVal,1,U16);
Page(GraphPage,BlackPg)
{
POSN(240,136);
DRAW(MyGraphRed,480,272,stGraphRed);
LOOP(GraphLoop,FOREVER)
{
LOAD(varADC1,ADC1);
DRAW(MyGraphRed,PixXVal,varADC1);;
IF(PixXVal>478?[LOAD(PixXVal,1);RESET(MyGraphRed);]:[CALC(PixXVal,PixXVal,4,"+");]);
//Move
to next X Pixel
}
}
SHOW(GraphPage);
|
|
|
|
Update Information |
Version |
Title |
Date |
Details |
49.16 |
ADC - Added system variables ADC1VAL, ADC2VAL (U16) to allow direct use of conversion results. |
14 Sep 12 |
|
* Added system variables ADC1VAL, ADC2VAL (U16) to allow direct use of conversion results.
|
|
44.00 |
ADC - Fixed bug related to value calculation |
20 May 11 |
|
Fixed bug related to value calculation
|
|
35.00 |
ADC - ADC functionality added. |
12 Nov 10 |
|
ADC functionality added You can attach 2 variable resistors between 3.3V and 0V with wipers to ADC1 and ADC2 to test
|
|
|
|