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 PIC to build an ADC?

Status
Not open for further replies.

vtshift1

Newbie level 5
Joined
Oct 31, 2005
Messages
10
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,360
Does anyone know how to use PIC to build a ADC?
Please tell me the circuit schematic so that I can know the external components.
 

Re: ADC with PIC

Hi,
about PIC :
1. Configure the A/D module:
• Configure analog pins/voltage reference and
digital I/O (ADCON1)
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
2. Configure A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set PEIE bit
• Set GIE bit
3. Wait the required acquisition time.
4. Start conversion:
• Set GO/DONE bit (ADCON0)
5. Wait for A/D conversion to complete by either:
• Polling for the GO/DONE bit to be cleared
(interrupts disabled); OR
• Waiting for the A/D interrupt
6. Read A/D Result register pair
(ADRESH:ADRESL), clear bit ADIF if required.
7. For the next conversion, go to step 1 or step 2
as required. The A/D conversion time per bit is
defined as TAD.

When yu make ADC convert clock selection must use right devider depending from the work frequency

2 TOSC 000 1.25 MHz
4 TOSC 100 2.5 MHz
8 TOSC 001 5 MHz
16 TOSC 101 10 MHz
32 TOSC 010 20 MHz
64 TOSC 110 20 MHz

don't forget to wait the some time after chanel cange.

This information you can finde in the microchip data sheet for your's mcu.
 

Re: ADC with PIC

neoaspilet11 said:
Hello Tohu,
You forgot what PIC are going to use on your post.

Hello,
i don't was forgot this, if you look in microchip data sheet for many of the processors procedure for ADC service is too same, something more, the ADC use the same address resource, this not for all but for more, special in 16x series. In 18x series the addres if i remember right is a different, but the princip is a too same.
 

Re: ADC with PIC

In my experience the PICs ADCs is not hat bad infact i found that for general purpose stuff I got about a 40us conversion time / channel (including setup and conversion). This compares favorably to ather external ADCs and besides those on the PIC are allready paid for.:D

Cheers
Slayerza
 

Re: ADC with PIC

Hi!
There are a lot of PIC's with built in ADC. If u intend to use the pic only in place of ADC, then use the ones with the smallest package e.g 12F675 (8 pins), 16F676 (14 Pins) etc. Search microchip's site for application notes and u will get lot of information. If u still face problems then post a message i will help u.
Best of Luck.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top