LPC1343 programming board

Discussion in 'Programmer's Corner' started by Irmutis, Mar 1, 2010.

  1. Irmutis

    Thread Starter Member

    May 24, 2009
    17
    0
    Hi,

    Does anybody know how to program LPC1343 adc? Knows how any good tutorials for LPC1300 or for ARM cortex3 ?

    I have a code but I do not know what is wrong?

    #ifdef​
    __USE_CMSIS


    //#define LED_PORT 0 // Port for led
    //#define LED_BIT 7 // Bit on port for led​
    #include​
    "LPC13xx.h"

    #endif​
    void​
    ADC_IRQHandler (void)
    {
    LPC_GPIO0->
    DATA=(1<<7); //turn on LED

    }
    int​
    main(void) {

    LPC_SYSCON->
    SYSAHBCLKCTRL |= (1<<13); // ADC clock enable

    LPC_ADC->​
    CR |= (1<<0); //select ADC channel AD0

    LPC_ADC->​
    CR |= (0<<8); // CLKDIV divide from 1 4.5MHZ

    LPC_ADC->​
    CR |= (1<<24); // START conversation now

    //LPC_ADC->DR0 |= (1<<24); //

    LPC_ADC->​
    INTEN |= (1<<0); // Enable interupt

    LPC_ADC->​
    INTEN|=(1<<8); //enables the global done flag to generate interrupt

    NVIC_EnableIRQ(​
    ADC_IRQn);
    LPC_GPIO0->
    DIR=(1<<7);
    LPC_GPIO0->
    DATA=0;


    // Enter an infinite loop, just incrementing a counter


    while(1) {

    }
    return 0 ;

    }
     
Loading...