Interrupt context saving problem

General discussion on mikroC PRO for 8051.
Post Reply
Author
Message
adaniel
Posts: 28
Joined: 03 Feb 2016 15:17

Interrupt context saving problem

#1 Post by adaniel » 01 Jul 2019 21:26

Compiler mikroC PRO for 8051 version 3.6.0
Chip C8051F350 (Silabs)

The ics command doesn't work.

Compile the sample below and look at the generated assembly: it is the same, with or without the ics command
Worse: since the code has more than 8 bytes, it overlaps the next interrupt function. Obviously I am doing something
wrong, or else it would be impossible to use interrupts. So, what is the correct way to do it?



void main()
{
while (1) {}
}

void Timer2InterruptHandler() org IVT_ADDR_ET2 ics ICS_OFF
{
TMR2CN.TF2H = 0;
}

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Interrupt context saving problem

#2 Post by petar.suknjaja » 02 Jul 2019 11:02

Hi,
I'll review this and let you know what I've found out.

Kind regards,
Petar

adaniel
Posts: 28
Joined: 03 Feb 2016 15:17

Re: Interrupt context saving problem

#3 Post by adaniel » 02 Jul 2019 13:20

Thanks Petar for your answer. Don't work too hard, I already have the answer for my second question: there is no overlapping problem since the first handler instruction is a LJMP.
I still have an ics problem: I would like to have full control of registers to be saved, if possible.

Post Reply

Return to “mikroC PRO for 8051 General”