
Explore hands-on I2C protocol fundamentals, its history, and three implementation methods, analyze a Lunar Technologies device communicating with an SD microcontroller, and develop drivers for Esti devices through practical projects.
Explore the theory behind the I2C protocol and learn how to implement it effectively as you watch the lectures, with Q&A and Facebook support if you need help.
Explore the I2C protocol, a two-wire master-slave serial bus that connects memory devices, converters, and sensors with unique hardwired addresses and speed modes from 100 kbps to 5 Mbps.
Explore how I2C connections use open-drain lines with pull-up resistors, data and clock transitions, and start and stop conditions to establish reliable communication on a 3.3-volt system.
Explore how to determine I2C pull-up resistors to meet minimum sync current across standard and fast mode. Understand how bus capacitance and rise time constrain maximum pull-up resistance.
Balance bus capacitance and pull-up resistance to meet I2C rise-time requirements; keep bus capacitance under 400 pF (standard/fast) or under 550 pF (fast-mode plus), and reduce trace length as needed.
Master initiates I2C with start and slave address, uses a read/write bit, transfers 8-bit data with acknowledgments, and ends with stop or repeated start per the data sheet.
Analyze an I2C read transaction between a master microprocessor and a LTC2990 sensor. The trace covers start, addressing, read command, acknowledgments, repeated start, and reading the register’s least significant byte.
Explore I2C with the Micromax shield, featuring a 128x64 LED display, current-voltage-temperature sensors from Linear Technologies, pushbuttons, and a potentiometer, compatible with Arduino Uno rev 3 hands-on learning.
Set up a linux stm32 development environment in virtualbox, install true studio, generate startup code with CubeMX, and debug a project that drives the onboard lcd via a user button.
Section 3 introduction provides hands-on I2C driver work for the LTC 2 9 9 0 sensor and the SSD 1 3 0 6 0 display.
Download and install STCubeMX on Linux, install 32-bit libraries, update apt, make the installer executable, run the installer, and choose the destination directory for installation, then clean up.
Configure a STCubeMX project to enable I2C communication with the MakerMax shield, generate code, and integrate it into Eclipse for sensor and display control.
Write and configure an I2C read driver for the LTC2990, including timing setup, seven-bit addressing, device readiness checks, and using the memory read function for format three transfers.
Learn to read the Vcc from an LTC2990 slave using the i2c driver, assemble msb/lsb data, and convert it to voltage per the datasheet.
Explore how to write from the I2C master to the LTC2990 slave, triggering a conversion with the register at 0x002, and waiting for the Vcc ready status from 0x000 before reading the new Vcc value.
Learn to implement an I2C driver for the SSD1306 display using a driver library, initialize I2C communication, render text with fonts, and display live VCC values.
Explore section four by unlocking features and completing specially designed assignments after each task, while I demonstrate my implementation method for comparison as you watch the lectures.
Learn to read LTC 9 9 0 internal temperature via I2C by combining two 8-bit registers, decode a 13-bit value, divide by 16 for Celsius, Kelvin mode available, and display on LED.
Configure the LTC2990 control register to access all shield features by writing 0x5a to register 1, selecting Celsius, single acquisition, and differential V1–V2 with V3 single-ended.
Read a potentiometer wired as a voltage divider from 3.3 V to ground, read LTC 2990 0A/0B registers via I2C, and convert the 14:0 buffer to a voltage for display.
Demonstrate real-time processor current sensing with the LTC2990 i2c sensor by reading the MSB and LSB from registers 6 and 7, then convert using 19.4 microvolts per step to current.
Enable digital inputs on the eye to see shield by configuring three external interrupts (lines 4, 8, and 13) with internal pull-ups and an interrupt handler for button presses.
Finish this hands-on I2C protocol course to gain comfort with peripherals for ARM cortex microcontrollers and contribute feedback to help future students.
Set up a free, open source development environment to program and debug arm cortex microcontrollers, enabling hands-on i2c projects and guided progress between sections.
Set up a Linux development environment on a Windows host by installing VirtualBox, creating an Ubuntu 64-bit VM with 6 GB RAM and a dynamically allocated 40 GB disk.
Download the latest Ubuntu ISO, load it into VirtualBox, and install Ubuntu by erasing the disk, creating a user, and restarting. Create a working Ubuntu desktop for the course.
download the open source eclipse from eclipse.org downloads, choose the oxygen version, install the java runtime environment, run the eclipse installer for c/c++ development, set your workspace, and launch.
Install eclipse plugins, including the C/C++ development tools SDK (eclipse CDT) and the GNU Arm plugin, then set up the arm toolchain from GMU MCU repository and gcc arm tarball.
Create a blinky project for the sdm32 board, configure chip family, flash size, RAM, and toolchain, then build to verify the setup for hands-on i2c projects.
download and extract the openocd tarball, configure, make, and install; enable the stlink jtag programmer, install dependencies, and connect to the nuclear board using the provided board config.
Learn to use openocd as a service from terminal and eclipse, connect via telnet, flash firmware, and debug with gdb for a blinky project.
Configure openocd in eclipse by fixing permissions with udev rules and copying the 60-dash openocd rules, then debug the blinky project using debugging perspective and breakpoints to observe LED blinking.
Identify and fix blinky project debugging issues by correcting toolchain paths, open no-CD setup, and workspace settings, then troubleshoot target not halted and flash errors in a virtual environment.
Welcome to this course on embedded systems for STM32: I2C protocol masterclass. The I2C communication protocol is a popular protocol that microcontrollers use to talk to various devices such as EEPROMS and NVRAMs, ADCs and DACs, I/O interfaces for port expansion, and a whole array of different types of sensors. This class goes in-depth into the theory behind the I2C protocol, why it was originally designed, what types of common formats are available, and how to implement I2C communication between a STM32 microcontroller, a LTC2990 current, voltage and temperature sensor and an OLED display.
Who am I?
I’m Akshay, and I’ll be your instructor for this course. I have been fascinated with micro controllers since I was a child, and now I consider it lucky to have it as my profession. I currently write firmware for safety critical systems that go inside electric cars. With my knowledge of embedded systems over the past 10+ years, and working in Silicon Valley, I have gained a unique insight into what the industry needs and what the students are lacking.
Course Structure
The course is divided into four sections -
Section 1 - In this section you will learn the theory behind the I2C protocol and how to implement it effectively.
Section 2 - In this section you will set up a free and open source development environment to program and debug ARM Cortex microcontrollers. If you have previously completed my course on the Foundations of ARM Cortex-M processors, then you may choose to skip to the next section.
Section 3 - In this section you will get hands-on experience on how to write the I2C drivers for the LTC2990 temperature, current and voltage sensor and the SSD1306 OLED display. You can take the knowledge learned in this section and apply it to any other I2C device of your choosing.
Section 4 - In this section you will unlock features of the I2C Shield with specially designed assignments. After each assignment I will show you my method of implementation for comparison.
What hardware is needed for this course?
This course is created around the Nucleo series of boards from ST Microelectronics and I have designed, specifically for this course a custom board that fits on top of the Nucleo board. The Nucleo board is available for purchase directly from ST Micro and the custom I2C board can be purchased on www(dot)makermax(dot)ca to allow you to get hands-on without having a whole electronics lab at your desk. Although this hardware is recommended, it is not mandatory. If you choose not to buy the hardware, you will still be able to follow along through all the lectures as I will show you my implementation. The best way to learn however, is to try and implement it yourself. If you have further questions on the hardware or anything else, send me a message! I would be more than happy to help you.