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
已解决! 转到解答。
> 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.
> 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.