JM32 and RTC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JM32 and RTC

844 Views
RobRMG
Contributor I

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

Labels (1)
0 Kudos
Reply
1 Reply

719 Views
RobRMG
Contributor I

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

 

0 Kudos
Reply