Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C program to read value from ADC

Status
Not open for further replies.

rajesh dubey

Newbie level 3
Newbie level 3
Joined
Mar 13, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
23
write a program in C language to read the value from the ADC continuously on the EasyPic6 board and display the values on the LCD. For example:
Voltage=2.843 V

Write your own routine for reading the result of ADC. Do not use the one in the C library. Make sure RA0 is not used as RXD. Use channel 0 for ADC and make sure the jumper for ADC is on RA0. You may use FRC for ADC clock source if you want. The result of ADC is a 10-bit binary number which means 1023 represents 5V or 5000 mV. Then you should multiply the result of ADC by 5,000 (or a number a little more than 5000 to compensate for the extra resistor in the path of RA0) and divide it by 1023 to get the value of the voltage in mV. Make sure you use RA0 as analog input (ANSEL bit 0).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top