interrupt vs keyboard interrupts

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

interrupt vs keyboard interrupts

ソリューションへジャンプ
1,825件の閲覧回数
rajiv28
Contributor I

Hi all,

 

                 Can anybody please explain me the difference b/w the normal interrupts & keyboards interrupts.Can keyboard interrupt  be used as an normal interrupts,means to say that suppose our micro is executing the current keyboard interrupt & in b/w another keyboard interrupts comes,will it be executed after the current interrupt?or it will be discarded?do we have priorties in keyboard interrupt?

 

thanks in advance

ラベル(1)
0 件の賞賛
返信
1 解決策
927件の閲覧回数
peg
Senior Contributor IV

Hello,

If two keyboard interrupts occur together or the second one before you reset the first then the second activation is lost. It is also impossible to tell which of the two actually occured first. This is a fairly big limitation when using the KBI's for other uses other than their intended matrix keyboard use. I have often suggested that their could be a latch which latches the port state on the first activation but no one listens to me.

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
927件の閲覧回数
peg
Senior Contributor IV

Hello and welcome to the fora.

Keyboard interrupts are simply many pins (often a whole 8-bit port) OR'ed together to form one interrupt with its own vector. The IRQ pin is very similar only it simply has one pin and its own vector. The two interrupts will have different priorities but in the S08 this only means anything if they occur at the same time or both occur while interrupts are masked (i.e. by another interrupt routine executing). Interrupts can only interrupt other interrupt routines if this is explicitly allowed by re-enabling them during the ISR. There is no priority here, only as already mentioned.

 

0 件の賞賛
返信
927件の閲覧回数
rajiv28
Contributor I

Dear Peg,

Thanks for your quick reply. i got it what you have explained but i want to also know that if two or more keyboard interrupts occur simultantaneously what will happen.is it execute each of them one by one (but i dnt think so as there is only one interrupt vector for KBI's,not sure)or?.

0 件の賞賛
返信
928件の閲覧回数
peg
Senior Contributor IV

Hello,

If two keyboard interrupts occur together or the second one before you reset the first then the second activation is lost. It is also impossible to tell which of the two actually occured first. This is a fairly big limitation when using the KBI's for other uses other than their intended matrix keyboard use. I have often suggested that their could be a latch which latches the port state on the first activation but no one listens to me.

 

0 件の賞賛
返信
927件の閲覧回数
rajiv28
Contributor I

Hi Peg,

 

Thanks for clearing my doubt.Actually it is mentioned in the datasheet that these interrupts can be used for other purpose too.thats why i was confused.

 

nyway thanx once more.

i will highly appreciate your feedback.

0 件の賞賛
返信
927件の閲覧回数
bigmac
Specialist III

Hello,

 

You will see from the simplified schematic shown in the datasheet (or reference manual), that the KBI pins are simply ORed together to strobe a single latch (and assuming edge triggered only operation).  This means that, if a second keypress should occur, even if the latch has already been cleared from within the ISR, there cannot be another edge to re-activate the latch until after the first key has been released, and then the next keypress occurs.  Alternatively, the first input may be temporarily disabled from KBI so that further keypresses can be detected.

 

For level sensitive operation, if the first input is disabled so it does not trigger a further interrupt, and then the latch is cleared, if any other input should then be active, the new event would cause a new KB interrupt after the current ISR exits.

 

As Peg has already suggested, if the second keypress is already active when the port status is read to determine the interrupt source for the first event, the two keypresses must be treated as "simultaneous".  So probably no real advantage to use level sensitive operation.

 

Regards,

Mac

 

0 件の賞賛
返信