Vermes
Advanced Member level 4
This device presents time and date on a VGA monitor (without a PC).
What was used: AVR Atmega16 and Philips RTC PCF8583
The circuit is very easy and consists of elements:
- power supply 5V - LM7805
- processor – Atmega16
- RTC – PCF8583 with CR2032 buttery
- 3 microswitches
- JTAG socket
- power supply 3.3V – LM1117-3.3V
- TeleVGA card
The TeleVGA card works only in text mode, but own signs can be defined, what allows to make some kind of semi-graphic. The graphic in this device is made to look similar to chars from a LED 5x7 points display. Three kinds of fonts were defined: big one to display time, medium to display date and small to display seconds and day of week.
The program was written in C. Tests were made on GCC integrated in AVR studio, IDE IAR and BASCOM.
Many problems were found, during programming in BASCOM, therefore, C was for this better (in C TeleVGA libraries were used). Comparing the size of code, the best is IDE IAR (what isn't a surprise, because it is commercial), on the second place, AVRStudio and GCC and on the end, BASCOM.
The code is fully commented and clear. It's divided in modules: VGA, I2C, SPI, RTC, FONT etc.
The colors on the screen can be easily changed, modifying constants: COLOR1, COLOR2, COLOR3 and COLOR_PRG.
Programming of the clock is made by 3 buttons: ENTER, PLUS, MINUS. After pressing ENTER, the clock goes to the programming mode, now using PLUS and MINUS, the hours, minutes, day of week, month, year can be changed. Going through options is made by using ENTER. After setting the date, it is checked and corrected if it isn't proper (for example 31 April is corrected to 30 April). After setting the time, seconds are zeroed. The clock can be expanded for attending a DS18B20 thermometer.
Because the VGA card is steered by SPI, it can be easily connected to PIC, 8051 or ARM.
Link to original thread (very useful attachment) – Zegar "VGA-RTC" - ATMega16+PCF8583+TeleVGA+Monito