4. ADC In ATmega328p
4.1 SpesifikasiATmega328p ADC ATmega328pSpecifications
The ATmega328p (yangused digunakanin padathe Arduino Uno) memilikihas a built-in ADC terintegrasiwith (built-in)the denganfollowing spesifikasi sebagai berikut:specifications:
| 10-bit ( |
|
| Successive Approximation | |
| 8 |
|
| AVcc, Internal 2.56V, |
|
| 50 kHz – 200 kHz ( |
|
| ADCL (low-byte) + ADCH (high-byte) |
4.2 Metode Successive Approximation Method

The ATmega328p menggunakanuses metodethe Successive Approximation Register (SAR). Padamethod.
metodeIn ini,this method, the ADC bekerjaworks denganby caraperforming melakukana pencarian biner (binary search)search terhadapfor nilaithe Vin.Vin value.
PadaAt setiapeach langkah:step:
- The SAR
menetapkansets a trial bitpercobaan - The DAC
menghasilkangeneratestegangana voltage (Vdac) - A comparator compares Vin with Vdac
ComparatorThemembandingkanbitVinisdenganeitherVdackept Bitordipertahankanchangedataubaseddiubahonberdasarkanthehasilcomparisonperbandinganresult
ProsesThis iniprocess diulangis sebanyakrepeated N kalitimes (N = resolusiADC ADC,resolution, yaituwhich is 10-bit untukfor Atmega328p)the ATmega328p).
ContohAn dariexample implementasiof SAR dapatimplementation dilihatcan dibe gambarseen iniin :this image:

DimulaiStarteddarifromnilaithetengahmiddle value (1000)
IniThisadalahisrepresentasithe representation of ½dariof Vref (MSB = 1).PerbandinganFirstpertamacomparison (Comparator)JikaIf Vdac > Vin →bergerakmoveke bawahdown (panahredmerah)arrow)JikaIf Vdac < Vin →bergerakmoveke atasup (panahgreenhijau)arrow)
PenentuanDetermining the next bitberikutnya
EachSetiapsteplangkahdeterminesmenentukanone1additionalbitbit.tambahan.Contoh:Example:1000 → 1100(jikaif Vinlebihisbesar)larger)1000 → 0100(jikaif Vinlebihiskecil)smaller)
ProsesRepeatberulangprocess (Binary Search)
RangeThenilaivalueterusrangedipersempitishinggacontinuouslysemuanarrowedbituntil all bits (MSB → LSB)ditentukan.are determined.HasilFinalakhirresult
NodeThepalingrightmostkanannodesmenunjukkanshow thekodefinalbinerbinaryfinalcode.
ContohExamplehasil:results:1011,0110,dll.etc.