Dienstag, 5. Dezember 2017

EC1204B Clock with ATmega8515 or ATmega162



Some weeks ago I got in contact with the circuit board EC1204B.
Sometimes also known as " DS1302 rotation clock " or " DS1302 Rotation LED Electronic Clock Kit".
It's a small pcb with 4 lcd 7-segments and 60 led's arranged in a circuit like a clock.
Original equip with a 'AT89S52' (compatible with 80C51 instruction set and pinout) I want
to reprogram the PCB with my AVR stuff. So I find a (nearly) compatible pinout µC: ATmega8515.

Many thanks to Cristian COPCEA who started a nearly same project in 2015.
He programmed first a 'AT90S8515' and also switched to 'ATmega8515'.
This was the base and my entry point.
(His lastest version I used to start my project was the 'EC1204B-10.zip')

The two main points for reprogramming the clock was to
- add the possibility to show the number of days to a particular date
  (to show my nephew the number of days until he is 18 :-)

- add a nerf gun detector to stop the alarm clock
  (like seen in this example: https://www.youtube.com/watch?v=-2WAyDod0W4)



Changes to 'EC1204B-10.zip' in detail:
 - count days between two dates          
 - support for nerf detection          
 - show hour+minute with leds (mode 10-13)  
 - new mode leds: leds off (mode 0)

 - new mode digits: digits off (push PLUS 3 times)    
 - show date DD/MM for EU mode
 - stable pullups at  PD2+3                            
 - eggtimer                                
 - deactivate multi temp sensor support 

(there is not enough memory for all features)
  
I also convert it to a Atmel Studio 7.0 project.
By the way, I notice that the Hex-file build by Studio 7 is smaller as build with
WinAVR, etc. That was very important for me, cause the current hex-file has nearly
a size of 99% of the ATmega8515 flash.
If you need more flash size, have a look at the ATmega162.
It's a pin compatible type which has 16K bytes programmable flash.

The result:



The Hex- anf Eep-Files are here:  clock.zip
If you don't have a nerf-gun use the eggtimer binary and solder a push-button at pin 31!
For the necessary hardware changes see instruction.pdf.
 
If you are interessted in the current source code please write email to me
and feel free to improve the code and let me know!

Slobbo

Update: See also repository:
https://github.com/elektro-slobbo/ATmega8515_EC1204B_Clock
There is also a setup-instruction in the documentation folder!