PIC 18 INT & ADC

Average Reading from ADC — PIC INT — Episode #03

J3
Jungletronics
1 min readNov 30, 2019

--

In this project let’s use INTERRUPTION & ADC.

Read 20 sample form ADC and present the arithmetic result in the LCD.
At the end of the conversion, then the Interrupt Indicator Flag will be set (ADIF).

Consequently, as soon as it is set, the program will be diverted for an interrupt routine. (formerly void interrupt_low ()) In this routine, we should do the ADC readings and store the values in a buffer in an amount suggested and when the buffer is full we make the arithmetic mean of the sum of the values in int (10 bits) and display the media on an LCD; Here you will learn how to use UNION \o/

Fig 1. Using interruption to average ADC readings!

That’s it!

In the next episode let’s program ADC interruptions.

See you soon!

Bye!

Related Posts

01º Episode — INT — PIC Unit #05 — The Hello World for Interruptions

02º Episode — INT — PIC Unit #05 — The Hello World for Interruptions

03º Episode — INT — PIC Unit #05 — Using INT with ADC Readings!

--

--

J3
Jungletronics

😎 Gilberto Oliveira Jr | 🖥️ Computer Engineer | 🐍 Python | 🧩 C | 💎 Rails | 🤖 AI & IoT | ✍️