Roland Butscher

Start Up Time HC908AP16 >=900ms ???

Discussion created by Roland Butscher on Sep 4, 2007
Latest reply on Sep 8, 2007 by bigmac
Hello!
 
I have a problem with my AP16 (HC908AP16CFAE - 2L47P)
I changed the clock source from the internal OSC to the crystal OSC (32,768kHz).
 
When I used the internal OSC I had a start-up-time from about 280ms.
But now with the X-tal OSC I have a start-up-time from about 900ms.
 
I don't know where my mistake is!
 
Please can you help me?
 
Thanks in advance!
 
Roland
 
Here the Code:
 
Code:
void main(void) { CPU_INT8U speicher=0,i=0,dontprg=0,timeout_sec=0,timeout_ms=0,temp_timer=0;  CPU_INT16U pwm_X=0,pwm_Y=0,crc=0; CPU_INT16U angle_X_real=0,angle_Y_real=0; CPU_INT16U average_temp=123,min=2000,max=0; CPU_INT8U temp_average[8]={123,123,123,123,123,123,123,123};  DDRA_DDRA6=1;    /* LED - OUT */ LED=1;           /* 280ms with internal OSC - 900ms with X-tal */   CPU_INIT();   /* 270ms */´......................................../* 32,768kHz Quarz */const volatile MORSTR _MOR @0x0000FFCF = { 0xFF };/* MOR: OSCSEL1=0,OSCSEL0=1 *///const volatile MORSTR _MOR @0x0000FFCF = { 0x7F };void CPU_INIT (void){  /* internal OSC */  /*  CONFIG1 = 17;                        // Set the CONFIG1 register                                        // CONFIG2: STOPICLKEN=1,STOPRCLKEN=0,STOPXCLKEN=0,                                       // OSCCLK1=0,OSCCLK0=0,—–=0,˜™=0,SCIBDsrc=1   CONFIG2 = 129;                       // Set the CONFIG2 register   PCTL_BCS = 0;                        // Select clock source from XTAL   PCTL_PLLON = 0;                      // Disable the PLL   PMS = 727;                           // Set the multiplier   PMRS = 208;                          // Set the range select   PCTL = 0;  PCTL_VPR = 1;  PBWC = 128;                          // Select the operating modes   PCTL_PLLON = 1;                      // Enable the PLL     while(!PBWC_LOCK);                   // Wait   PCTL_BCS = 1;                        // Select clock source from PLL     __asm("nop");  __asm("nop");    */ /* 32,768kHz Quarz*/   // CONFIG1: COPRS=0,LVISTOP=0,LVIRSTD=0,LVIPWRD=1,LVIREGD=0,SSREC=0,STOP=0,COPD=1   CONFIG1 = 17;                        // Set the CONFIG1 register   // CONFIG2: STOPICLKEN=0,STOPRCLKEN=0,STOPXCLKEN=0,OSCCLK1=1,OSCCLK0=0,??=0,??=0,SCIBDsrc=1   CONFIG2 = 0x11;                       // Set the CONFIG2 register   //PCTL_BCS = 0;                        // Select clock source from XTAL   PCTL_PLLON = 0;                      // Disable the PLL  PCTL_PLLIE = 0;   PCTL_PRE=0;  PCTL_VPR=1;  PMSH=0x01;  PMSL=0xE9;  PMRS=0xD1;  PMDS=0x01;  PBWC = 128;                          // Select the operating modes "Auto=1"  PCTL_PLLON = 1;                      // Enable the PLL    while(!PBWC_LOCK);                   // Wait   PCTL_BCS = 1;                        // Select clock source from PLL     __asm("nop");  __asm("nop");

 

Outcomes