Author Topic: F2812 ADCRESULT  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

Offline orchidTopic starter

  • Full Member
  • ***
  • Posts: 54
  • Helpful? 0
F2812 ADCRESULT
« on: February 14, 2008, 10:13:35 PM »
I am using TMS320F2812 motion kit.

Is there any one that know the type of value that i get from adc watch window using ccs? For example 0x2A04.

Is it in HEX? If it is in HEX, is there someone can tell me how to convert it so that i can view the value in Volt?

Hope someone can help me..

Thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: F2812 ADCRESULT
« Reply #1 on: February 16, 2008, 06:22:29 PM »
http://www.societyofrobots.com/robot_faq.shtml#read_datasheet
http://focus.ti.com/docs/prod/folders/print/tms320f2812.html

Quote
If it is in HEX, is there someone can tell me how to convert it so that i can view the value in Volt?
google for HEX to Decimal converter

then to convert to voltage . . .

lets say its 16 bit, that means it counts up to 65536

then do:

voltage = reading/65536*5V

Offline orchidTopic starter

  • Full Member
  • ***
  • Posts: 54
  • Helpful? 0
Re: F2812 ADCRESULT
« Reply #2 on: February 17, 2008, 07:55:44 PM »
Can u help me with the source code? how to write it and where can i insert the source code. I've asked someone before about this matter and she gave me this equation,

                                                                     Vin = (D*3)/4095

where D is Digital output that get from ADC watch window, Vin is input voltage.


The equation that you give me, when i use it, the answer is almost the same as the reading when i use multimeter to measure the output. i got the output in range for example 0700-0A00 and when i converted it using your equation i get 0.137-0.195V. is it correct?

Thanks Admin

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: F2812 ADCRESULT
« Reply #3 on: February 18, 2008, 09:47:02 AM »
I don't know how to convert hex to decimal in C code, but I'm sure a programmer reading this could . . . (hint hint). Or google. I have no idea where your friend got that equation from.

But otherwise, yea your output voltage is correct. If you want to get a bit more accurate, change the 5V to the exact voltage that goes into your IC (probably the output of your 5V regulator, perhaps 5.01V for example). To avoid the range, put a small cap like a .1uF ceramic across power and ground of your IC.

Offline orchidTopic starter

  • Full Member
  • ***
  • Posts: 54
  • Helpful? 0
Re: F2812 ADCRESULT
« Reply #4 on: February 18, 2008, 07:26:29 PM »
I got it.

Thanks for your help....

 


Get Your Ad Here