mensan2004
驱动牛犊
驱动牛犊
  • 注册日期2004-04-05
  • 最后登录2004-05-27
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1315回复:4

c51的中断入口问题,请高手看过来

楼主#
更多 发布于:2004-04-09 17:02
我看了一些CYPRESS的FIRMWARE程序,看到有如下程序,每个中断函数都是 Interrup 0,能行吗?

请高手指点,急急

/-----------------------------------------------------------------------------
// USB Interrupt Handlers
// The following functions are called by the USB interrupt jump table.
//-----------------------------------------------------------------------------

// Setup Data Available Interrupt Handler
void ISR_Sudav(void) interrupt 0
{
GotSUD = TRUE; // Set flag
EZUSB_IRQ_CLEAR();
USBIRQ = bmSUDAV; // Clear SUDAV IRQ
}

// Setup Token Interrupt Handler
void ISR_Sutok(void) interrupt 0
{
EZUSB_IRQ_CLEAR();
USBIRQ = bmSUTOK; // Clear SUTOK IRQ
}

void ISR_Sof(void) interrupt 0
{
EZUSB_IRQ_CLEAR();
USBIRQ = bmSOF; // Clear SOF IRQ
}

void ISR_Ures(void) interrupt 0
{
EZUSB_IRQ_CLEAR();
USBIRQ = bmURES; // Clear URES IRQ
}
mensan2004
驱动牛犊
驱动牛犊
  • 注册日期2004-04-05
  • 最后登录2004-05-27
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-04-09 17:18
和如下的EZ-USB chip资料对不上呀,所有中断不是INT2吗,到底是怎么会事,请大虾给予指点呀.是越看越糊涂呀,是CYPRESS给的资料不全么?


All standard 8051 interrupts are supported in the enhanced 8051 core. Table 2-1 shows the existing
and added 8051 interrupts, and indicates how the added ones are used.
The EZ-USB chip uses 8051 INT2 for 21 different USB interrupts: 16 bulk endpoints plus SOF,
Suspend, SETUP Data, SETUP Token, and USB Bus Reset. To help the 8051 determine which
interrupt is active, the EZ-USB core provides a feature called Autovectoring. The core inserts an
address byte into the low byte of the 3-byte jump instruction found at the 8051 INT2 vector
address. This second level of vectoring automatically transfers control to the appropriate USB
ISR. The Autovector mechanism, as well as the EZ-USB interrupt system is the subject of Chapter
9, "EZ-USB Interrupts."
Table 2-1. EZ-USB Interrupts
Standard 8051
Interrupts
Enhanced 8051
Interrupts Used As
INT0 Device Pin INT0#
INT1 Device Pin INT1#
Timer 0 Internal, Timer 0
Timer 1 Internal, Timer 1
Tx0 & Rx0 Internal, UART0
INT2 Internal, USB
INT3 Internal, I2C Controller
INT4 Device Pin, PB4/INT4
INT5 Device Pin, PB5/INT5#
INT6 Device Pin, PB6/INT6
PF1 Device Pin, USB WAKEUP#
Tx1 & Rx1 Internal, UART1
Timer 2 Internal, Timer 2
mensan2004
驱动牛犊
驱动牛犊
  • 注册日期2004-04-05
  • 最后登录2004-05-27
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-04-09 17:23
续上面的资料,是较全的EZ-USB Manual Technical Reference中断资料:
The EZ-USB chip uses 8051 INT2 for 21 different USB interrupts: 16 bulk endpoints plus SOF,
Suspend, SETUP Data, SETUP Token, and USB Bus Reset. To help the 8051 determine which
interrupt is active, the EZ-USB core provides a feature called Autovectoring. The core inserts an
address byte into the low byte of the 3-byte jump instruction found at the 8051 INT2 vector
address. This second level of vectoring automatically transfers control to the appropriate USB
ISR. The Autovector mechanism, as well as the EZ-USB interrupt system is the subject of Chapter
9, "EZ-USB Interrupts."

请高手指点,刚开始看就很郁闷!看来问题很多..
wangzhu100
驱动牛犊
驱动牛犊
  • 注册日期2003-10-06
  • 最后登录2006-10-18
  • 粉丝0
  • 关注0
  • 积分41分
  • 威望6点
  • 贡献值0点
  • 好评度3点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-04-09 22:29
int2指的是中断号,决定了中断入口。

interrupt 0值得试中断优先级吧
jinghuiren
驱动巨牛
驱动巨牛
  • 注册日期2002-06-01
  • 最后登录2008-10-27
  • 粉丝0
  • 关注0
  • 积分291分
  • 威望460点
  • 贡献值0点
  • 好评度428点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-04-10 12:02
int2指的是中断引脚,如果我理解的不错,当interrupt0产生时,int2管脚会有中断输出。
那些中断函数你只要不更改顺序就应该没问题。
游客

返回顶部