AVR MCU IO usage details overview

Publisher:MysticalGardenLatest update time:2019-12-16 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  The main content introduces the detailed usage of AVR microcontroller IO


  The relationship between the AVR microcontroller register DDRx PORTx PINx and the corresponding IO port (x represents a port, such as port A, port B, etc.)


  The following table uses the second bit PB2 of port B as an example and assumes that PB2 is floating.

DDRB.2PORTB.2Read the result of PINB.2Status of pin PB2
111PB2 push-pull output 1
100PB2 push-pull output 0
011PB2 weak pull-up, can be used as input
00×PB2 high impedance, can be used as input

  When reading PINB.2, the actual level of the PB2 pin is read.


  If PB2 is directly connected to VCC, then the result of reading PINB.2 at any time is 1


  If PB2 is directly connected to GND, then the result of reading PINB.2 at any time is 0


Reference address:AVR MCU IO usage details overview

Previous article:Detailed information on the internal structure of the AVR microcontroller's CPU
Next article:AVR MCU Selection Guide

Recommended ReadingLatest update time:2024-11-16 21:29

Several IO port configurations of single chip microcomputer
In the study, development and application of microcontrollers, the configuration of IO ports plays an important role in the realization of functions. The following introduces four common configurations. Now many microcontrollers have all four configurations to choose from. 1. Quasi-bidirectional port configur
[Microcontroller]
Detailed explanation of 8 configurations of STM32 IO ports
 1  The input and output pins of STM32 have the following 8 possible configurations: (4 inputs + 2 outputs + 2 multiplexed outputs) ① Floating input_IN_FLOATING ② With pull-up input_IPU ③ With pull-down input_IPD ④ Analog input_AIN ⑤ Open drain output_OUT_OD ⑥ Push-pull output_OUT_PP ⑦ Push-pull output
[Microcontroller]
Blue Bridge Cup STC15 MCU Review - Use of IO Ports
Preface Pin Diagram Lighting test As can be seen from the pin diagram, the peripheral resources of STC15 are basically the same as those of the 51 single-chip microcomputer, and three or four groups of IO ports (P0, P1, P2, P3) are also commonly used. Due to the circuit design of the board, the selection of the ex
[Microcontroller]
Blue Bridge Cup STC15 MCU Review - Use of IO Ports
About the use of PA15 pin as normal IO in STM32
I was working on a project recently, and when debugging, I found that the PA15 pin could only output a high level of 3.3V regardless of whether it was configured as output high, low, or input. Premise: Currently, there are two methods for STM hardware debugging, JTAG and SW. At present, I personally think that the bes
[Microcontroller]
AVR IO input independent key detection program
System functions Use the AVR to detect eight independent buttons, and once a button is detected, it will immediately indicate that it has been pressed. Very cool! hardware design For details about the I/O structure and related introduction of AVR, please refer to the Datasheet. Here we only briefly introduce some of
[Microcontroller]
AVR IO input independent key detection program
Maxim Integrated's IO-Link Smart Temperature Sensor Reference Design
    Maxim Integrated's IO-Link smart temperature sensor reference design reduces costs and increases operating time for industrial control and automation applications.         Beijing, China, March 26, 2015. Maxim Integrated Products, Inc. (NASDAQ: MXIM) introduces the MAXREFDES42# IO-Link temperature sensor
[sensor]
Maxim Integrated's IO-Link Smart Temperature Sensor Reference Design
Differences in IO structure between STM32F030 and STM32F103
STM32F103GPIO Function Description Each GPI/O port has two 32-bit configuration registers (GPIOx_CRL, GPIOx_CRH), two 32-bit data registers (GPIOx_IDR and GPIOx_ODR), a 32-bit set/reset register (GPIOx_BSRR), a 16-bit reset register (GPIOx_BRR) and a 32-bit lock register (GPIOx_LCKR). Each bit of the GPIO port can
[Microcontroller]
Differences in IO structure between STM32F030 and STM32F103
IO port simulates USART communication
52 single-chip practical IO simulation serial port C language source program     Author: 21IC suda     Purpose: short distance, low baud rate requirements, small environmental interference occasions     Features:         concise program, practical, easy to transplant         Occupies timer T2         only consume
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号