ADC Initialization settings for LPC1768

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

ADC Initialization settings for LPC1768

1,323件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by edlikestoboogie on Mon Mar 07 10:41:08 MST 2011
Hi,

I am having trouble formulating the correct bitwise operations to power on the ADC, and turn on the first 6 channels of the ADC and configure them for input.

In the example I am looking at, ADC channel 2 is turned on:

/* Configure AD0.2 input. */
LPC_PINCON->PINSEL1 &= 0xFFF3FFFF;
LPC_PINCON->PINSEL1 |= 0x00040000;
LPC_SC->PCONP       |= 0x00001000;
LPC_ADC->ADCR        = 0x00200404;
/* ADC enable, ADC clock 25MHz/5, select AD0.2 pin */

Can someone please give me a line by line explanation of how these calculations were made?  and advise me on what I should do to turn on the first 6 channels, AD0.0, AD0.1, AD0.2, AD0.3, AD0.4, AD0.5 on for input?  The first two lines confuse me the most.

Thank you.
0 件の賞賛
返信
1 返信

1,077件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Tue Mar 08 09:46:46 MST 2011
Hello edlikestoboogie,

First thing to do is to open User Manual UM10360 (LPC17xx) e.g. via internet.

Find "[B]pinsel1[/B]" and in [B]table 80[/B] the pins are configured ... ADC0.2: bit 18/19
Bit 18 = 1 and bit 19 = 0. Using "&=" for resetting bits and "|=" for setting bits.

Find "[B]pconp[/B]" and in table 46 the solution is found ... bit 12 sets the power on the ADC.

Find "ADCR" and set the A/D control register.

We hope this helps you.
0 件の賞賛
返信