I wanted to generate a delay of 1ms by using PIC18F2550 Timer0 Interrupt Service Routine using MIKROC for pic
when i tried to simulate this in PROTEUS, i got some errors
[PIC18 STACK] PC=0x0038. Stack overflow is forcing device reset. [U1]
Here is my code..
My question is what is Stack overflow???
Please correct my code if there is any error
when i tried to simulate this in PROTEUS, i got some errors
[PIC18 STACK] PC=0x0038. Stack overflow is forcing device reset. [U1]
Here is my code..
C:
//Timer0, Prescaler 1:8; TMR0 Preload = 6; Actual Interrupt Time : 1 ms//
#define Pulse LATB
/***************Interrupt Service Routine for Timer1******************/
void interrupt_Timer0_ISR()
//void interrupt_1()
{
if (TMR0IF_bit)
{
TMR0IF_bit = 0; /* Make Timer0 Overflow Flag to '0' */
TMR0L = 0x06;
//Enter your code here
Pulse =~ Pulse; /* Toggle PortB at of 500 Hz */
}
}
void Timer0_start()
{
T0CON = 0xC2;
TMR0L = 0x06;/* Load Count for generating delay of 1ms */
GIE_bit =1; /* Enable Global Interrupt */
TMR0IE_bit =1; /* Enable Timer0 Overflow Interrupt */
TMR0IF_bit = 0;
}
void main()
{
// OSCCON =0x72; /* Configure oscillator frequency to 8MHz */
TRISB = 0; /* Set as output Port */
Pulse = 0xff; /* Send high on PortB */
Timer0_start();
while(1);
}
My question is what is Stack overflow???
Please correct my code if there is any error