seperate Software Stack in ISR with C18

Status
Not open for further replies.

fatihvelid

Newbie level 4
Joined
Sep 18, 2006
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
Hi,
How can I can seperate ISR Software Stack from Main software stack? I must call a lot of function. But system is crashing. And it run wrong.

I have used to directive of #pragma interrupt HighISR and #pragma interruptlow LowISR. But so it's still wrong.

Device is 18F8722
compiler: C18

Urgently, Please help me

Added after 3 hours 6 minutes:

I am trying multitasking. Firmware have very growed. so I cannot redesign firmware.

But If I solve seperating software stack problem, Firmware developing will completed.

I saw methods in some applications note. It suggest using pragma directive.

But I dont understand thing that when I use nested functions, How can I it?

must I use "#pragma tmpdata shared_tmpdata" for nested functions.

For Example;

int foo1(int a, int b)
{
return a+b;
}

int foo2(int a, int b)
{
return a*b;
}

int foo3(int a, int b)
{
return foo2(a,b)*(a/b);
}


#pragma tmpdata shared_tmpdata
int foo (int a, int b, int c, int d)
{
int x = (a * b) + (c * d);

foo3(foo1(a,b),x);
return x;
}
#pragma tmpdata
#pragma interruptlow low_isr nosave=section (“.tmpdata”)
void low_isr (void)
{
b = foo (z, y, x, w);
}


is that wrong?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…