https://github.com/mkwapisz2000/c-atmega328p-rtc-i2c
This project implements real-time clock (RTC) PCF8563 support on ATmega328P using the I2C bus. Additionally, it supports an alarm triggered by an external INT0 interrupt, allowing reaction to a set alarm time.
https://github.com/mkwapisz2000/c-atmega328p-rtc-i2c
atmega328p avr electronics embedded i2c interrupts microcontroller pcf8563 rtc
Last synced: about 2 months ago
JSON representation
This project implements real-time clock (RTC) PCF8563 support on ATmega328P using the I2C bus. Additionally, it supports an alarm triggered by an external INT0 interrupt, allowing reaction to a set alarm time.
- Host: GitHub
- URL: https://github.com/mkwapisz2000/c-atmega328p-rtc-i2c
- Owner: MKwapisz2000
- Created: 2025-02-17T16:05:19.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T16:10:20.000Z (2 months ago)
- Last Synced: 2025-02-17T17:25:34.517Z (2 months ago)
- Topics: atmega328p, avr, electronics, embedded, i2c, interrupts, microcontroller, pcf8563, rtc
- Language: C++
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# c-atmega328p-rtc-i2c
**Project Description - English**
This project implements real-time clock (RTC) PCF8563 support on ATmega328P using the I2C bus. Additionally, it supports an alarm triggered by an external INT0 interrupt, allowing reaction to a set alarm time.
Features:
- Communication with PCF8563 via I2C interface
- RTC clock handling: setting and reading time and date
- Alarm setting with INT0 external interrupt handling
- Verification of I2C communication and device address
- Displaying the current time and date via USART
Hardware Requirements:
- ATmega328P microcontroller (e.g., Arduino Nano or standalone AVR)
- RTC PCF8563 connected to the I2C bus (SDA – PC4, SCL – PC5)
- USB-UART converter (e.g., CP2102, FT232RL) for monitoring data
- LED on PB5 as an alarm indicator
- Connecting wires
- 5V power supply
Usage Instructions:
- Compile the code in an AVR C-compatible environment (e.g., Atmel Studio, PlatformIO, AVR-GCC).
- Connect the PCF8563 RTC to ATmega328P (SDA – PC4, SCL – PC5, INT – PD2).
- Connect ATmega328P to a computer via a USB-UART converter (TX – RX, RX – TX, GND – GND).
- Set the initial time and alarm in the code.
- Run the program, open a serial terminal (e.g., PuTTY, Tera Term) at 9600 baud and monitor the current time and alarm triggering.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
**Opis projektu - Polski**
Ten projekt implementuje obsługę zegara czasu rzeczywistego (RTC) PCF8563 na ATmega328P poprzez magistralę I2C. Dodatkowo obsługuje alarm wyzwalany przerwaniem zewnętrznym INT0, co umożliwia reagowanie na ustawiony czas alarmu.
Funkcjonalność:
- Komunikacja z PCF8563 przez interfejs I2C
- Obsługa zegara RTC: ustawianie i odczyt czasu oraz daty
- Ustawianie alarmu z obsługą przerwania INT0
- Weryfikacja komunikacji I2C oraz adresu urządzenia
- Wyświetlanie aktualnej godziny i daty przez USART
Wymagania sprzętowe:
- Mikrokontroler ATmega328P (np. Arduino Nano lub standalone AVR)
- RTC PCF8563 podłączony do magistrali I2C (SDA – PC4, SCL – PC5)
- Konwerter USB-UART (np. CP2102, FT232RL) do monitorowania danych
- Dioda LED na PB5 jako sygnalizacja alarmu
- Przewody połączeniowe
- Zasilanie 5V
Instrukcja użytkowania:
- Skompiluj kod w środowisku obsługującym AVR C (np. Atmel Studio, PlatformIO, AVR-GCC).
- Podłącz RTC PCF8563 do ATmega328P (SDA – PC4, SCL – PC5, INT – PD2).
- Podłącz ATmega328P do komputera przez konwerter USB-UART (TX – RX, RX – TX, GND – GND).
- Ustaw początkowy czas oraz alarm w kodzie.
- Uruchom program, otwórz terminal szeregowy (np. PuTTY, Tera Term) na 9600 baud i monitoruj aktualną godzinę i wyzwolenie alarmu.