I have written a firmware to download bulk data from my pc to an onboard flash which is interfaced using a cypress EzUSB-Fx chip(CY7C64613). I am using bulk endpoint 2 to send the 64 byte packets from the pc to the board. As soon as I setup up 64 bytes in the OUT2BUF on the host (PC) and set OUT2BC to 64, an interrupt is supposed to be raised, and my firmware has to enter the Interrupt Service Routine(ISR), from the while(1) loop where it indefinitely waits. The Keil C51 allows a function to be declared as an ISR using the 'interrupt' keyword along with the interrupt no. (in the range from 0 to 31) for which it is meant. I am unable to find what this interrupt no. would be for Bulk endpoint 2 (i.e. EP2OUT). The vector address for EP2OUT as per the datasheet is Ox2C while the "ezusb.h" header file contains the following line: #define OUT2BUF_USBVECT (11 << 2) usage of which gives an error at compile time. The Keil Application Note 103 which is supposed to talk abt 8051 interrupt vectors does provide these nos. but none of them corresponds to vector address 0x002C. Does anyone have any idea about this? Thanks in anticipation.
Thanks Jay, I think I did get confused and ur post really helped me clear up the clutter in my mind. Sorry for not replying earlier, as I was travelling. Interrupt 8 is ofcourse the one which would be raised when the OUT2BUF is loaded, and I would need to define a jump table to offset the jump to 0x2C for EP2OUT interrupt. Any idea as to how do I define a jump table on a page boundary in C. I came across an assembly file 'USBJmpTb.a51', which I have reproduced below, which is a JUMP table. But am not sure as to how to include this file in my keil project which is in C. NAME USBJmpTbl extrn code (ISR_Sudav, ISR_Sof, ISR_Sutok, ISR_Susp, ISR_Ures, ISR_IBN, ISR_Ep0in, ISR_Ep0out, ISR_Ep1in, ISR_Ep1out, ISR_Ep2in, ISR_Ep2out, ISR_Ep3in, ISR_Ep3out, ISR_Ep4in, ISR_Ep4out, ISR_Ep5in, ISR_Ep5out, ISR_Ep6in, ISR_Ep6out, ISR_Ep7in, ISR_Ep7out) public USB_AutoVector, USB_Jump_Table ;------------------------------------------------------------------------------ ; Interrupt Vectors ;------------------------------------------------------------------------------ CSEG AT 43H USB_AutoVector equ $ + 2 ljmp USB_Jump_Table ; Autovector will replace byte 45 ;------------------------------------------------------------------------------ ; USB Jump Table ;------------------------------------------------------------------------------ ?PR?USB_JUMP_TABLE?USBJT segment code page ; Place jump table on a page boundary RSEG ?PR?USB_JUMP_TABLE?USBJT ; autovector jump table USB_Jump_Table: ljmp ISR_Sudav ; Setup Data Available db 0 ljmp ISR_Sof ; Start of Frame db 0 ljmp ISR_Sutok ; Setup Data Loading db 0 ljmp ISR_Susp ; Global Suspend db 0 ljmp ISR_Ures ; USB Reset db 0 ljmp ISR_IBN ; IN Bulk NAK interrupt db 0 ljmp ISR_Ep0in ; End Point 0 In db 0 ljmp ISR_Ep0out ; End Point 0 Out db 0 ljmp ISR_Ep1in ; End Point 1 In db 0 ljmp ISR_Ep1out ; End Point 1 Out db 0 ljmp ISR_Ep2in db 0 ljmp ISR_Ep2out db 0 ljmp ISR_Ep3in db 0 ljmp ISR_Ep3out db 0 ljmp ISR_Ep4in db 0 ljmp ISR_Ep4out db 0 ljmp ISR_Ep5in db 0 ljmp ISR_Ep5out db 0 ljmp ISR_Ep6in db 0 ljmp ISR_Ep6out db 0 ljmp ISR_Ep7in db 0 ljmp ISR_Ep7out db 0 ; end