Well, I just started to explore the ADC example of https://www.nxp.com/downloads/en/software/LPC845BRK_Examples.zip (LPC845_ADC_LDR).
The function BOARD_InitPins() in pin_mux.c contains:
As you can see in the last 2 lines, USART0_TXD and USART0_RXD are configured.
Why line 1, 2 and 4 are here? Are they to trigger a conversion? Then this information is missed in the introductory description of the application (but I may be wrong because I'm very tired today).
When I switch to the Pins tool and the mex-file is loaded, this pin_mux.c differs. Here the USART0 e.g. is not configured:
And why ADC_CHN0 is configured? I think it's fixed to the potentiometer.
Hi customer,
From my own viewpoint, I highly suggest you refer to the SDK2.5.0 for lpc845 code, at least that code is tested.
It seems the LPC845-BRK code have a lot of bugs.
So, please download the SDK code from this link:
Welcome | MCUXpresso SDK Builder
If you have any problem about the SDK ADC, just let me know.
SWM module is used to select the pin function, not the ADC module function.
Thanks a lot for your understanding.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi, thanks for your honesty. I'll switch to your recommended examples. Actually it really doesn't make sense to continue with the LPC845-BRK examples.
SWM module is used to select the pin function, not the ADC module function.
I know. What I meant was: Why is PIO0_7, which is fixed to potentiometer, used in this example with an LDR sampled on PIO0_18. That makes no sense.
Hi Customer,
Thanks a lot for your understanding.
From pin_mux.h, we can find ADC_0 will connect potentiometer, so I think it is determined by the hardware design.
Even this project LPC845_ADC_LDR didn't use ADC_0.
If you don't need it, you totally can delete that code.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------