Hi
Beware that PTC4 is the SWD_CLK line and so using it as RTC_CLKOUT will cause the debugger to fail.
This is how I do it in the uTasker KE15Z project on PTC5:
1. Configure the pin function:
_CONFIG_PERIPHERAL(C, 5, (PC_5_RTC_CLKOUT | PORT_SRE_FAST | PORT_DSE_HIGH)); // configure the CLKOUT pin (the RTC must be operating for the signal to be present)
2. Enable the RTC
fnStartRTC(0); // start the RTC if it isn't yet operating
3. Set the 32kHz frequency to the output (automated in the last step when RTC_CLOCKOUT_ENABLE_32kHz is enabled)
RTC_CR |= (RTC_CR_CPE | RTC_CR_CPS_32k); // select 32kHz for output on RTC_CLKOUT
RTC_CR &= ~(RTC_CR_CLKO); // allow the 32kHz signal to be passed to other peripherals
I have attached a FRDM-KE15Z binary that shows this operation (32kHz output on PTC15 - connector J1-12).
It has a command line interface on the OpenSDA VCOM at 115200 where the RTC can be requested/configured with time and date, plus alarms set.
In addition it has a memory debugger (menu 3) where you can look at internal registers in order to find differences between its setup and yours.
Make sure that your RTC is correctly operating if you have the pin mux set correctly but you don't have a signal.
Regards
Mark
Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html
Kinetis: http://www.utasker.com/kinetis.html
Kinetis KE:
- http://www.utasker.com/kinetis/FRDM-KE02Z.html
- http://www.utasker.com/kinetis/FRDM-KE02Z40M.html
- http://www.utasker.com/kinetis/FRDM-KE04Z.html
- http://www.utasker.com/kinetis/FRDM-KE06Z.html
- http://www.utasker.com/kinetis/FRDM-KE15Z.html