RTC 7 Click Board
RTC 7 Click Board
The RTC 7 Click Board™ is a real-time clock module that has an extremely low power consumption, allowing it to be used with a single button cell battery or a supercapacitor, for an extended period of time. The MAX31341B IC built on the RTC 7 Click Board™ is able to output the time in the binary-coded decimal (BCD) format. Integrated, factory calibrated XTAL operating at 32.768 kHz ensures a very low time deviation.
However, the RTC 7 Click Board™ has the onboard external, more precise crystal oscillator too. An advanced interrupt feature allows many different uses such as alarm function, countdown timer function, external event detection function, using analogue and digital inputs and much more.
Software Support
We provide a library for the RTC 7 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The Library is used to get gmt time and local time by calculating data from data registers. Library communicates with the device via I2C driver and driver functions. Library offers a choice to get time data in two formats, 12 hours format and 24 hours format. For more details check documentation.
Key Functions
uint8_t rtc7_writeReg( uint8_t register_address, uint8_t transfer_data )
- Function writes one byte data to the register.uint8_t rtc7_readReg( uint8_t register_address, uint8_t nBytes, uint8_t *dataOut )
- Function reads the desired number of bytes from the register/s.void rtc7_getGmtTime( rtc7_time_t *gmt_time )
- Function gets the gmt time data in both time formats.void rtc7_getLocalTime( rtc7_time_t *local_time )
- Function gets the local time data including the determined time zone in calculations.
Example Description
The application is composed of three sections :
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes I2C driver and after the reset function configures the device to works in 12 hours time format with desired input and output frequency. After that allows the timer and the oscillator to be enabled.
- Application Task - (code snippet) - Waits until device be stable and logs time after each second.
void applicationTask() { rtc7_getLocalTime( &timeDate ); if (checkYear == 0) { mikrobus_logWrite( "Wait...", _LOG_LINE ); while ((timeDate.year != timeSet.year) && (timeDate.year != (timeSet.year + 1)) && (timeDate.year != (timeSet.year - 1))) { rtc7_getLocalTime( &timeDate ); } mikrobus_logWrite( "", _LOG_LINE ); checkYear = 1; } if (checkChange != timeDate.seconds) { rtc7_displayResults(); checkChange = timeDate.seconds; } }
Additional Functions :
- void rtc7_displayResults() - Logs time results in the appropriate format on UART.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- I2C
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The RTC 7 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
RTC 7 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.