Тёмный

GPIO Port & Control Registers ATMega328 Arduino 

Arabinda Verma
Подписаться 392
Просмотров 8 тыс.
50% 1

www.udemy.com/embedded-progra...
General purpose input output, GPIO in short, is an interface on a MCU which is used to communicate with external world. The GPIO port or pin can be used as input to read the data from peripheral device or as output to send data and control different operations on the interfaced device. The mode, input and output also known as read and write, of a pin is configured by the driver software at runtime and can be changed as per the need. The protocol used to communicate with the peripheral device is also defined by the driver software. For example, we can use GPIO port to interface liquid crystal display to communicate information to external world. In the example, the data to be displayed and the control signals are provided over GPIO port and the busy state of LCD is read over the GPIO pin.
The Atmega328p uC has 3 GPIO ports - namely PORTB, PORTC and PORTD. PORTB & PORTD are 8-bit wide whereas the PORTC is 7-bit wide.
The ports have true Read-Modify-Write functionality. This means any of the port pins can be configured from read to write mode and vice-versa. The direction (i.e. read or write configuration) of an individual pin can be changed w/o affecting that of other pins on the same port. And the same applies when enabling or disabling the pull-up resistor of respective port pin.
The output buffer of the GOIP ports have symmetrical drive characteristics. That means the output buffer is equally good at sourcing or sinking the same amount of current through the port pin when driven high or low, respectively. The output buffer of the pins uses Complementary MOSFET (CMOS) where P- and N- field effect transitor of closely matched characteristics is used to achieve such "symmetrical" performance. The Atmega328p uC can source and sink 40mA of current through its GPIO pins. We must ensure the current limit is respected while interfacing external peripherals with the uC.
However, all the pins of the GPIO ports cannot be used simultaneously as most port pins are multiplexed with alternate functions. For example, the PC6 of PORTC that is the pin 1 is used as RESET for the microcontroller. Similarly the bit 6 & 7 of PORTB can be used as Pin Change Interrupt source or timer oscillator or connected to external crystal for clock generation. We have used these pins to connect 16 Mhz Crystal oscillator to generate clock signal. Enabling the alternate function of some of the port pins does not affect the use of the other pins in the port as general purpose I/O.

Наука

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 3   
@jrippon
@jrippon 3 года назад
Thanks. Nice clear explanation.
@MultiTechEducation4U
@MultiTechEducation4U 2 года назад
I like this video. As well as subscribed you. Will like discuss something more. Like to control 10 registers from arduino?
@mansidogra6787
@mansidogra6787 5 лет назад
It is hard to catch up with your voice and read on the slides. I wish u could have explained and synchronized it on the screen too so students like me could understand better. It's just a bit hard to catch up.
Далее
AVR Fuse & Lock bytes [ATMega328/P, Arduino]
8:11
Просмотров 10 тыс.
даташит atmega328p
8:24
Просмотров 1 тыс.
Bare-Metal MCU #1 - Intro to registers
13:10
Просмотров 69 тыс.
Microcontroller Firmware from Scratch
25:52
Просмотров 39 тыс.
ENGI 2203-02: Introduction to GPIO with ATMega328P
22:32
Здесь упор в процессор
18:02
Просмотров 346 тыс.