- AVR MCU
- GNU AVR C compiller (avr-gcc)
- AVR Libc library
- All libraries' and drivers' folders should be placed in the same directory.
Some methods, provided by this library may be called in two ways: synchronously (blocking) and asynchronously (non-blocking).
WARNING Global interrupt flag should be enabled (set) during the communication in blocking and non-blocking calls both. Clearing of this flag will suspend the communication and may cause program's hang-ups in blocking calls.
BCD (binary-coded decimal) -- a format of decimal numbers where each decimal digit is represented by four bits.
This library provides taking the time from RTC in two formats: BCD or decimal. Library's methods, that return values in BCD format, have _bcd
suffix in their names.
AVR microcontrollers are unable to proceed calculations with BCD-formated numbers. However, if you only want to convert those values into ASCII-codes in order to display the time somewhere in your application, then BCD format is more preferable, since it takes less time for conversion into "printable" formats. If you need to proceed any futher calculations with time (add, substact, compare, etc), then you ought to use decimal-formatted methods. Also BCD format is more comfortable in debugging, since it's HEX dump looks exactly like decimal numbers.
Sample project included. See the sample directory for details.
To be continued...