PIC 18 ADC - Intro to Analog-to-digital Converter

Let’s Read a Tripot — PIC Unit #03 — ADC— Episode #01

J3
Jungletronics
2 min readNov 27, 2019

--

The world we live in is analog. We are analog. Any inputs we can perceive are analog. For example, sounds are analog signals; they are continuous-time and continuous value. Our ears listen to analog signals and we speak with analog signals. Images, pictures, and videos are all analog at the source and our eyes are analog sensors. Measuring our heartbeat, tracking our activity, all require processing analog sensor information. ( Peter Kinget is a Professor of Electrical Engineering at Columbia University in New York)

So, here we initialize a new series episode: ADC — Analogue to Digital Converter.

All modern microcontroller nowadays presents analog converter.

ADC in PIC Microcontroller (PIC18F4520 or PIC18F45K22) The ADC is a successive approximation ADC with a resolution of 10 bits. The resolution indicates how much the reference voltage can be divided. For a 10 bit resolution ADC, it is possible to divide up to 1024 (2¹⁰) voltages

There is a nice LIB on mikroC PRO for PIC, but for now let’s just use the datasheet of PIC18F4520 and configure the registers ADCON0, ADCON1, and ADCON2.

Fig 1. ADC AN0 Tripot reading

And that’s it!

In the next ADC episode, we’re gonna make a program to read two ADC channels programmatically.

See you there!

Related Posts

01º Episode — ADC — unit#01 — ADC Intro — Let’s Read a Tripot

02º Episode — ADC — unit#01 — ADC Choosing Channel — Let’s Read a Tripot

03º Episode — ADC — unit#01 — ADC Formatting Numbers — Let’s Format numbers?

04º Episode — ADC — unit#01 — ADC A Cool Voltmeter! — Creating a voltmeter using PIC18F!

05º Episode — ADC — unit#01 — ADC Floating Numbers! — Faking floating numbers using PIC18F!

Credits & References

Why put in the time and effort to learn Arduino properly? by J3

The World Is Analog by Peter Kinget

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!