PIC Microcontroller Programming. Lesson 19. MSSP. I2C. Connecting an External EEPROM. Part 1

Опубликовано: 16 Июль 2026
на канале: narod stream
2,294
88

We're continuing our work on programming PIC controllers.
In this lesson, we'll continue our introduction to the MSSP (Master Synchronous Serial Port). We'll now explore this module's operation in I2C bus mode.
For now, we'll focus on working with the controller's I2C bus in master mode.
In the practical part, we'll try communicating with an AT24C32D EEPROM memory chip, writing a few bytes to it, and then reading them back.
In this part of the lesson, we've become familiar with the I2C bus and its organization in the PIC16 controller.

You can purchase a PICKit3 programmer (non-original) here: https://alii.pub/71zlk8?erid=2SDnjdfn9TQ
You can purchase a PICKit3 programmer (original) here: https://alii.pub/71zl61?erid=2SDnjcczKRL
RTC DS3231 module with memory chip (2-5 pcs) https://alii.pub/723818?erid=2SDnjdBaYLK
RTC DS3231 module with memory chip (1 pc) - more expensive: https://alii.pub/7237yw?erid=2SDnjeZdY51
A 16-channel logic analyzer can be purchased here: https://alii.pub/721m8v?erid=2SDnjegsE8z

Video navigation:
00:00 Introduction
00:50 Introduction to the I2C Bus
09:34 Organizing the I2C Bus in the PIC16 Controller
12:18 SSPSTAT Register
17:03 SSPCON1 Register
22:19 SSPCON2 Register

For a better understanding of this video, we recommend watching:
Lesson 2. First Project in MPLAB X IDE    • Программирование МК PIC. Урок 2. Первый пр...  
Lesson 15. MSSP Module. SPI Mode. Part 1    • Программирование МК PIC. Урок 15. Модуль M...  
Lesson 15. MSSP Module. SPI Mode. Part 2    • Программирование МК PIC. Урок 15. Модуль M...  
Lesson 16. MSSP. SPI. MAX7219 LED Indicator. Part 1    • Программирование МК PIC. Урок 16. MSSP. SP...  
Lesson 16. MSSP. SPI. MAX7219 LED Indicator. Part 2    • Программирование МК PIC. Урок 16. MSSP. SP...  
Lesson 17. MSSP. SPI. MCP3201 External ADC. Part 1    • Программирование МК PIC. Урок 17. MSSP. SP...  
Lesson 17. MSSP. SPI. MCP3201 External ADC. Part 2    • Программирование МК PIC. Урок 17. MSSP. SP...  
Lesson 18. MSSP. SPI. SLAVE. Connecting Two Controllers. Part 1    • Программирование МК PIC. Урок 18. MSSP. SP...  
Lesson 18. MSSP. SPI. SLAVE. Connecting Two Controllers. Part 2    • Программирование МК PIC. Урок 18. MSSP. SP...  

The text version of this part of the lesson and the source code are here: http://narodstream.ru/pic-urok-19-mss...

VKontakte group: http://vk.com/club116656325
Odnoklassniki group: http://ok.ru/group/52987126153436
Facebook group:   / 236905359999556  
My website "Programming MK": http://narodstream.ru/
Forum: http://narodstream.ru/forum/

You can help Project:

YuMoney
https://yoomoney.ru/to/41001176473465

Webmoney
Z341906933112

Sberbank Card (MIR)
2202201799288929

USDT accepted
1) Network: TRC20
Address: TBBPFk5Widf1CYvF7Xk5ssKXeiPJHwtMgS
2) Network: BSC BNB Smart Chain (BEP20) (much lower fee)
Address: 0x2e38754DF1e54649Bf0D5CD6fD6D8c96a9f22f17
3) Network: Huobi ECO Chain (HECO) (even lower fee)
Address: 0x2e38754DF1e54649Bf0D5CD6fD6D8c96a9f22f17