Content originally posted in LPCWare by Nelling on Mon Aug 26 09:09:09 MST 2013
Hi all,
I am currently trying to read audio signals to the ADC of lpc1769 however am still to coding this , could anyone enlighten me ? Totally do not understand all the downloaded examples =/
void ADCInit( uint32_t ADC_Clk )
{
/* Enable CLOCK into ADC controller */
LPC_SC->PCONP |= (1 << 12);
LPC_PINCON->PINSEL1 |= (1<<14); //P0.23 is connected to AD0.0
LPC_PINCON->PINMODE1 |= (1<<15); //No pullups/downs
/* By default, the PCLKSELx value is zero, thus, the PCLK for
all the peripherals is 1/4 of the SystemFrequency. */
/* Bit 24~25 is for ADC */
LPC_ADC->ADCR = (1<<21)|(0<<8); //Turn on ADC
return;
}
This is how I initialized it ,after which I tried to use the read function but tough luck , could any kind soul enlighten me how to
1. Initialize an ADC port
2. Read the ADC port
3. Use the data read and place it into an 8bit value for eg.
4. Probably print out so I can see whats in the digitized value
Thanks and god bless to the kind souls that can enlighten me !