1.PIC16F876a result register
The 7-bit bit of the ADCON1 status register defines whether the output result is left-aligned or right-aligned. I am confused and don't understand what it is saying. I checked the DataSheet and found the following:
As can be seen from the above diagram, the alignment of the result register is to facilitate us to read the converted data. The diagram is not very detailed, we can take a look at the result register of AD.
The AD result register is 16 bits wide, but six bits are not used, so 10 bits of data are actually read.
2. List of registers related to AD conversion
All registers that control the AD module are shown in the figure below:
AD module basic control registers: ADCON0, ADCON1; mainly manage AD module power-on, clock selection, channel selection, result storage format selection, AD conversion start, etc.
Port configuration register: TRISA, PORTA; mainly defines the analog channel input port and locks the data flow direction (Input=1).
Result saving register.
Related interrupt registers: interrupt master switch, peripheral interrupt control switch, AD interrupt enable, AD interrupt flag;
3. Essentials of AD module design
1. Port configuration:
• Disable pin output driver • Configure pin as analog input pin2
. Configure ADC module:
• Select ADC conversion clock • Configure reference voltage • Select ADC input channel • Select result format • Start ADC module3
. Configure ADC interrupt (can also be polled):
• Clear ADC interrupt flag • Enable ADC interrupt • Enable peripheral interrupt • Enable global interrupt4
. Wait for required acquisition time5
. Set GO/DONE to start conversion.
6. Wait for ADC conversion to end by one of the following methods:
• Poll GO/DONE bit • Wait for ADC interrupt (enable interrupt)
7. Read ADC result8
. Clear ADC interrupt flag (if interrupt is enabled, this operation is required).
Previous article:PIC microcontroller watchdog
Next article:PIC microcontroller (PIC16F877A) perpetual calendar (temperature alarm, year, month, day, hour, minute, second, week)
Recommended ReadingLatest update time:2024-11-17 04:26
- Popular Resources
- Popular amplifiers
- Microgrid Stability Analysis and Control Microgrid Modeling Stability Analysis and Control to Improve Power Distribution and Power Flow Control (
- Signal and System Experiment Tutorial (Edited by Jin Bo)
- Effective Unit Testing (Lasse Koskela)
- Operational Amplifier Practical Reference Handbook (Edited by Liu Changsheng, Zhao Mingying, Liu Xu, etc.)
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
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- How to implement the function?
- Configuration and use of TMS320F28379D SCID SCIB
- About DSP clock and PLL issues
- [ESP32-Audio-Kit Audio Development Board Review] 4. Install the Arduino environment and turn on the light
- Early Review | GigaDevice GD32L233 Evaluation Board, Opening the Era of Energy-Saving "Chips"!
- STM32 embedded technology application development full case practice
- EEWORLD University Hall----Live Replay: Mouser&TE Unlocks New Technologies for Smart Home Components and Explores Connectivity Technology
- How to select filter capacitors?
- Domestic simulation software recruits part-time test engineers
- [Anxinke UWB indoor positioning module NodeMCU-BU01] 04. Transplantation preparation: Familiar with the source code