Gustavo Santaolalla

QT1 oscillator problem

Discussion created by Gustavo Santaolalla on Oct 17, 2007
Latest reply on Oct 17, 2007 by Gustavo Santaolalla
Hello,
I want to make a QT1 work with an external crystal, but it doesn´t work.
Here is my Init code:
//----------------------------------------------------------------------
// Función: InitHard()
// Descripción: inicializa los ports y registros CONFIG
//----------------------------------------------------------------------
void InitHard(void){
unsigned int i;
       CONFIG1=0b00111001;
            
       DDRA=0b00000011;
       CONFIG2=0b00011000;
       i=0xffff;
       while(i!=0) {i--;} //delay
       asm bset 1,OSCSTAT
       i=0xff;
       while(i!=0) {i--;} //delay

      asm{
       XXX: brclr 0,OSCSTAT,XXX 
     }
   
       INTSCR=0b00000010;     //falling /des habilitada  
 return;

It stops on XXX: brclr 0,OSCSTAT,XXX.
The oscillator it´s not working, I cheked that with an oscilloscope.
 
What could be the problem?
Does anyone have a code example?
 
Thank you,
gustavo. 

Outcomes