This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AD converter

Halo to everyone,

I have ARM NXP LPC2378 on MCB2300 board, and when I upload blinky example project to board AD converter works correct, but when I write my code, and upload to board, my program never gets into ADInterrupt routine? Does anyone, know what is problem? u

here is my code

#include <LPC23xx.H>
     short AD_last;
__irq void ADC_IRQHandler(void)
 {     
       AD_last = (AD0DR0 >> 6) & 0x3FF;      /* Read Conversion Result             */
        VICVectAddr = 0;                      /* Acknowledge Interrupt              */
 }
int main(void)
{
   /* Power enable, Setup pin, enable and setup AD converter interrupt         */
  PCONP        |= (1 << 12);                   /* Enable power to AD block    */
  PINSEL1       = 0x4000;                      /* AD0.0 pin function select   */
  AD0INTEN      = (1 <<  0);                   /* CH0 enable interrupt        */
  AD0CR         = 0x01200301;                  /* Power up, PCLK/4, sel AD0.0 */
  VICVectAddr18 = (unsigned long)ADC_IRQHandler;/* Set Interrupt Vector       */
  VICVectCntl18 = 14;                          /* use it for ADC Interrupt    */
  VICIntEnable  = (1  << 18);                  /* Enable ADC Interrupt*/


  while(1)
  {}
}

Thank you, Bojana