Example #1
0
void sys_initialize(void)
{
    SystemClockInit();
    Sci_Init();
    CRGINT_RTIE=1;       //使能实时中断
    RTICTL = 0x70;       //设置实时中断的时间间隔为4.096ms
    //中断周期=1/16 x 10E-6 x (0+1)x 2E(7+9)=0.004096s=4.096ms
}
Example #2
0
static void system_init(void) 
{



  _asm sei; 

  #ifdef FLASH     

 /////    pll_init();	  // solo para flash  (ver config.h)

  #endif				     
                           
    QueueInit();
    Sci_Init();


    PORTA = 0x00;
    DDRA = 0xFF;
    
    init_SPI();
    
    atd_init();
    
    rti_start();      

                 
    speed=DEFAULT_SPEED;   // message shift speed
    Led_intensity=DEFAULT_INTENSITY;
 
    
//    rti_init();

  _asm cli; 

}