Visualizza messaggio singolo
Vecchio 14-03-2006, 14.21.27   #13
Beppe82
Kill the fight !
 
L'avatar di  Beppe82
 

Iscritto da: 07-09-2001
Messaggi: 9,302
Feedback: (0)
ehm scusa, PAG 265 di questo :

http://ww1.microchip.com/downloads/e...doc/39632c.pdf

The following steps should be followed to perform an
A/D conversion:
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 A/D module (ADCON0)
2. Configure 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:
• Set GO/DONE bit (ADCON0 register)
5. Wait for 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 A/D Result registers (ADRESH:ADRESL);
clear bit ADIF, if required.
7. For 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 3 TAD is
required before the next acquisition starts.
Beppe82 ora è in linea   Rispondi Citando

Advertising