Báo cáo buổi 11 I2C - Nhóm 5 (CT5)

00:04:42
https://www.youtube.com/watch?v=H7mAkDo-yss

Summary

TLDRThe presentation discusses the configuration of I2C communication with the DS1307 RTC module. It covers initializing the DS1307, reading and writing time data, and displaying it on an LCD in a 4-bit mode. The code includes functions to convert BCD to binary and vice versa, control the RTC, and display time and date. The presentation also features a demonstration of real-time clock functionality, showing the time update every second on the LCD.

Takeaways

  • 🕒 Configured I2C communication to interface with DS1307.
  • 📅 Initialized time and date variables for RTC.
  • 🔄 Implemented BCD to binary conversion functions.
  • 💾 Programmed data read and write functions for the RTC.
  • 📺 Displayed time on a 2-line LCD.
  • 🛠 Demonstrated real-time clock update every second.

Timeline

  • 00:00:00 - 00:04:42

    In this presentation, the speaker introduces the configuration of pins for the I2C interface in their project, specifically for the group report on connecting to the DS1307 RTC chip. They detail the necessary variables for handling time data (seconds, minutes, hours, day, month) and explain the conversion processes between BCD and binary formats. The speaker elaborates on the routines used for reading and writing data to the RTC via I2C, including specific commands and delays essential for proper functionality. They also describe the LCD display setup, including commands to operate the LCD in 4-bit mode and instructions for displaying the date and time. The presentation concludes with a live demonstration of the system reading the time from the DS1307 every second to update the display accordingly.

Mind Map

Video Q&A

  • What is the purpose of the DS1307 module?

    The DS1307 module is used to keep track of time and date using I2C communication.

  • What programming language is being used in the report?

    The programming language used appears to be C (or a similar language for microcontroller programming).

  • What does I2C stand for?

    I2C stands for Inter-Integrated Circuit, a communication protocol commonly used in microcontrollers.

  • What is the significance of the BCD format?

    BCD (Binary-Coded Decimal) is used to represent decimal numbers in a binary format.

  • How is the DS1307 initialized in the code?

    The DS1307 is initialized by setting its address and configuring the necessary variables for time and date.

View more video summaries

Get instant access to free YouTube video summaries powered by AI!
Subtitles
vi
Auto Scroll:
  • 00:00:01
    xin chào thầy em xin trình bày báo cáo
  • 00:00:04
    buổi thứ 11 bài I2C nhóm 5 chiều thứ
  • 00:00:09
    năm em xin đi qua nhanh phần cấu
  • 00:00:13
    hình các chân như là D7 tới D4 và IND và
  • 00:00:21
    RS i2c sẽ là
  • 00:00:26
    I2C1 có hình clock
  • 00:00:32
    phần code đầu tiên là em khai báo địa
  • 00:00:36
    chỉ của
  • 00:00:37
    con
  • 00:00:39
    DS1307 các biến như là giây phút giờ
  • 00:00:46
    ngày tháng
  • 00:00:48
    5 hai biến để chuyển từ BCD sang hợp
  • 00:00:52
    phân và hợp phân sang BCD
  • 00:00:55
    hàm đọc dữ liệu
  • 00:00:57
    từ con
  • 00:01:00
    RTC con RTC qua
  • 00:01:05
    I2C ở đây có dữ liệu ngày nhưng mà để
  • 00:01:07
    không yêu cầu nên em comment luôn ạ
  • 00:01:13
    hàm để ghi thời
  • 00:01:15
    trang vào
  • 00:01:18
    quc ở hàm ghi dữ liệu rồi đú mất mức 0
  • 00:01:22
    để ghi dữ liệu và chân enable mức 1 để
  • 00:01:26
    bắt đầu
  • 00:01:27
    ghi hay để ghi dữ liệu từ chân d4 tới
  • 00:01:33
    d7 một vùng đập no obligation để
  • 00:01:40
    delay cho chừ
  • 00:01:42
    in = 0 để hoàn tất quá trình
  • 00:01:44
    ghi hàm
  • 00:01:46
    gửi gửi lệnh
  • 00:01:51
    yd và hàm gửi dữ liệu ký tự để hiển
  • 00:01:58
    thị đây là hàm đọc dữ liệu qua
  • 00:02:02
    RTC tương tự bên trên hàm để điều khiển
  • 00:02:06
    con trỏd
  • 00:02:11
    Hàm hiển thị LCD đầu tiên là delay sau
  • 00:02:16
    cái cấp nguồn
  • 00:02:18
    và các dòng để chuyển sang chế độ 4
  • 00:02:23
    bit các lệnh điều khiển như là 4 bit hai
  • 00:02:28
    dòng
  • 00:02:29
    front 5 x 8
  • 00:02:33
    bậc và tắt con trỏ tự động t con trỏ và
  • 00:02:38
    sóng màn
  • 00:02:42
    hình hàm để a suất ngày tháng năm vộc ra
  • 00:02:46
    LCD
  • 00:02:53
    ngày tháng 5 sẽ ở trên vòng 1
  • 00:02:57
    và giờ phút giây sẽ dưới vòng
  • 00:03:00
    hai đây là biến biến tạm thời để xuất ra
  • 00:03:04
    CD
  • 00:03:07
    ở năm thì em có đặt sẵn số
  • 00:03:13
    20 dưới main em gọi là hàm h
  • 00:03:17
    LCD và khởi tạo thời gian
  • 00:03:23
    lúc lúc thực hành báo cáo video
  • 00:03:25
    [âm nhạc]
  • 00:03:27
    là 0 giây 29 phút 20 gi ngày 28 tháng 3
  • 00:03:35
    năm trong vòng lập thì
  • 00:03:38
    sẽ đọc dữ liệu thời gian từ con DS
  • 00:03:44
    1307 và hiển thị thời gian qua CD mỗi 1
  • 00:03:54
    giây tiếp theo là phần thí nghiệm
Tags
  • I2C
  • DS1307
  • RTC
  • LCD
  • BCF
  • Microcontroller
  • Programming
  • Time Keeping
  • Interrupts
  • Data Read
  • Data Write