Keil C Compiler 中斷的寫法


static void TF0_ISR(void) interrupt TF0_VECTOR using REG_BANK_1;

interrupt 後面接著一個number,這個number代表8051的一個中斷。

請查你的程式中 TF0_VECTOR 定義的number,然後查Keil C 的menu的interrupt number的表格,即知是那一個中斷。

8051的register有四個bank,using後面是指定interrupt routine 要用那一個 bank。一樣查REG_BANK_1的定義即知要使用那一個 bank。

TF0_VECTOR  應是timer 0
REG_BANK_1 應是 1

Share your vote!

Do you like this post?
  • Fascinated
  • Happy
  • Sad
  • Angry
  • Bored
  • Afraid

Leave a Reply

Your email address will not be published. Required fields are marked *

Please help to input verification code