Buenas,
Estoy trabajando con el PIC16F873A, intentando medir el ancho de un pulso ingresado por el puerto B, utilizando el TIMER0. (Con CCS)
A Continuacion subo el programa correspondiente:
Al querer simular en proteus, me salta el error siguiente:
"stack overflow pushing return address of interrupt"
y
"attempt to write unimplemented memory location 0x009C with 0x07 ignored".
Cualquier ayuda o sugerencia sera bienvenida.Slds.
Estoy trabajando con el PIC16F873A, intentando medir el ancho de un pulso ingresado por el puerto B, utilizando el TIMER0. (Con CCS)
A Continuacion subo el programa correspondiente:
Código:
#include <16f873A.h>
#use delay(clock=100000)
#fuses NOWDT,XT,NOLVP,NOPROTECT
#BYTE TRISB= 0x86
#byte PORTB=0x06
#byte TRISC=0x87
#byte PORTC=0x07
#INT_EXT
int valor;
int bandera=0;
ext_isr()
{
if(bandera ==0)
{
set_timer0(0);
ext_int_edge(L_to_H);
bandera=1;
}
else
{
valor=get_timer0();
ext_int_edge(H_to_L);
bandera=0;
}
}
void main()
{
SET_TRIS_B(0X01);
TRISC = 0x00;
PORTC=0;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
enable_interrupts(int_ext);
ext_int_edge(H_to_L);
enable_interrupts(GLOBAL);
while(1)
{
PORTC=valor;
}
}
Al querer simular en proteus, me salta el error siguiente:
"stack overflow pushing return address of interrupt"
y
"attempt to write unimplemented memory location 0x009C with 0x07 ignored".
Cualquier ayuda o sugerencia sera bienvenida.Slds.
Última edición por un moderador: