AnsweredAssumed Answered

Errors in "periph_adc" example for LPC11U68

Question asked by Mark Johnson on Nov 20, 2017
Latest reply on Nov 30, 2017 by Kerry Zhou

Using theLPCXpresso11U68 Evaluation Board, the "periph_adc" example has a warning and an invalid configuration.

 

The code is from: lpcopen_3_01_lpcxpresso_lpcxpresso_11e68

 

The warning is in Chip_ADC_StartCalibration() because the variable save_ADC_CTRL  is set but not used.  Removing the declaration and assignment resolves the warning.

 

The invalid configuration is in the IOCON setup:

 

 /* ADC input 8 is on PIO0_12 mapped to FUNC2 */
 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 12, (IOCON_FUNC3 | IOCON_MODE_INACT | IOCON_ADMODE_EN));

 

The code sets the pin to Function 3 which is for the CT32B1 peripheral.  The comment is correct, Function 2 is for ADC_8.  Oddly enough, the ADC actually works with both Function 2 and 3, but Function 2 is specified in the User's Manual Rev. 1.8.

Outcomes