16 Bare-Metal Peripheral Programming

Chapter 11 described how to program an I2C controller device at the register level. This chapter provides the complement to that information, showing how to program an MCU as an I2C peripheral at the machine register level, allowing you to create your own I2C peripherals. To do so, it explores a fairly comprehensive example of such programming running on the ATtiny84 MCU, a SparkFun Atto84 board.

Creating a software-based (bit-banging) I2C peripheral on such an MCU as simple and slow as the ATtiny84 is next to impossible (see Chapter 3, which punted on this task). Fortunately, the ATtiny84 provides hardware ...

Get The Book of I2C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.