RTC Interrupt handling on HC08-LK24

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

RTC Interrupt handling on HC08-LK24

2,479 次查看
lc_hc
Contributor I

Hi there,

 

i use the RTC to generate a periodic 1 second interrupt. Everythings fine, but the ISR itself dosen´t seem to work correct. I run the code in the Simulator from CW for HC08 and then the cursor is stuck into  the RTC isr, until i disable RTIE bit. Do I need to Acknowledge the RTC interrupt ? And if yes, then how ? I searched thru www and the datasheet, up to now without success.

 

hanks for your help in advance.

 

 

greetings,

 

Simon

标签 (1)
0 项奖励
回复
3 回复数

1,054 次查看
lc_hc
Contributor I

@Eckhard:

 

 

thanks for your comment. Unfortunately theres no RTIACK Bit and even no RTI Status Register. But this one ( RTCSR ):

 

SECF — Second Flag

This clearable, read-only bit is set on every increment of the second

counter. When the SECIE bit in RTCCR1 is set, SECF generates a

CPU interrupt request. In normal operation, clear the SECF bit by

reading RTCSR with SECF set and then reading the second register

(SECR). Reset clears SECF.

1 = Second counter incremented

0 = No second counter incremented

 

Is this used to acknowledge the irq from the ISR ?

 

thanks.

 

 

0 项奖励
回复

1,054 次查看
peg
Senior Contributor IV

Hello and welcome to the fora, lc-hc

 

If you are generating interrupts by having the SECIE bit set in the RTCCR1 register, then yes, this is what you have to do to clear the SECF flag which is the source of that interrupt.

 

Like Eckard, on first read of your post I was thinking of the RTI too.

 

0 项奖励
回复

1,054 次查看
eckhard
Contributor V

Hello,

 

you must ackknowledgetheinterrupt by writing to the RTIACK bit in the SRTISC Register

 

Eckhard

0 项奖励
回复