Hi all,
Could you please tell me how do i perform computation with ADC outputs? I need
to write commands in C. I know that ADC outputs can be accessbile through ADC
result register. Incase if i do some computation with the results in ADC,should
i get the value of ADCresult register in hexa, or binary or decimal?
For example, i want the result of realtime voltage input, it would be in ADC
result register, can i directly use the ADCresult register value by assinging it
as a variable with Uint16 and make use of it in my calculation??? Is the
following command right?
Uint16 V= AdcRegs.ADCRESULT0;
what is the meaning of this command, I saw it in TI's example. Why should
we right shift the results by 4digits.?
Can any one tell me?
Voltage[ConversionCount] = AdcRegs.ADCRESULT1 >>4;
thanks in advance.
regards
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video
Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Accessing the ADC result registers in F2812
Started by ●April 11, 2008
Reply by ●April 13, 20082008-04-13
Hi,
If you check spru060 (nowadays it is on revision D, I believe), you
will see that ADCRESULTn register is a 16 bit register and the first 4
bits (from 0 to 3) are reserved.
The adc conversion is placed on 12 bits: from 4 to 15.
If you use the command you mention "Uint16 V= AdcRegs.ADCRESULT0;",
you are going to have a wrong conversion result. The shift is really
necessary.
Regards
Gloria
--- In c..., naayagi04@... wrote:
>
> Hi all,
>
> Could you please tell me how do i perform computation with ADC
outputs? I need to write commands in C. I know that ADC outputs can be
accessbile through ADC result register. Incase if i do some
computation with the results in ADC,should i get the value of
ADCresult register in hexa, or binary or decimal?
>
> For example, i want the result of realtime voltage input, it would
be in ADC result register, can i directly use the ADCresult register
value by assinging it as a variable with Uint16 and make use of it in
my calculation??? Is the following command right?
>
> Uint16 V= AdcRegs.ADCRESULT0;
>
> what is the meaning of this command, I saw it in TI's example. Why
should we right shift the results by 4digits.?
> Can any one tell me?
> Voltage[ConversionCount] = AdcRegs.ADCRESULT1 >>4;
>
> thanks in advance.
>
> regards
>
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
If you check spru060 (nowadays it is on revision D, I believe), you
will see that ADCRESULTn register is a 16 bit register and the first 4
bits (from 0 to 3) are reserved.
The adc conversion is placed on 12 bits: from 4 to 15.
If you use the command you mention "Uint16 V= AdcRegs.ADCRESULT0;",
you are going to have a wrong conversion result. The shift is really
necessary.
Regards
Gloria
--- In c..., naayagi04@... wrote:
>
> Hi all,
>
> Could you please tell me how do i perform computation with ADC
outputs? I need to write commands in C. I know that ADC outputs can be
accessbile through ADC result register. Incase if i do some
computation with the results in ADC,should i get the value of
ADCresult register in hexa, or binary or decimal?
>
> For example, i want the result of realtime voltage input, it would
be in ADC result register, can i directly use the ADCresult register
value by assinging it as a variable with Uint16 and make use of it in
my calculation??? Is the following command right?
>
> Uint16 V= AdcRegs.ADCRESULT0;
>
> what is the meaning of this command, I saw it in TI's example. Why
should we right shift the results by 4digits.?
> Can any one tell me?
> Voltage[ConversionCount] = AdcRegs.ADCRESULT1 >>4;
>
> thanks in advance.
>
> regards
>
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467