I'm having trouble with the RTC in the JM32. I wish to setup a 1 Hz periodic interrupt. I can do this only using 1 kHz LPO. This is not accurate enough. Neither the ERCLK or IRCLK work. On top of that the LPO works only if I use the default settings for bus clock (8 MHz in FEI mode). I wish to use a 24MHz bus from a 16MHz xtal. This works for for operations such as SPI, ADC, TPM, PWM etc. It's just that when running 24MHz bus by way of PEE mode the RTC will not work at all.
Any clues???
Rob
I managed to get the RTC working with LPO while in PEE mode (24MHz). But still no joy with ERCLK or IRCLK. Below is the code that works. But any value other than 00 for RTCLK does not work ( there is no interupt).
Rob
* RTC test
rtct jsr InitRTC
cli
rt jsr tg3 ; toggle bit for CRO display
wait
bra rt
*************************************************
* Initialise RTC for 1 second period
InitRTC
mov #0,RTCMOD
mov #%00011111,RTCSC
rts
****************************************************
* RTC Interupt Service Routine.
RTC_isr
bset RTCSC_RTIF,RTCSC
rti