Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F452 Hangs when GIE set in Specific PCB

Status
Not open for further replies.

saeed_pk

Full Member level 4
Joined
May 20, 2006
Messages
237
Helped
35
Reputation
68
Reaction score
28
Trophy points
1,308
Location
Islamabad, Pakistan
Activity points
2,655
+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.......
 

Your PCB layout would be causing the trouble.What do you mean by orientiation of PIC?
 

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
 

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.
 

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.
 

please check all the interrupts and try to see that when GIE bit is set then which interrupt is called
 

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.
 

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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top