How to configure LPC845 BRK ADC2 and ADC3?

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

How to configure LPC845 BRK ADC2 and ADC3?

ソリューションへジャンプ
198件の閲覧回数
OssiH
Contributor I

I am using LPC845 BRK and need to configure ADC2 and ADC3 to measure voltage levels from pin27 and pin8.

Example project is lpc845breakout_lpc_adc_basic. ADC0 works without any problem with this project.
Tried to expand the project to use ADC2 and ADC3 like this,

ADC_DoSelfCalibration(ADC2_BASE, frequency));

ADC_DoSelfCalibration(ADC3_BASE, frequency));


ADC_Init(ADC2_BASE, &adcConfigStruct);

ADC_Init(ADC3_BASE, &adcConfigStruct);


If ADC0 defined as ADC base address, what is base addresses for ADC2 and ADC3?

#define ADC0_BASE (0x4001C000u) //in LPC845.h


I hope that you can share an example how ADC2 and ADC3 to be configured successfully.

Many thanks,
Ossi

ラベル(1)
0 件の賞賛
1 解決策
166件の閲覧回数
frank_m
Senior Contributor III

> I am using LPC845 BRK and need to configure ADC2 and ADC3 to measure voltage levels from pin27 and pin8.

I don't have/use a LPC845 myself.
But, reading the datasheet, I think you got that wrong. This MCU has only one ADC, which can have up to 12 separate channels.

To use these channels, you would need to initialize the respective GPIO pins similiar channel 0 (which I think the mentioned example provides).

> ADC_DoSelfCalibration(ADC2_BASE, frequency));

And a calibration is done for the whole ADC unit, not individual channels.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
161件の閲覧回数
OssiH
Contributor I

Thanks for the clarification frank_m,
this is clear to me now

0 件の賞賛
167件の閲覧回数
frank_m
Senior Contributor III

> I am using LPC845 BRK and need to configure ADC2 and ADC3 to measure voltage levels from pin27 and pin8.

I don't have/use a LPC845 myself.
But, reading the datasheet, I think you got that wrong. This MCU has only one ADC, which can have up to 12 separate channels.

To use these channels, you would need to initialize the respective GPIO pins similiar channel 0 (which I think the mentioned example provides).

> ADC_DoSelfCalibration(ADC2_BASE, frequency));

And a calibration is done for the whole ADC unit, not individual channels.

0 件の賞賛