100 likes | 228 Views
Self study assignment AD-converter. Explain in detail how to use the 10 bits AD-converter (PIC16F688 chapter 8) (or PIC16F684 chapter 9). What you need to study?. At least: The general architecture of the PCI controller.
E N D
Self study assignmentAD-converter Explain in detail how to use the 10 bits AD-converter (PIC16F688 chapter 8) (or PIC16F684 chapter 9)
What you need to study? At least: • The general architecture of the PCI controller. • Document about AD-converter, see study material.(different methods for AD-conversion) • Data sheet PIC16F688=> Section study 8.0, completeYou are using the C-language, so it is not necessary to understand the macro instruction in detail. • Don’t forget to search on the internet for additional information.
Include in your self tuition at least the next topics • Figure 8-1, 8-2 • Figure 8-4 global • Register • Table 8-2 Summery of associated ADC registers • 8-1 ADCON0, • 8-2 ADCON1 • ADC result register (ADFM see ADCON0) • ADFM=0: 8-3 ADRESH, 8-4 ADRESL • ADFM=0: 8-6 ADRESH, 8-5 ADRESL • PICkit1 board description, • pot meter: which input?
Questions • What is the role of the Chold “=Holding Capacitor”and SS “=Sampling Switch”see page 67,and 74 • What does VCFG bit select? • How to use the Go/Done bit? • Explain figure 8-2 • See also 8.2.5 and Example 8-1 (in C language, see next sheet) • In our program we need to use the 8 most significant bits of the result.How we can do that? • We are using the 4 MHz internal clock.Which setting for the ADCS<2:0> we will need?
Example 8-1but now in the C language //code snip see data sheet page 70 Uns8 ResultHi, ResultLo ; ADCON1= 0b.0111.0000; //ADC Frc clock TRISA.0=1; //set RA0 to input ANSEL.0=1; //set RA0 to analogue ADCON0=0b.1000.0001; //set right justify, Vdd=Vref, An0, On SampleTime(); //Acquistion delay ADCON.1=1; //Start conversion While(ADCON.1!=0) /*wait until conversion is ready*/ ; ResultHi= ADRESH; ResultLo= ADRESL;
From Reference Manuals for the mid-range MCU Family(document 33023a)