智能车制作

标题: led测试程序下载到芯片中没有反应?求助。。 [打印本页]

作者: 灰兔眼迷离    时间: 2012-12-21 20:09
标题: led测试程序下载到芯片中没有反应?求助。。
#include <hidef.h>      /* common defines and macros */
#include "derivative.h"      /* derivative-specific definitions */

void SetBusCLK_24M(void){
      
       CLKSEL=0x00;
       PLLCTL_PLLON=1;
       SYNR = 0x02;         //对PLLCLK增频的因子
      REFDV = 0x01;        //对PLLCLK分频的因?
      _asm(nop);
      _asm(nop);
      while(CRGFLG_LOCK==1);
      CLKSEL_PLLSEL=1;
      
}
void main(void) {
  /* put your own code here */
  
            SetBusCLK_24M();
            DDRB=0xff;
            
            PUCR_PUPBE=1;
EnableInterrupts;

  for(;;) {
    PORTB=0xaa;
  } /* loop forever */
  /* please make sure that you never leave main */
}


我用的是code warrior5.1,dg128芯片,我想让led亮,这个main.c程序有问题吗?
谢谢!或者谁能给我一个简单的让dg128 led亮的完整程序。。




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