free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
wewa
Fri Jul 11 2008, 01:34AM
 User Offline
Registered Member #8956
Joined: Fri Jul 11 2008, 01:23AM

Posts: 10
Thanked 1 time in 1 posts
Hi!

I've got the problem, that if I declare a variable in a function, the interrupt is blocked.

CODE:
#include <18F4525.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7, ERRORS, stream=PC)

int1 function() {
int32 cnt;  /*This seems to block the INTERRUPT #INT_RDA - But why?*/
while(1) {
}

} //END function

#INT_RDA
void seriell() {
char c;
c=getc(PC);
output_high(pin_b4);
} //END seriell

void main() {

ENABLE_INTERRUPTS(INT_RDA);      //serieller Empfang
ENABLE_INTERRUPTS(Global);

function();

   while (1) {
   } //END while
} //END main


Why does the declaration of a variable in a function block the interrupt?

PS: I use the CCS C Compiler with MPLAB and a PIC18F4525.

Back to top


Ajay
Fri Jul 11 2008, 08:19AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 4035
Thanked 751 times in 710 posts
I really don't know what you're trying to do in your program..

But i think you need to remove this from your function to make your program work perfectly, even along with variable declaration.

CODE:
while(1) {
}
 


If that does not solve your problem can you explain me what you mean by blocking your interrupt and symptoms of your program when it is running with variable deceleration?

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


wewa
Fri Jul 11 2008, 09:20AM
 User Offline
Registered Member #8956
Joined: Fri Jul 11 2008, 01:23AM

Posts: 10
Thanked 1 time in 1 posts
sorry, the problem was somewhere else

In #INT_TIMER3 a function was called which waited on a action to be taken in #INT_RDA. And I think this was too much for the PIC.

But thanks for your help.

Problem solved.

PS: The while(1)-Loop is no problem, its not blocking an Interrupt.
With "blocking interrupt" I meant that something impeded that the µC jumped to the interrupt.
Back to top


Ajay
Thu Jul 17 2008, 08:24AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 4035
Thanked 751 times in 710 posts
Happy to hear that problem is solved Keep workin

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems