This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with Debugging

Hello.

I am writing a simple program for the EZUSB FX2 board, when I compile, I have no errors and no warnings but when I try to debug (my interrupt function is not working) then I get the following :

"error 22 No Code Memory At Address 0045"
"error 22 No Code Memory At Address 0055"

I checked this page but it did not help,
http://www.keil.com/support/man/docs/mon51/mon51_22.htm

I have run the debugger in some other programs and the configuration was the same and it worked (am I doing a mistake here?), so, anyone can help me? Also, can anyone tell me why my interrupt is not working?

This is the code.

#include "fx2.h"
#include "fx2regs.h"

unsigned char num ;
bit flag ;
BYTE xdata Digit[] = { 0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x98, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e };

#define BTN_ADDR 0x20
#define LED_ADDR 0x21

void inter( void ) interrupt INT0_VECT
{ num ++ ; if( num > 15 ) num = 0 ; flag = 1 ;
}

main( )
{ BYTE xdata buttons; flag = 0 ;

EZUSB_InitI2C(); // Initialize EZ-USB I2C controller

num = 0 ; EX0 = 1 ; IT0 = 1 ; EA = 1 ;

EZUSB_ReadI2C(BTN_ADDR,0x01,&buttons); EZUSB_WriteI2C(LED_ADDR, 0x01, &(Digit[1])); //So far, the code is running, I see the number 1 on the seven segment display. EZUSB_WaitForEEPROMWrite(LED_ADDR);

while( 1 ) { if( flag == 1 ) { flag = 0 ; EZUSB_WriteI2C(LED_ADDR, 0x01, &(Digit[num])); EZUSB_WaitForEEPROMWrite(LED_ADDR); EA = 0 ; EZUSB_Delay( 333 ) ; EA = 1 ; } }
}

Thank you very much.