How do I write a c++ code on microchip studio to control an ADC 0808 with an atmega328p to light up 8 leds with a potentiometer?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How do I write a c++ code on microchip studio to control an ADC 0808 with an atmega328p to light up 8 leds with a potentiometer?

It is required to build a circuit with a potentiometer and 8 LED indicators.
The potentiometer is a variable resistance which enables the user to
change the voltage signal as desired. You will use Atmega328P to
generate the clock cycles and the control signals required for ADC0808
to operate.
Circuit Operation:
When the user changes the potentiometer, the voltage reading is
converted to a 8-bit digital word to be displayed on the 8 LED indicators.
For example, when the potentiometer is on maximum resistance (i.e.
zero input voltage), all 8 LED indicators are off. When it is on minimum
resistance (i.e. maximum voltage), all 8 LED indicators are on.
●
Hardware Implementation
22 pF
5V
O HOH
22 pF 16 MHz
1
2
3
4
5
6
8
9
10
11
12
13
14
PC6/RESET
PDO
PD1
PD2/INTO
PD3
PD4
VCC
GND
PB6
PB7
PD5
PD6
PD7
РВО
ATmega328P
PC5
PC4
PC3
PC2
PC1
PCO
GND
AREF
AVCC
PB5
PB4
PB3
PB2
PB1
28
27
26
25
24
20
19
18
17
16
15
5V
IN3-1
IN4-2
IN5-3
5
IN6-4
IN7
START-6
EOC 7
25 8
OUTPUT ENABLE-9
CLOCK-10
Voc 11
VREF (+)-12
GND-13
27-14
Potentiometer
28-IN2
27-IN1
26 INO
25 ADD A
ADD B
24
23
22 ALE
ADD C
21-2 MSB
20-2-2
19-2-3
18-2-4
17-2-BLSB
16-VREF (-)
15-2-6
Analog input
ground
+51
signal
Connector Plug
Transcribed Image Text:It is required to build a circuit with a potentiometer and 8 LED indicators. The potentiometer is a variable resistance which enables the user to change the voltage signal as desired. You will use Atmega328P to generate the clock cycles and the control signals required for ADC0808 to operate. Circuit Operation: When the user changes the potentiometer, the voltage reading is converted to a 8-bit digital word to be displayed on the 8 LED indicators. For example, when the potentiometer is on maximum resistance (i.e. zero input voltage), all 8 LED indicators are off. When it is on minimum resistance (i.e. maximum voltage), all 8 LED indicators are on. ● Hardware Implementation 22 pF 5V O HOH 22 pF 16 MHz 1 2 3 4 5 6 8 9 10 11 12 13 14 PC6/RESET PDO PD1 PD2/INTO PD3 PD4 VCC GND PB6 PB7 PD5 PD6 PD7 РВО ATmega328P PC5 PC4 PC3 PC2 PC1 PCO GND AREF AVCC PB5 PB4 PB3 PB2 PB1 28 27 26 25 24 20 19 18 17 16 15 5V IN3-1 IN4-2 IN5-3 5 IN6-4 IN7 START-6 EOC 7 25 8 OUTPUT ENABLE-9 CLOCK-10 Voc 11 VREF (+)-12 GND-13 27-14 Potentiometer 28-IN2 27-IN1 26 INO 25 ADD A ADD B 24 23 22 ALE ADD C 21-2 MSB 20-2-2 19-2-3 18-2-4 17-2-BLSB 16-VREF (-) 15-2-6 Analog input ground +51 signal Connector Plug
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education