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.

PIC18F4523 ADCON2 Configuration

Status
Not open for further replies.
ADCON2 is basically a analog port selection register. by this register you can select the analog and digital inputs of the multiplexed pins.
 

You are wrong. ADCON2 in PIC18F4523 is used to set the acq time.
 

    rafeeqmpm

    Points: 2
    Helpful Answer Positive Rating
These values are dependent on several factors, including system clock frequency (Fosc), the number of bits and operating temperature.

The Acquisition Time and Conversion Time refer to two very different time periods.


What is the Fosc, the desired number of bits in the ADC and maximum operating temperature of the design?


BigDog
 

    rafeeqmpm

    Points: 2
    Helpful Answer Positive Rating
I don't know about TAD. Please explain it clearly. I am using ext hs osc 20 Mhz. I am trying to implement adc routine in asm and I want to know every detail about adc. https://ww1.microchip.com/downloads/en/devicedoc/39755a.pdf Page 229

My Fosc is 20 MHz
Tad = x/Fosc where x = 2, 4, 8, 16, 32, or 64
if x = 2, Tad = 0.1us
x = 4, Tad = 0.2us
x = 8. Tad = 0.4us
x = 16, Tad = 0.8us
x = 32, Tad = 1.6us
x = 64. Tad = 3.2us

Tcy = 1/Fosc = 1/20 MHz = 0.05us = 50ns

Tosc is 1/(Fosc/4) = 1(20 MHz/4) = 1/5 MHz = 0.2us

The datasheet says, assuming minimum Tad = 0.8us, for 20 MHz Fosc, Tosc = 16Tosc

16Tosc = 16 * 0.2us = 3.2us.

Tacq = 2.96us mentioned in http://ww1.microchip.com/downloads/en/devicedoc/39755a.pdf page 232 last part
Am I right?

Just give me an example for 20 MHz Fosc. What should be the value of ADCON2? I'm using PIC18F4523, 12-bit ADC.

What should be ACQT2-ACQT0 and ADCS2-ADCS0?

All I know is this,

The following steps should be followed to perform an A/D
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 acquisition time (ADCON2)
• Select A/D conversion clock (ADCON2)
• Turn on the A/D module (ADCON0)
2. Configure the A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set GIE bit
3. Wait the required acquisition time (if required).
4. Start conversion by setting the GO/DONE bit
(ADCON0<1>).
5. Wait for the A/D conversion to complete by either:
• Polling for the GO/DONE bit to be cleared
OR
• Waiting for the A/D interrupt
6. Read the A/D Result registers (ADRESH:ADRESL)
and clear the ADIF bit, 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. A minimum wait of 2 TAD is required before
the next acquisition starts.


but I need some help in implementing adc routine in asm.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top