Searching \ for '[PIC]: INTerrupts...the strangest thing happened..' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'INTerrupts...the strangest thing happened..'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: INTerrupts...the strangest thing happened..'
2001\02\11@205527 by o-8859-1?Q?K=FCbek_Tony?=


Info: target 18c452, dev platform ICE2000 ( PCM18XA0 )

Tried to be a bit clever when using an MAX3100 uart and
to avoid doubling the code for tx'ing the first char.
( i.e. when 'idle' the uart has rx and tx irq generation enabled
but to generate the first irq condition for the first byte when
putting a block into the tx-buffer, it had to be sent to the uart
*outside* the normal tx irq handler. )

But instead of actually sending the first byte outside the isr
I thought of a way to let the s/w trigger the first irq and then
let the normal tx-buffer handler pass it over.
So I tried something like this:

BCF     INTCON,GIE,A    ; disable global interrupts
BSF     INTCON3,INT1IF,A        ; max 3100 connected to int1 pin,
trigger it
BSF     INTCON,GIE,A    ; enable global interrupts

But to my surprise this didn't work, I can clearly see the bit
is set in INTCON3 ( bit 0 in this case ) however the isr is never
triggered after the BSF GIE line. Odd ?

However this does work:

BSF     INTCON3,INT1IF,A        ; max 3100 connected to int1 pin,
trigger it

.. why is that ? i.e. setting the irq flag without disabling gie
works but not when it's disabled ?
I've been lead to belive, due to the datasheets that *any* interrupt
that is set when enabling the global irq will trigger the interrupt,
the warning in the datasheets 'make sure the appropiate int flag is
prior to enabling global interrupt' but it sure doesn't seem like it,
can spot where my thoughts wandered ?


Tony Kübek, Flintab AB            

-- hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...