#6 Interrupts, Section 3.8

open
nobody
5
2003-03-25
2003-03-25
Paul Stoffregen
No

Section 3.8, Interrupt Service Routines

The example function name is "timer_isr", but it has
"interrupt 2" which is for the INT1 external interrupt
pin. The function name and interrupt should match each
other.

The first paragraph talks of recompiling portions of
the standard library with --stack-auto. There should
be some section of the manual that gives a proceedure
for actually doing that, with a link to it.

The text talks about calling non-reentrant functions
and suggests using #pragma NOOVERLAY. This is not
enough. The user also needs to be warned not to call
that same function from the main program when an
interrupt might occur, or to disable interrupts before
calling it.

Many of the same issues also apply to nested interrupts
at different priority levels. Maybe that ought to be
mentioned also?

Should the table mention interrupt 5 for timer2 in the
8052 ?? What about the Z80, PIC and other non-8051
architectures? Much of the other text about register
saving is also 8051 specific.

While not technically part of ISRs, there should be
mention that the user is still responsible for enabling
the interrupt and establishing its priority.

I'm working on some example ISR code for the PJRC
website. It could also be included in the SDCC manual,
or the manual could give the URL of the example page,
or both?

-Paul

Discussion

  • Paul Stoffregen
    Paul Stoffregen
    2003-03-25

    Logged In: YES
    user_id=104682

    Here is the first of those examples I'm working on:

    http://www.pjrc.com/tech/8051/board4/timekeeping_intr.c

    Perhaps some or all of this example could appear in section
    3.8, or maybe just providing the URL would be a good idea ?