MC9S08QG8   interrupt vector table

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S08QG8   interrupt vector table

1,198 次查看
song
Contributor I

void interrupt VectorNumber_Virq IRQ_isr()

 

I don't know where there is the declarations of IRQ_isr().

 

How I can find the declarations of IRQ_isr()?   

 

 

 

 

 

#include <hidef.h>         /* for EnableInterrupts macro */
#include "derivative.h"   /* include peripheral declarations */
#include "hcs08.h"        // This is our definition file!

unsigned char blinking=0;

// This is the IRQ interrupt servicing routine
void interrupt VectorNumber_Virq IRQ_isr()
{
  IRQSC_IRQACK = 1;    // acknowledge IRQ interrupt (clear IRQF)
  blinking = !blinking; // change blinking state
  // IRQ interrupt is disabled to avoid bouncing noise:
  IRQSC_IRQIE = 0;    // disable IRQ interrupt
}

void main(void)
{
  unsigned int temp;
  SOPT1 = bBKGDPE;  // configure SOPT1 register, enable pin BKGD for BDM
  PTADD = 0;       // all PTA pins as inputs
  PTBDD = 0xFE;      // pin PTB0 as input, PTB1 through PTB7 as outputs
  PTBD = 0xC0;      // turn off LED1 and LED2, clear other PTB outputs
  PTAPE = BIT_5;    // PTA5 pull up enabled
  IRQSC = bIRQPE | bIRQIE; // IRQ pin enabled, IRQ interrupt enabled
  EnableInterrupts;   // enable interrupts (CCR:I = 0)
  while (1)
  {
    if (blinking)
    {
      PTBD_PTBD6 = 0;               // LED = on
      for (temp=3000; temp; temp--); // wait for a while
      PTBD_PTBD6 = 1;               // LED = off
      for (temp=30000; temp; temp--); // wait for a while
    }
    IRQSC_IRQIE = 1;                 // enable IRQ interrupt
  }
}

标签 (1)
0 项奖励
回复
1 回复

862 次查看
PG1
Contributor I

Be sure to install the technical documentation for codewarrior, then see tech note TN101.  The default method is to use the interrupt keyword and not the ANSI method ( in the app note).

 

VectorNumber_Virq should probably be 2 for IRQ, although you should check the hardware manual to see that the first machine code address of the IRQ ISR is stored at the 2nd location in the interrupt vector table.

 

 

0 项奖励
回复