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

EZ-USB Autovectoring problem with MON51

Hi,

I've encountered a problem trying to implement autovectoring with an EZ-USB Development Board (AN2131-DK001) using the Keil evaluation DK51. I've scoured the net to see if anyone else has encountered the same problem, but to no avail.

I have the following code in an .a51 file.


CSEG	AT 43H
equ	$ + 2
DB	02H
DB	HIGH 4100h
DS	1


I found the above code here on the Keil site.

I then have the following code in a C file.


#pragma intvector (0x40FD) //start at 4100h
#pragma interval (4)

void Sudav_ISR (void) interrupt 0
{
}

.
.
.


In the above code I define all 21 EZ-USB interrupts.

Result: When using the MON51 for debugging purposes, at address 43h in the disassembly there is a an LJMP 4108h (would have expected it to be LJMP 4100 - off by 8).

In the disassembly starting at location 4100 is an LJMP to my first interrupt, Sudav_ISR. The following 20 interrupts defined in my code SHOULD follow at intervals of four. This doesn't happen. Some of the interrupts don't even show up, lest at intervals of 4.

When disassembled using just the simulator as a debugger, the code looks perfect.

Thanks for any insight and help =)

Natisha

Parents
  • LOL. I got fed up trying to set up the jump table in C soooo I decided to code it in Assembly instead. (How I orginally had it)

    I've tried using the EXACT code same code that you're using (that code is floating around on the Keil Site) and yet the MON51 does NOT like the LJMP USB_Jump_Table instruction since it attempts to write code at location 45h.

    The kicker is, that I have disabled ALL of my interrupts EXCEPT for the Suspend interrupt. Unless I'm missing something, there should be no reason for the offset of 8 since the AVEC/IVEC register is 0 by default on reset and since I have not enabled the SUTOK interrupt.

    Also interesting, when I disable the autovectoring (AVEN = 0) even then, a LJMP 4100H will turn into LJMP 4108H when using the MON51 debugger.

    Btw, thanks for your help thus far =)

Reply
  • LOL. I got fed up trying to set up the jump table in C soooo I decided to code it in Assembly instead. (How I orginally had it)

    I've tried using the EXACT code same code that you're using (that code is floating around on the Keil Site) and yet the MON51 does NOT like the LJMP USB_Jump_Table instruction since it attempts to write code at location 45h.

    The kicker is, that I have disabled ALL of my interrupts EXCEPT for the Suspend interrupt. Unless I'm missing something, there should be no reason for the offset of 8 since the AVEC/IVEC register is 0 by default on reset and since I have not enabled the SUTOK interrupt.

    Also interesting, when I disable the autovectoring (AVEN = 0) even then, a LJMP 4100H will turn into LJMP 4108H when using the MON51 debugger.

    Btw, thanks for your help thus far =)

Children
No data