How to configure LPC845 BRK ADC2 and ADC3?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure LPC845 BRK ADC2 and ADC3?

Jump to solution
513 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
481 Views
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.

View solution in original post

0 Kudos
Reply
2 Replies
476 Views
OssiH
Contributor I

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

0 Kudos
Reply
482 Views
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 Kudos
Reply