How does a microcontroller detect a high level?

Publisher:qpb1234Latest update time:2016-03-09 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The problem of IO port detection high point level has troubled me for a long time.

I have been working on a project these days and I feel a little dizzy. I have checked a lot of information and made a summary to share with you:

1. To detect the high and low levels of the I/O port of the 51 single-chip microcomputer, it is necessary to first set the port to 1. Only then is the pin set to input.

2. If it is an AVR microcontroller, you can set the input and output by setting the value of DDRx (see the data sheet for details~~)

3. Do not set the detection port of the microcontroller as input, otherwise it may affect the voltage of the port of the detected module (such as: being pulled down to 0v, or being pulled up)

4. Note that the microcontroller is generally in TTL level mode, so the lowest high level should be 2V, and the highest low level should be 0.8V. (It is safer to refer to the data sheet for details)

Keywords:MCU Reference address:How does a microcontroller detect a high level?

Previous article:Detailed description of the role of 22pf or 30pf capacitors in microcontroller crystal oscillator circuits
Next article:About the function of MCU RAM

Recommended ReadingLatest update time:2024-11-23 11:20

How to set the port of PIC microcontroller
When I was studying this department, I encountered some problems. The PIC microcontroller has few pins, most of which are multiplexed pins, such as AD, IO, comparator, external crystal oscillator, etc. Therefore, when configuring the port, you must know how to set each function to achieve it. In this section, I will t
[Microcontroller]
How to set the port of PIC microcontroller
Design of high-precision temperature measurement system based on single-chip microcomputer
Abstract: The design of a new high-precision temperature measuring instrument composed of a single-bus digital temperature sensor DS18B20 and a single-chip microcomputer is proposed. The structure, characteristics and working principle of the temperature sensor DS18B20 are introduced, and the hardware circuit and so
[Industrial Control]
Design of high-precision temperature measurement system based on single-chip microcomputer
Several common filtering methods for microcontroller ADCs
Nowadays, there are more and more types of sensors, and the number is also increasing, and many of these sensors use analog quantities, and analog quantities are inseparable from ADC. However, the analog quantities collected by our microcontroller ADC will basically be "filtered" before they can be used. Let's share
[Microcontroller]
Atmel AVR Flash Microcontrollers for Motors
Atmel has extended the support of AVR microcontrollers to AC and brushless DC (BLDC) motor control applications, bringing highly flexible and cost-effective solutions to these applications. The excellent performance and comprehensive features of AVR Flash microcontrollers provide designers with the best solution to mee
[Microcontroller]
PC and single chip microcomputer in distributed measurement and control system
1 Remote communication scheme ... ​ ​ ​ ​ ​ In order to achieve smooth communication, two issues should be noted in the design of communication program: first, the correct operation of the Modem to achieve the establishment or Second
[Microcontroller]
PC and single chip microcomputer in distributed measurement and control system
AVR microcontroller drives digital tube display through 74HC595
A very simple simulation of an AVR microcontroller, using a 74hc595 chip to drive a single digital tube to display numbers. The following is the simulation schematic diagram   Source program: #include iom16v.h #include macros.h void delay(int k){          int i=0,j=0;          for(i=0;i k;i++){              for(j=
[Microcontroller]
AVR microcontroller drives digital tube display through 74HC595
PID programming of C51 microcontroller
//Main program============================================== ======== #include “Main.h” #include “PID_f1.h” /* 。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。.. */ /* 。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。..。.. */ void main(void) { float x,y,z; while(1) { x = PID_Control(y,z); } } //P
[Microcontroller]
51 MCU 3 external interrupt sources interrupt response programming example
A system has three external interrupt sources 1, 2, and 3. When an interrupt source becomes low level, the CPU is required to process it. Their priority processing order from high to low is 3, 2, and 1. The entry addresses of the interrupt processing program are 1000H, 1100H, and 1200H respectively. Try to write the m
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号