asp1987
New Member
Plz help...
I want to switch two leds ON and OFF depending on the state of two sensors.
sensors are connected to porte pins-re1 and re2.. Wrote program using tables(its the first time we use them).
On simulating it using 'pic simulator ide',i get the following message
'HARDWARE STACK OVERFLOW'.
Can someone say what it means?Also how to eliminate it?here is the code in
assembly..delays were reduced for easy step by step simulation..pic 16F877A..10MHz..
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
begin
call table
movwf 0x05
call delay
call begin
delay
movlw 0x03
movwf 0x0C
movlw 0x02
movwf 0x0E
loop1
decfsz delay_0,1
goto loop1
decfsz delay_1,1
goto loop1
return
table
movf 0x09,0 ;port e to w register
bsf 0x09,0 ;make bit0 of porte 1
addwf 0x02,1 ;add value to prog. counter
retlw 0x00 ;if porte bits <2:1>00,pc incremented by 1
nop
retlw 0x01 ;if 01,incremented by 3
nop
retlw 0x02 ;if 10,incremented by 5
nop
retlw 0x03 ;if 11,incremented by 7
return
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I want to switch two leds ON and OFF depending on the state of two sensors.
sensors are connected to porte pins-re1 and re2.. Wrote program using tables(its the first time we use them).
On simulating it using 'pic simulator ide',i get the following message
'HARDWARE STACK OVERFLOW'.
Can someone say what it means?Also how to eliminate it?here is the code in
assembly..delays were reduced for easy step by step simulation..pic 16F877A..10MHz..
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
begin
call table
movwf 0x05
call delay
call begin
delay
movlw 0x03
movwf 0x0C
movlw 0x02
movwf 0x0E
loop1
decfsz delay_0,1
goto loop1
decfsz delay_1,1
goto loop1
return
table
movf 0x09,0 ;port e to w register
bsf 0x09,0 ;make bit0 of porte 1
addwf 0x02,1 ;add value to prog. counter
retlw 0x00 ;if porte bits <2:1>00,pc incremented by 1
nop
retlw 0x01 ;if 01,incremented by 3
nop
retlw 0x02 ;if 10,incremented by 5
nop
retlw 0x03 ;if 11,incremented by 7
return
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;