I use adc0_dp0 to read value in KW36 sdk, and I got voltage like 1 or 0. Can I just init adc0_dp0 as single mode?
Solved! Go to Solution.
Hi @darkblue ,
You are correct.
When the channel is selected as a Single-Ended Input, the positive input (ADC0_DP0) is the selected input signal.
Best regards,
Gavin
thanks for replying. When I enabled diff mode and used adc0_dm0 to measure voltage, I found that the value was incorrect. The actual voltage is 1.09v, but it reads 64189. It seems like already over range. how can I fix that ?
Hi @darkblue ,
Please check the result value in the code, which cannot be defined as the uint type, because there will be a result of less than 0 when using diff mode.
Gavin
thanks. I understand the minus number in diff mode. But actually, I want to use the single end mode
I can't find how to make adc0_dm0 working in single mode in MKW36A512RM. That means adc0_dm0 can be only configured in diff mode in mkw36a512?
Hi @darkblue ,
Sorry for my late reply.
I got your point now. If you configure ADC to the single-end mode, you only need to consider dp which should connect input signal. dm connected to GND internally, no additional configuration required, and it can be ignored.
Best regards,
Gavin
Thanks for reply. Due to project design I can only use dm to measure voltage instead of dp. Which means I have to connect dm to input signal. meanwhile the dp may be 0 or 1 or float. Does that work? In this situation the dp can be ignored?