智能车制作

标题: link error,help! [打印本页]

作者: ab123369ab    时间: 2011-11-7 22:31
标题: link error,help!
#include <hidef.h>      /* common defines and macros */
#include "derivative.h"      /* derivative-specific definitions */
#define PITTIME 5000
#pragma LINK_INFO DERIVATIVE "mc9s12xs128"
unsigned int vtmpPIT=0;
void PLL_init() {
  CLKSEL=0X00;
  PLLCTL=0XE1;
  SYNR=2;
  REFDV=1;
  PLLCTL=0X60;
  _asm(nop);
  _asm(nop);
  _asm(nop);
while((CRGFLG&0X08)==0);
  CLKSEL=0X80;
}

void initIOBoutput() {
  
  DDRB=0XFF;
  PORTB=0XFF;
}

void initPIT() {
  PITCFLMT_PITE=0;
  PITCE_PCE0=1;
  PITMTLD0=240-1;
  PITLD0=PITTIME-1;
  PITINTE_PINTE0=1;
  PITCFLMT_PITE=1;
}




void main(void) {
  /* put your own code here */
  PLL_init();
  initIOBoutput();
  initPIT();


        EnableInterrupts;


  for(;;) {
    _FEED_COP(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave main */
}

#pragma CODE_SEG_NEAR_SEG NON_BANKED
interrupt VectorNumber_Vtimch0 void PIT0(){

  vtmpPIT++;
  if(vtmpPIT==10) {
    PORTB=~PORTB;
    vtmpPIT=0;
  
  
  }
  PITTF_PTF0=1;
}
#pragma CODE_SEG DEFAULT.....



link error1907:fixup overflow in _Vector8(why it's 8),to PIT0 type1,at  offset 0x0
作者: ab123369ab    时间: 2011-11-9 21:15
o,找到原因了。。。。。是关于定时中断向量的问题
作者: 逝水千年    时间: 2012-5-12 02:08
啥原因啊,我还是不明白,求直到……




欢迎光临 智能车制作 (http://111.231.132.190/) Powered by Discuz! X3.2