CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0001: Stack over flow error occurred from instruction at 0x00000e
CORE-E0002: Stack under flow error occurred from instruction at 0x00001b
CORE-E0001: Stack over flow error occurred from instruction at 0x000005
CORE-E0001: Stack over flow error occurred from instruction at 0x000006
btfss INTCON,T0IF ; wait here until Timer0 rolls over
goto ForeverLoop
bcf INTCON,T0IF ; flag must be cleared in software
incf counter1 ; increment variable
#include <p16F887.inc>
///variable definitions
org 0
Start:
goto SOC
org 4
goto ISR
ISR:
BCF STATUS, RP0
BCF STATUS, RP1 ; select Register Bank 0
btfsc INTCON,2 ; TMR0 int (25us timer)
goto label1
retfie
label1:
bcf INTCON,2
;movlw b'00000100'
;xorwf PORTA
incf count2,1
movf count2,0
sublw d'36'
btfsc STATUS,Z
call label2
movlw 0xFB
movwf TMR0
retfie
label2:
;movlw b'00100000'
;xorwf PORTA
movlw d'0'
movwf count2
incf count3,1
movf count3,0
sublw d'9'
btfsc STATUS,Z
call label3
return
label3:
movlw b'00100000'
xorwf PORTB
movlw d'0'
movwf count3
incf count4,1
movf count4,0
sublw d'5'
btfsc STATUS,Z
call label4
return
label4:
movlw b'00100000'
xorwf PORTC
movlw d'0'
movwf count4
incf count5,1
movf count5,0
sublw d'10'
btfsc STATUS,Z
call label5
return
label5:
movlw b'00100000'
xorwf PORTA
movlw d'0'
movwf count5
return
Bank0:
movlw 0xFB
movwf TMR0
return
Bank1:
BSF STATUS, RP0
movlw 0x61
movwf OSCCON
movlw 0x00
movwf TRISA
movlw 0x00
movwf TRISB
movlw 0x00
movwf TRISC
movlw 0x00
movwf OPTION_REG
BCF STATUS,RP0
return
SOC:
call Bank0
call Bank1
bcf INTCON,2
bsf INTCON,5
End
// Interrupt routine at 25usec, using TMR2
// Flags get cleared elsewhere
{
static unsigned ctr1; // This is a 16 bit quantity
static unsigned byte ctr2;
static unsigned byte ctr3;
if (++ctr1 >= 50000) // 10msec (50000 counts at 5MHz)
{
flag_10 = 1;
ctr1 = 0;
if (++ctr2 >= 5) // 50msec
{
flag_50 = 1;
ctr2 = 0;
if (++ctr3 >= 10) // 500msec
{
flag_500 = 1;
ctr3 = 0;
}
}
}
// Insert other stuff to be done at 25usec intervals, but it had better be fast
}
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Creating an LED flickering candle light board | General Electronics Chat | 9 | ||
T | Creating Gerber files | PCB Layout , EDA & Simulations | 46 | |
R | Creating a timer lock | General Electronics Chat | 2 | |
P | Help creating timer for servo | General Electronics Chat | 5 | |
J | Creating Cycle Timer that triggers Event Timer using 555 chips | Digital Design | 37 |