AnsweredAssumed Answered

Default interrupt error using ADC on Kinteis FRDM board

Question asked by matt gallagher on Jun 3, 2013
Latest reply on Jun 3, 2013 by martynhunt

 

Trying to build a simple A to D application on the FRDM KL25 board. I am using ADC0 attached to pin PTC1.  Using Codewarrior 10.3 and as I step through the code it goes directly to a default interrupt handler the moment I step into any command that attempts to initialize an ADC register.  For example in the intialization ADC0_CFG1=0x4; will cause an interrupt which has no handler defined so it goes to default.  I suspect I am making a simple error.

 

//Initialize PTC1 as ADC15  A to D
   
         SIM_SCGC5|=SIM_SCGC5_PORTC_MASK;   //  Turn on clock for port C
        
    // Convert the specific pins to the ADC module ( ADC is default).

         PORTC_PCR(1)=PORT_PCR_MUX(0);
        
         ADC0_CFG1=0x4;   //  12 bit conversion, single ended, full speed bus  clock normal operation    <<<interrupt occurs here
         ADC0_CFG2=0;       <<< or here if I have the above line commented out...

 

 

Outcomes