Microcontroller Embedded C Programming Lecture 105| Controlling IO pin using software

  • Post author:
  • Post category:Blog

 

Controlling IO pin using software

 

 

In this article, let’s continue discussing how we can control these microcontroller pins or I\Os using the software.

Controlling IO pin using software
Figure 1. Microcontroller

To control these pins there is a peripheral called  GPIOD inside the microcontroller.

GPIOD is a peripheral which is used to control pins of the Port D.

This peripheral has its own set of registers which are used to control the pin’s mode, state, and other functionalities. 

So, the software has to write into that register, so there you can control the modes of the pins, you can control what data you can transmit over the pins, and you can write data to the port, you can read data from the port, so various activities you do through the registers.

 

Now the question is how to access these registers. You can access the registers of this peripheral using memory addresses, which means each register has its own memory address. So, by using that memory address, you can access these registers, and you can control the pins. Hence you can also say that this peripheral registers are memory mapped. 

 

Memory mapped I/O 

  • IO pins are controlled using peripheral registers which are mapped on to processor addressable memory locations. That leads to our next discussion.
  • What are processor addressable memory locations?

 

FastBit Embedded Brain Academy Courses

Click here: https://fastbitlab.com/course1

 

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.