Sign in

username:

password:



Not a member?

Search c28x



Search tips

Subscribe to c28x



Discussion Groups

Discussion Groups | TMS320C28x | sample algorithm for hex2dec and dec2hex in F2812

Technical discussions about the TI C28x DSPs (including the C2810, C2811, C2812, F2801, F2806, F2808, F2810,, F2811, F2812, R2811 and R2812).

  

Post a new Thread

sample algorithm for hex2dec and dec2hex in F2812 - naay...@gmail.com - Apr 23 8:20:39 2008



Hi all,

Can any one have sample code to convert hexadecimal ADC result register output value to decimal
output and vice versa?

If so, please send me the sample codes.

Can any one come across this issue?
Thanks in advance

regards
------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
You can post a message or access and search the archives of this group on DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________




(You need to be a member of c28x -- send a blank email to c28x-subscribe@yahoogroups.com )

Re: sample algorithm for hex2dec and dec2hex in F2812 - gopalakrishnan vishal anand - Apr 24 7:25:23 2008

Hi Naayagi,

There's no conversion required for decimal to
hexadecimal and vice-versa. Hexa-decimal and decimal
are representations of the same number. They are just
two different formats. We also have the binary format.

The ADC of TMS320F280x and TNMS320F281x processors is
12-bit and right-justified. What this means is that
even though the result is in the 16-bit result
registers, the first 12 bits are to be used as the
converted code. The range of the ADC is from 0-3V and
the output code varies from 000h-FFFh. But the actual
result in the result register will applear as
0000h-FFF0h. You will have to right shift the result 4
times (using the >> 4 operation) and get the actual
output of the ADC.

For an ADC input of 1V, the ADC code will be =
(1/3)*4096 = 1365.33d. Since the processors are fixed
point, the converted code for a 1V signal will be
1365d. This could also be represented as 555h.

For an ADC input of 2V, the ADC code will be =
(2/3)*4096 = 2730.66d. Since the processors are fixed
point, the converted code for the 2V signal will be
2730d. This could also be represented as AAAh.

Hope this helps.

Thanks,
Vishal

--- n...@gmail.com wrote:

> Hi all,
> 
> Can any one have sample code to convert hexadecimal
> ADC result register output value to decimal output
> and vice versa?
> 
> If so, please send me the sample codes.
> 
> Can any one come across this issue?
> Thanks in advance
> 
> regards

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
You can post a message or access and search the archives of this group on DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________




(You need to be a member of c28x -- send a blank email to c28x-subscribe@yahoogroups.com )

Re: sample algorithm for hex2dec and dec2hex in F2812 - Alain SALMETOZ - Apr 25 6:57:08 2008

Sorry, in my previous reply, I had not understand it was about ADC !
+1, I confirm you don't need !

Envoyé par :    c...@yahoogroups.com
Pour :  n...@gmail.com, c...@yahoogroups.com
cc :     

Objet : Re: [c28x] sample algorithm for hex2dec  and dec2hex in F2812

Hi Naayagi,

There's no conversion required for decimal to
hexadecimal and vice-versa. Hexa-decimal and decimal
are representations of the same number. They are just
two different formats. We also have the binary format.

The ADC of TMS320F280x and TNMS320F281x processors is
12-bit and right-justified. What this means is that
even though the result is in the 16-bit result
registers, the first 12 bits are to be used as the
converted code. The range of the ADC is from 0-3V and
the output code varies from 000h-FFFh. But the actual
result in the result register will applear as
0000h-FFF0h. You will have to right shift the result 4
times (using the >> 4 operation) and get the actual
output of the ADC.

For an ADC input of 1V, the ADC code will be =
(1/3)*4096 = 1365.33d. Since the processors are fixed
point, the converted code for a 1V signal will be
1365d. This could also be represented as 555h.

For an ADC input of 2V, the ADC code will be =
(2/3)*4096 = 2730.66d. Since the processors are fixed
point, the converted code for the 2V signal will be
2730d. This could also be represented as AAAh.

Hope this helps.

Thanks,
Vishal

--- n...@gmail.com wrote:

> Hi all,
> 
> Can any one have sample code to convert hexadecimal
> ADC result register output value to decimal output
> and vice versa?
> 
> If so, please send me the sample codes.
> 
> Can any one come across this issue?
> Thanks in advance
> 
> regards

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables 
developers to start building applications based on the OMAP35x 
architecture:http://www.DSPRelated.com/omap35x
You can post a message or access and search the archives of this group on 
DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________




(You need to be a member of c28x -- send a blank email to c28x-subscribe@yahoogroups.com )