| Author |
Message |
saeed_pk
Joined: 20 May 2006 Posts: 199 Helped: 5 Location: Islamabad, Pakistan
|
01 Apr 2009 12:29 +pic18f452 hang problem |
|
|
|
|
Hi all,
I am working on a project on which i have to send some information via RF. my system works fine on a PCB i made as a general purpose. my second board works fine but when i enable GIE it hangs. if i do not enable interrupt it is fine. (does not hang) extra things i have added in this board are Ferrite beads on Key Pad inputs and to RF module.
one 5V DC relay is also added. i use diode for protection (freewheeling) i am in a fix why my system does not work when i enable interrupts.
my complete system was working on a PCB which is small in size.
does orientation of PIC cause an interrupt to occur, or Hang my system, remember i have not interfaced RF module to my system.
Please Advice.......
|
|
| Back to top |
|
 |
umery2k75
Joined: 19 Apr 2006 Posts: 378 Helped: 24 Location: Pakistan
|
01 Apr 2009 13:54 Re: PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
| Your PCB layout would be causing the trouble.What do you mean by orientiation of PIC?
|
|
| Back to top |
|
 |
snawi
Joined: 02 Apr 2009 Posts: 2
|
02 Apr 2009 13:10 PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
| LRC Meter
|
|
| Back to top |
|
 |
pvinbox@yahoo.com
Joined: 28 May 2004 Posts: 122 Helped: 6 Location: Coimbatore, INDIA
|
11 Apr 2009 7:23 Re: PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
Hi
You have to take care about pcb routing. You should supply vcc and Gnd directly from power supply. And increase the ground area also. which gives good improvement
|
|
| Back to top |
|
 |
darcyrandall2004
Joined: 01 Feb 2009 Posts: 32 Helped: 1 Location: Perth, WA, Australia
|
01 May 2009 6:20 Re: PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
I have had similar problems with a PIC16F870.
I suggest you investigate just exactly what Interruptes are being enabled when you enable global interrupts.
I then suggest you use a simulator to simulate these interrupts occuring. You will then be able to determine where your instruction pointer is jumping to when the interrupt occurs. Perhaps an interrupt occurs and then the processor finds itself in an endless loop.
|
|
| Back to top |
|
 |
Sobakava
Joined: 27 Mar 2002 Posts: 367
|
04 May 2009 12:03 PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
may be
- you forgot to clear interrupt event bits before returning interrupts. For instance if you defined a timer interrupt and if timer overflowed and caused and interrupt, interrupt mechanism sets lets say, TMR0IF bit. After you finish with interrupt handler, and if you don't clear this bit, another interrupt will be fired immediately.
- some pins ( ie RB4,RB5,RB6,RB7, INT0, INT1 etc) which can cause interrupts are floating (not connected to anywhere) and they are defined as inputs.
try to turn off all interrupts by their enable bits. then turn on them one-by-one and find which one has the problem.
This is all I can say without seeing the source code.
|
|
| Back to top |
|
 |
malik_123
Joined: 14 May 2007 Posts: 44
|
05 May 2009 10:37 PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
| please check all the interrupts and try to see that when GIE bit is set then which interrupt is called
|
|
| Back to top |
|
 |
AHKHANN
Joined: 24 Jul 2008 Posts: 2
|
16 May 2009 16:44 PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
I have recently built a system using 18F452 and I am facing almost the same problem.
On investigation I found out that my system gets restarted when ever I enable global Interrupt.
Since I am using CCS compiler it gives cause of restart from SLEEP mode.
I am clue less.
|
|
| Back to top |
|
 |
Google AdSense

|
16 May 2009 16:44 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
nikhil_damle
Joined: 15 Dec 2005 Posts: 103 Helped: 2
|
02 Jul 2009 8:18 Re: PIC18F452 Hangs when GIE set in Specific PCB |
|
|
|
|
| if in CCS u have a problem resolving he global interrupt u can disble it at runtime using the timer config modeules please check not sure about this
|
|
| Back to top |
|
 |