Pascal
I have attached a binary for the FRDM-K20D50M which uses the 1s interrupt.
- the RED LED toggles a 1s - controlled by the RTC seconds interrupt (and the green at 2.5Hz)
- If you connect via a terminal emulator on the OpenSDA virtual COM there is a command line menu (115k Baud) - in the administrator menu (4) there are commands to set the time and date and to display the present time and date:
Admin. menu
===================
up go to main menu
..
show_time display time
set_time Set time 01:22:56
set_date Set Date 23:02:2010
reset Reset device
last_rst Reset cause
help Display menu specific help
quit Leave command mode
#show_time
17:04:2014 20:40:20
show_time
17:04:2014 20:40:21
show_time
17:04:2014 20:40:22
show_time
17:04:2014 20:40:23
Here you can see that the seconds are counting (driven by the interrupt).
Did you get the alarm interrupt working? The seconds interrupt is otherwise very similar - just set the seconds interrupt enable rather than the alarm interrupt enable.
Personally I don't see any real advantage of parts with the seconds interrupt since the alarm interrup can be used for second interrupts anyway. Since the RTC is just a 32 bit counter the SW needs to perform time/date management so a seconds interrupt is the simplest way to do it. The SW that is attached performs Gregorian time conversions and allows the same features as the RTC in the Coldfires (using emulation). That is, it supports seconds interrupts, minutes interrupts, hours, day interrupts, alarm and stop-watch interrupts.
If you load this to your board you can check what is missing in your configuration.
Attached is also the complete RTC interface code, including configuration, interrupt handling, Gregorian conversions, etc.
If you prefer the complete project code it is at KINETIS Project Code - this also enable you to simulate your FRDM board, the Kinetis and its peripherals so that you will be able to make better progress.
Regards
Mark