There are numerous clock projects which use Atmel AVR microcontrollers, but few use the Atmega48, and of the few that do, all are programmed in C or Assembly language (or using the Arduino IDE). I am too lazy to program in assembly language ... been there, done that for 15 years. I never learned C, and don't feel like learning the Arduino stuff, so BASCOM (compiled basic from MCS Electronics) is the AVR programming language of choice, for me. For more about BASCOM AVR see www.MCSelec.com
Something I did NOT want in a simple clock was any I2C real time clock peripherals from Dallas, NXP (or others), batteries and crystals. In the big clock I slapped together, real time is kept within the AVR via BASCOM firmware, and is accurate to the 60hz AC line (USA). There are ZERO quartz crystals used in this project. Displays are IEE2352E, similar to Lumex LDS-AD16RI but the IEE2352E have one less diode per segment for a lower forward voltage drop per segment. This is important because it allows the entire clock to function from same +5 volts as the Atmel microcontroller and direct drive the digit's segments from the MCU pins without level shifters (unusual for any clock with digits this tall). The 57mm 7 segment LEDs are driven directly from the AVR chip, sinking an average 25 mA per segment with very acceptable brightness.
This clock may be powered from a computer's USB port as a GewGaw. When my firmware detects the absence of the 60hz AC line time base, it automatically reverts to the AVR's internal R/C oscillator as the time base. It will be inaccurate over extended time periods, but permits functioning as an acceptable USB GewGaw clock for several hours remaining accurate to a minute. If you build one of these and want battery power (or USB power) and desire long term precision, add a quartz crystal time base circuit. I will release my software as an "open source project" shortly.
Not counting the 7805 voltage regulator, this clock project has only one integrated circuit "chip". That chip is the AVR ATmega48. Also, the ATmega88, 168 and 328 can also be used instead if you have them.
This is an extremely efficient hardware design using only 4 transistors, 7 diodes, 7 capacitors, 13 resistors, 2 push buttons, the LED displays, and three discrete LEDs. 12 components can be eliminated if you just want the USB GewGaw version. The clock draws approx. 125 milliamps from a USB port.
Well done. Thanks for sharing your project and taking the time to make a video.
The mains freq. is very accurate. In fact it is monitored and changed when the offset becomes too high.
markmcselec 11 months ago
Fun, although this is quiet a show of the BASCOM uselessness - while a LED scroller firmware written in ASM takes around 6kB along with a full terminal support (plain-text command-response functionality), 256 8x8 character table and a bunch of effects 4kb for the RTC functionality feels pretty much like an overkill. By the way, are you sure the mains frequency is very stable? Usually it floats pretty widely and also power surges happen sometimes - and new Murata X-tals do have built-in caps ;)
TheBypasser 1 year ago
@wytis im sure its made of acrylic (type of plastic)
zkjgrty 1 year ago
hey, what's the that dark see-thrue cover is made out of? is it a plastic?
wytis 1 year ago
Cool. Thanks for sharing.
TerminalJack505 1 year ago
there are demo cracks everywhere. just have to look through the torrents.
THEtechknight 1 year ago
where you got the BASCOM program ???
have u a link for free full version ???
Mpondrk 2 years ago