How to configure LPC845 BRK ADC2 and ADC3?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to configure LPC845 BRK ADC2 and ADC3?

跳至解决方案
202 次查看
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 解答
170 次查看
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 回复数
165 次查看
OssiH
Contributor I

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

0 项奖励
171 次查看
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 项奖励