Skip to content

This is a program the displays a real time clock on an OLED screen. The clock is fully configurable by pressing the button on the Curiosity Nano board. A short press increases the selected unit while a long press moves the selection.

License

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/avr128da48-cnano-rtc-oled-mcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCHP

Desk Clock using RTC and an OLED Click

This repository represents an MPLAB X project for an application that shows the current time using an OLED screen. The clock is configurable by the Curiosity Nano's on-board button.

Related Documentation

More details and code examples on the AVR128DA48 can be found at the following links:

Software Used

Hardware Used

The OLED C Click is connected to the first slot on the Base board.

Setup

The AVR128DA48 Curiosity Nano Development Board is used as test platform.

The following MCC configurations must be made for this project:

  • System Module
    1. Internal Oscillator (24 MHz)
    2. Prescaler disabled
    3. WDT disabled


  • Interrupt manager

    1. Enable Global interrupts
  • RTC

    1. Internal 1.024 kHz oscillator
    2. 1 second period
    3. Overflow interrupt enabled


  • OLED C
    1. Do not generate example


  • SPI
    1. Generated by OLED C
    2. MISO as PA5, MOSI as PA4 and SCK as PA6.


  • Pin Manager
    1. PA7 as output named "oledC_nCS"
    2. PC7 as input with Pull up enabled named "Button"
    3. PD0 as output named "oledC_DC"
    4. PD3 as output named "oledC_RW"
    5. PD6 as output named "oledC_EN"
    6. PD7 as output named "oledC_RST"



Demo Code

The source code for this project can be downloaded from the current page by clicking the "Download" button, or if you want to make your own project, please pay attention to the following steps:

  • After making the MCC settings, press the "Generate" button, and this will generate the required .c and .h files.
  • Several files have to be added to the project and some of the generated files (oledC.c and pin_manager.c) have to be modified. It is strongly encouraged to use the whole project downloaded from here.

The flow diagram is presented in the picture below:


Operation

  1. Connect the AVR128DA48 Curiosity Nano Development Board to PC using the USB cable.
  2. Build the firmware and load the generated hex file into MCU.

Demo:

After the code has been compiled and loaded onto the device, the OLED should light up and start counting. The digits can be changed by pressing the button. A long press changes the selection.

Summary

This example represents a real time clock displayed on an OLED screen.

About

This is a program the displays a real time clock on an OLED screen. The clock is fully configurable by pressing the button on the Curiosity Nano board. A short press increases the selected unit while a long press moves the selection.

Resources

License

Stars

Watchers

Forks

Packages

No packages published