Microcontroller Programming

Learn Microcontroller Programming (8-bit AVR) to use Peripherals like GPIO, Timer, Interrupt, PWM, ADC, Serial UART etc.

Last updated 2022-01-10 | 4.8

- Embedded C Programing
- Microcontroller Architecture (8-bit AVR)
- Bare-metal Microcontroller Programming

What you'll learn

Embedded C Programing
Microcontroller Architecture (8-bit AVR)
Bare-metal Microcontroller Programming
Setting up Atmel Studio 7 for C Programming & Debugging
Learn to develop peripheral drivers GPIO
TIMER
INTERRUPT
ADC
Serial UART etc.
Much more
Please See Curriculum for a Full Listing ............

* Requirements

* Windows OS
* The prior knowledge of C Programming and basics of electronics could be added advantage but not mandatory

Description

If you’re reading books of microcontroller programming, following different blogs and still feel stuck. Then you came to the right place, this microcontroller programming course designed around most popular 8-bit ATmega328 AVR Microcontroller. In this course, we will learn how to write C Programs for ATmega328 MCU. I’ve made complex concept easy to understand using quality content. It doesn’t matter if you’re new to microcontrollers or already know basics. I am sure you’ll enjoy learning with this course.

Short Description:

We’ll begin our journey to explore microcontroller right from the basics like setting-up official Atmel Studio7 IDE, installing programming utilities and hooking up the circuits in easiest way. To keep the hardware part simple in the beginning, we will use ATmega328 chip on Arduino Uno. Believe me this will save our time at hardware side so that we can focus more on core microcontroller features through AVR C Programming. Later on, as the time rolls on we will use ATmega328 Xplained Mini evaluation kit to learn advance debugging techniques.

"The Biggest objective of this course is to help you build sound understanding of microcontroller architecture and peripheral registers in-order to use them while writing professional embedded systems software”

We will setup every circuit from scratch and write microcontroller firmware for it. We will spend enough time in the beginning to get basics right. This will save time in long run and make you feel confident working with Microcontroller Architecture and C Programming.

Later on, we will be building mini projects to use LED, Switches, Analog and Digital Sensors (temperature/humidity/light Intensity/distance), IR Sensor, Relays and many more. These projects can be small yet very powerful to lay down strong foundation to use GPIO, Timer/Counter, Interrupt, PWM, ADC, Serial UART and other peripherals while developing embedded software and hardware.

Who this course is for:

  • Electronics, electrical, computer engineering graduates
  • Anyone interested in learning Microcontroller Programming
  • Students/Professionals who wish to take on career in Embedded Systems
  • Arduino Users who want to be Professional Embedded Software Developer

Course content

11 sections • 33 lectures

AVR ATmega328 Preview 05:24

In this lesson, we’ll learn about different pin functionalities of ATmega328 Microcontroller. We’ll explore how the port pins are organized on to the chip. There are 3-Ports and 28-physical pins we have on ATmega328.

Technical Specifications Preview 04:17

In this lesson, we will learn different peripheral features and specification. In short we will learn capabilities of ATmega328 microcontroller chip. There are different types of memories like flash, sram, eeprom. And also internal peripherals such as timer, interrupts, ADC, PWM, USART, I2C, SPI etc.

Select Development Board Preview 02:41

There are plenty of microcontroller development boards out there. We will explore most popular Arduino Uno and ATmega328 xPlained Mini Board. We’ll learn how these low-cost development boards makes life easy while learning microcontroller programming.

Pin Description of ATmega328 Preview 07:26

We will learn in detail about how the ATmega328 Microcontroller Port Pins are placed on Arduino uno. As in the beginning, we’ll be using Arduino uno later on for advance topics we will be using ATmega328 xPlained Mini Development Board.

Download Atmel Studio7 IDE Preview 08:25

Let’s download and install Atmel Studio7 IDE from official website. After initial setup we’ll install programming utility xLoader, which can be used to upload HEX file into Microcontroller Chip.

Setup Hardware for Programming Preview 01:40

In this lesson will walk you through, how we can connect microcontroller board to laptop for programming. Arduino is easy to setup and program as compared to other ATmega328 Microcontroller boards.

Create Microcontroller Project Preview 18:11

Let’s learn how to create microcontroller project from scratch using Atmel Studio7 IDE. The simple LED blink example will demonstrate step-by-step how to write program and upload code on to ATmega328 Microcontroller.

Number Systems Preview 13:09

Let’s refresh the basics of number system, which is a foundation of computer programming. We will learn Decimal, Hexadecimal and Binary format to represent the numbers. The understanding will help us write professional microcontroller programs.

Bitwise Operator Preview 07:23

In this lesson, we’ll learn various bitwise operators such as AND (&), OR (|), XOR (^), Left Shift (<<), Right Shift (>>). To implement logic in microcontroller programs we must use these operators. The efficient use of bitwise operators will make you good embedded developer.

Bit-Masking Preview 12:35

The bit masking will let us precisely operate upon the bits of our interest. We will use bit-masking to SET or CLEAR individual bit in microcontroller register. The use of bitwise operator makes program more redundant and easy to read.

Control GPIO as Output Preview 05:52

In this lesson, we will learn how to configure ATmega328 port pins into output mode. This will let us control output devices connected microcontroller. As an example we will control LED by blinking with delay.

Control GPIO as Input Preview 15:51

In this lesson, we will learn to configure GPIO Pins of Microcontroller into input mode. This will let us use switch and other input devices in microcontroller project. We will use tactile switch to control the LED.

Timers Preview 05:41

Let’s learn about timers, with the help of timers we provide time variable to our microcontroller project. We will learn about concept of timer in general. And how timer works? Inside microcontroller chip.

Programming Timers Preview 08:16

In this lesson, we’ll learn how to use timer in microcontroller projects. We'll use simple counter to count clock cycle and blink LED when particular count matches to timer register. This simple example will demonstrate use of timer registers.

Use Timer Flag in Project Preview 14:01

In this lesson, we’ll learn use of timer but more sophisticated way. This let's us to create own delay function using timer counter registers. In this example, we’ll set up flag in timer register to blink LED.

Interrupts Preview 05:40

Let’s learn about Interrupts and ISR (Interrupt Service Routine). We will learn, what is interrupt? why we should use them and how interrupt works?. Interrupt makes microcontroller program modular. And to write good microcontroller firmware we must use interrupt.

Types of Interrupts Preview 09:22

Let’s learn about different types of interrupts. In general, interrupts are classified into Internal and External Interrupts. We’ll learn when to use what. Since, interrupt is very vast topic. We will learn about its registers and how they work when generating an interrupt.

Use Timer Interrupt in Project Preview 13:52

In this lesson, we will write a program which implement timer interrupt. To keep it simple in the beginning we will blink led using timer interrupt. The demonstrate how to use ISR and generate interrupt using timer peripheral. So later on, we can generate interrupt with any other microcontroller peripherals.

Introduction of PWM Preview 05:34

PWM stands for Pulse Width Modulation and it is a technique used in controlling the brightness of LED, speed control of Motors or wherever we have to get analog output from digital input. It’s basically a method of generating an analog signal from digital input of a microcontroller.


PWM: Modes of Operation Preview 16:53

There are Two PWM Modes in ATmega328 Microcontroller. Fast PWM Mode and Phase Correct PWM Mode. In this lesson, we’ll only focus on Fast PWM Mode, which provide high frequency PWM Waveform generation. It’s a single slope operation.


Brightness Control of an LED Preview 10:38

In this lesson, we'll learn how to Generate PWM Signal on PD6 pin of AVR ATmega328 Microcontroller. This example code uses fast pwm mode with timer0 to generate pwm signal. In the end, we'll change the duty cycle of a clock and Control the Brightness of an LED.

Introduction of UART Preview 04:19

Let’s learn about UART (Universal Asynchronous Receiver Transmitter). It’s a Serial communication protocol. And can be used to communicate microcontroller with other devices which support UART Peripheral. We’ll learn, how UART allows us to establish communication between PC and Microcontroller.

Install PuTTY Terminal Preview 04:14

PuTTY is serial terminal software for windows users. We’ll use it as a Serial Console to read data on Computer Screen sent by microcontroller. This data could be just a character, string or sensor data. The use of PuTTY makes developers life easy to debug the code.

Transmit Character Byte Preview 12:19

In this lesson, we will learn how to use UART Protocol in ATmega328 Microcontroller. We’ll write a program to transmit character byte from microcontroller to terminal (serial console). We’ll get comfortable working with UART Registers in order to print character on computer screen.

Receive Character Byte Preview 06:31

In this lesson, we’ll write a program to receive character byte sent from serial console. The two ways communication between MCU and PC will let you understand, how powerful UART is in any microcontroller project. Basically using UART, we can interact with any device connected to microcontroller

Send String to Serial Console (PC) Preview 06:56

In this lesson, we will extend previous program to transmit string from microcontroller to serial console. This example will demonstrate the use of UART to send group of characters. Later on, we’ll use the same concept to print sensor data on serial terminal of personal computer.

Create Libraries and Use them as Project Preview 18:45

Let's learn how to distribute code from one single file to multiple library files. This makes life easy to maintain, share and resue the code across microcontroller projects.

Introduction of ADC Preview 06:23

Learn Analog to Digital Conversion with ATmega328 Microcontroller. There are total 6-ADC channels/pins with 10-bit resolution.

Read Analog Temperature Sensor (LM35) Preview 23:35

Let's learn how to Configure ADC & Interface Temperature Sensor (LM35) with AVR Microcontroller. Later on, we'll write a program and read temperature data in degree centigrade.

Calculation for LM35 Temperature Sensor Preview 05:54

Let's learn, how to convert Analog voltage from Sensor to equivalent temperature value in Degree Celcius.

Read Multiple ADC Channels Preview 12:48

In this lesson, we'll explore how to configure Multiple ADC Channels. So that we can use multiple ADC Pins in Microcontroller Project.

Connect ATmega328 XMini Board Preview 01:31

Let's learn how to Connect ATmega328 Xplained Mini or XMini Microcontroller Board with Computer over Micro USB Cable. The board auto-detect by Atmel Studio IDE and windows drivers get installed by itself.

Program XMini ATmega328 AVR Microcontroller Preview 14:36

In this lesson, we'll learn how to write very first project from scratch for ATmega328 Microcontroller for XMini Board. We'll also explore Step-by-step Process to Setup and Configure to Upload the Code on XMini AVR Evaluation Board. There are some key settings needs to taken care of before uploading code on XMini Microcontroller Board. By the end of this lesson, we'll be comfortable working with XMini Board