导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→急急急--菜鸟求助!!!(关于Keil中断程序)[lyp_hncs]

 *第28855篇: 急急急--菜鸟求助!!!(关于Keil中断程序)

  
楼 主:lyp_hncs 2005年1月4日13:22
 急急急--菜鸟求助!!!(关于Keil中断程序)
小弟初学keilC51,在原有程序上进行修改。想打开串行中断进行串口通讯,在串行初始化函数uart_init();后执行ES=0x1打开,却怎么都不行,所用芯片无法工作,而且在何处执行该命令,程序就停止在该处。不知道中断的打开还有什么特殊的要求或要注意的地方。恳请各位大虾相助,感激不尽!!!!!
  原程序如下:
void main (void)
{
   EA  = 0;
   eth_disable();

 /*[System Initialization]*/
 sys_Init();

 /*[Timer Init] & [Active]*/
 sys_timer_init();      // This subrouting only init timer but not active

 // set ET0=0x01; EA=0x01; to active timer
 ET0 = 0x01;                 /* Enable Timer 0 Interrupt*/
 EA  = 0x01;                 /*Global Interrupt Enable*/

  /*[Console UART Init]*/
  uart_init();   DEBUGF(DEBUG_UART, ("\r\n Uart Init......OK!"));

    /*[EEPROM Init]*/
    eepromInit();
 

    ethSetMacAddr(); /* set it from config in eeprom */


    /* initialize MAC */
 ethInit();  printf("\r\n Ethernet Driver Init OK!");

 /*[Set MY_MAC]*/
 set_my_mac();

 /* [GPIO Device Init] */
 dev_init();  DEBUGF(DEBUG_UART, ("\r\n Device Init OK!"));

}

  
2楼:lyp_hncs 2005年1月4日13:55
 另注:编译提示

小弟自己随意编的中断测试程序如下:
void sys_serial_isr(void) interrupt 4 
{
    if (TI)
    {
       EA = 0;
      TI = 0;
      EA = 1;
  }
    if (RI)
    {
     EA = 0;
     RI = 0;
     EA = 1;
    }
}
系统编译后提示
error 65:access violation  at B00:0x0023: no 'execute/read' permission
入口在B00:0x2023: LJMP sys_serial_isr(C:6A53)
不知道是何处的问题!!!


>>>>>>对该主题发表你的看法

本主题贴数2,分页: [第1页]


[上一篇主题]:关于0832的输出不能达到5V的问题[讨论]

[下一篇主题]:请问一下各位大侠