After all, ADC is a widely used and mature thing, and many things have been made, so I will use two or three experiments to describe this thing~
Let me first talk about the introduction of the ADC0808 A/D converter:
1. Introduction to ADC0808
An A/D converter is a circuit chip that can convert input analog voltage or current information into digital information proportional to it. An A/D converter is used to achieve the conversion from analog to digital.
ADC0808 is a typical 8-channel analog input 8-bit parallel digital output successive approximation A/D converter. The converter adopts CMOS technology and can realize time-sharing acquisition of 8 analog signals. There are 8 analog selection switches and corresponding channel address latch decoding circuits on the chip.
1) Introduction of ADC0808 chip
2) ADC0808 pinout
3) ADC0808 workflow
4) Interface with 51 MCU
Basically, that's all. It's very simple, right? I think so too.
Fuck, I spent a lot of time adjusting the program for nothing, just a little error, wasted a lot of time, it's really frustrating~~~
Check out the pictures~~
Since modular programming will be used in the future, it will be convenient for me to call it directly in the future~~~ , this main function:
//------------------------------------------------------------------------------
//Realize the voltage test of the resistor by using ADC0808 as an A/D converter
//The data range of the digital tube display is 0~255
#include"reg52.h"
#include"macroandconst.h"
#include"delay.h"
#include"adc0808.h"
//------------------------------------------------------------------------------
uchar code seg_disp[4]={0x10,0x20,0x40,0x00};
uchar count;
sbit
uchar temp_0=0;
//------------------------------------------------------------------------------
//Timer initialization function
void timer_init()
{
//
}
//---------------------------------------------- ----------------------------------
//main
void main()
{
}
//---------------------------------------- -------------------------------------
//timer0
void timer0() interrupt 1
{
}
//-------------------------- -------------------------------------------------- --
//timer1
void timer1() interrupt 3
{
}
Then comes the initialization function of ADC0808 (I won’t post some auxiliary functions, such as macro definition, software delay, pin definition, etc.):
//------------------------------------------------------------------------------
//file function of adc0808
#include "reg52.h"
#include "delay.h"
#include "macroandconst.h"
//------------------------------------------------------------------------------
sbit START=P3^0;
sbit OE=P3^1;
sbit EOC=P3^2;
sbit CLK=P3^7;
uchar get_data;
uchar temp;
uchar display[3];
//------------------------------------------------------------------------------
//ADC0808 startup and conversion initialization function
void ADC0808_init()
{
}
Previous article:51 single chip microcomputer - DAC0832 - 06 - ①
Next article:Introduction to 89C51 Microcontroller Series
Recommended ReadingLatest update time:2024-11-17 13:50
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Example interpretation of 51 single chip microcomputer complete learning and application
- Example interpretation of 51 single chip microcomputer complete learning and application
- Temperature control alarm designed based on 8051 Proteus simulation-ADC0808
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- [NUCLEO-L452RE Review] + Button control to send a binary signal
- 【Warehouse temperature and humidity automatic control simulation system】2. ON Semiconductor IDE Eat (tian) melon (keng)
- What happened to Tencent?
- The communications industry was once glorious...
- nrf52832 debugging record IO pin configuration
- Add floating point operation library when CCS performs floating point operation
- The second part is about YOC used by RVB2601
- PHILIPS STARplug TEA152X series of high-efficiency, low-power power management devices
- What is Dolby AC-3
- Adding a Raspberry Pi to a NumWorks Calculator