Hi,
My MCU is LPC11U68 and using LPCExpresso board rev c.
In periph_adc.c, there is a line:
/* ADC input 0 is on PIO0_12 mapped to FUNC2 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 9, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_ADMODE_EN));
(1) For LPC11U68, ADC input 0 should be PIO1_9, so the comment description is wrong.
(2) If using PIO1_9, the example code seems incorrect (IOCON_FUNC3 instead of IOCON_FUNC1) and it should be:
/* ADC input 0 is on PIO1_9 mapped to FUNC3 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 9, (IOCON_FUNC3 | IOCON_MODE_INACT | IOCON_ADMODE_EN));
Please help to check. Thank you.
Jeremy
已解决! 转到解答。
Hi Jeremy,
Yes, you are right, it is the lpcopen code bug.
1. ADC input 0 is PIO1_9, and the Func is Func3.
2. You are right, you need to use Func3, it is the code bug.
This type bug I have reported to our according department, but it is not fixed now.
You can modify it by yourself now.
A similar post also for your reference:
Errors in "periph_adc" example for LPC11U68
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jeremy,
Yes, you are right, it is the lpcopen code bug.
1. ADC input 0 is PIO1_9, and the Func is Func3.
2. You are right, you need to use Func3, it is the code bug.
This type bug I have reported to our according department, but it is not fixed now.
You can modify it by yourself now.
A similar post also for your reference:
Errors in "periph_adc" example for LPC11U68
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------