Hi,
i need help with my project (PIC16F84A)
i wonder why i get a RETFIE at the address 0x00000 ( disassembled )
here is the beast (4 first lines):
;[ADDR ] HEXOP LABEL: Disassembly
[00000] 0009 u14, _isr, int_func, l5, int_entry: RETFIE
[00001] 018C LB1 CLRF 0xc
[00002] 018D CLRF 0xd
[00003] 2BD7 GOTO _main
it seems that the real problem is that the interrupt routine is always located at address 0x00000 but i don't know how to correct the problem.
Here is my source :
#include "pic.h"
#define bitset(var,bitno) ((var) |= 1 << (bitno)) //set a bit to 1
#define bitclr(var,bitno) ((var) &= ~(1 << (bitno)) //set a bit to 0
#define bank0 bitclr(STATUS,RP0) //select bank0
#define bank1 bitset(STATUS,RP0) //select bank1
const char option_reg = 0b11000000; //Option register
const char intcon_reg = 0b10010000; //intcon register
const char tmr0_reg = 0x01; //tmr0 initial state
/**************************************PROTOTYPES***********************************************/
void init_ports(void);
/*************************************MAIN ROUTINE**********************************************/
//asm("FNROOT _main");
void main()
{
INTCON = 0x00;
init_ports();
bank1;
OPTION = option_reg; // disable pullups and int. settings.
bank0;
TMR0 = tmr0_reg; //init. interrupt timer.
INTCON = intcon_reg; //enables TMR0 and RB0 int.
while(1); //wait for interuptions forEVER !!
}
/*******************************************ISR*************************************************/
void interrupt isr(void)
{
//nothing at the moment
}
/********************************PORTS***************************************/
void init_ports(void)
{
bank1;
TRISB = 0x01; //set port b as all input except B0
bank0;
PORTB = 0x00; //set port b's outputs as 00000000
}
THANK YOU !