whats wrong with this little code?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

whats wrong with this little code?

607件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by navidrct on Sat Jun 13 22:24:48 MST 2015
hi
im new in ARM and Keil.
i want to work with adc of lpc1768 and i wrote this code . y does not working?
#include "LPC17xx.h"                    // Device header
#include "GPIO_LPC17xx.h"               // Keil::Device:GPIO

uint32_t voltaj = 0 ;

int main()
{
LPC_SC->PCONP |= ((1 << 12) | (1 << 15));  /* enable power to ADC & IOCON   */
LPC_ADC->ADCR    =  ( 1 <<  0) |           /* select AD0.0 pin              */
                      ( 1 <<  13) |          /*  freq=1M/33                   */
                      ( 1 << 21)|             /* enable ADC  */              
                      ( 1 << 24);              /*start conversion*/                 
LPC_ADC->ADINTEN =  ( 1 <<  8) | (1 << 0); /* global ADC enable interrupt   */
NVIC_EnableIRQ(ADC_IRQn);                  /* enable ADC Interrupt          */

while(1)
{
voltaj = LPC_ADC->ADDR0;
}
}
void ADC_IRQHandler(void) 
{

}
ラベル(1)
0 件の賞賛
返信
0 返答(返信)