Hi,
I am trying to test the adc signals of my project with the SDK example before testing with my configuration code. I´ve tried with the interrupt and basic examples, and with both of them, the output shown in the console is as follows:
ADC interrupt example.
Configuration Done.
gAdcResultInfoStruct.result = 0
gAdcResultInfoStruct.channelNumber = 0
gAdcResultInfoStruct.overrunFlag = 0
I'm using the ADC0_0, ADC0_5 and ADC0_8 pins in my project and I´ve change the "DEMO_ADC_SAMPLE_CHANNEL_NUMBER" for each pin, and the output is always the same, only changing the number of the channel.
I've also checked the hardware, for each pin the value of the analog signal is correct and it should work.
I don't know if there is something missing in the SDK example that I need to include so it can match with my chip (LPC802M001JDH20J). I've no clue rigth know of what could be happening.
Hope you can help me.
Thanks.
I'm going to attach the interrupt SDK example just in case.
已解决! 转到解答。
Hi, Mateo,
Regarding your question, I think you do not set up the ADC pins assignment, which leads to the sample result error.
First of all, if you want to use ADC0_0 channel, you have to disable the temperature with the code.
/* Use the temperature sensor input to channel 0. */
ADC_EnableTemperatureSensor(DEMO_ADC_BASE, false); in the void ADC_Configuration(void).
Secondly, you have to set up the ADC0 pins assignment with the code like:
(/* Enables clock for switch matrix.: enable */
CLOCK_EnableClock(kCLOCK_Swm);
you have to write the PINENABLE 0 register so that you can set up the register.
SWM->PINENABLE0&=~(0x0FFF<<10); //enable all ADC channels
You can use a function to write the PINENABLE 0 register in SDK, pls do it yourself.
Hope it can help you
Regard
XiangJun Rong
Hi, Mateo,
Regarding your question, I think you do not set up the ADC pins assignment, which leads to the sample result error.
First of all, if you want to use ADC0_0 channel, you have to disable the temperature with the code.
/* Use the temperature sensor input to channel 0. */
ADC_EnableTemperatureSensor(DEMO_ADC_BASE, false); in the void ADC_Configuration(void).
Secondly, you have to set up the ADC0 pins assignment with the code like:
(/* Enables clock for switch matrix.: enable */
CLOCK_EnableClock(kCLOCK_Swm);
you have to write the PINENABLE 0 register so that you can set up the register.
SWM->PINENABLE0&=~(0x0FFF<<10); //enable all ADC channels
You can use a function to write the PINENABLE 0 register in SDK, pls do it yourself.
Hope it can help you
Regard
XiangJun Rong