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.

How to use A/D converter with PIC16F877?

Status
Not open for further replies.

Lustosa

Newbie level 3
Joined
Mar 5, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
Help A/D PIC16F877

how I must use converter A/D with 8bits?
 

Re: Help A/D PIC16F877

Rephrase your question, since it is not clear (at least to me) what you want.

You want to convert 8 inputs to digital values?
 

Re: Help A/D PIC16F877

I want to use only one register or ADRESH or ADRESL (8 bits)... is it possible without lose information?
 

Help A/D PIC16F877

It is possible to use only 8 bits, but remember that your Vinput will be just divided by 255 levels because of the 8bit sample size.

Sampling will be done in 10bits but you can discard the two most significant bits. Remember that before you can go to 10 bits data, you must go through 0xFF hex or you must fill all the 8 bits first before data will fill the 9th bit.

No data will be lost.
 

Re: Help A/D PIC16F877

Set bit 7 of ADCON1 (ADFM).
That makes the result left-justified. Then you just use the 8 bits in ADRESH and ignore the two LSB's that will not be stored in positions 7:6 of ADRESL.
This is equivalent to having an 8-bit A/D.
 

Re: Help A/D PIC16F877

use the A/D converter as a 10bits sampler then dive your result by 4. It will remove the 2 LSB and bring your result as an 8bit integer. make sure when you first sample to use a long int variable.

See sample file
 

Re: Help A/D PIC16F877

Please don't be lazy always use the search function before starting a new topic ...



best regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top