Hi Byeongjin,
I tested configuration very similar to your on my side and ADC seems works correctly.
It looks like problem with the breakpoint location and code optimization.
I do not see any code on screenshots which will use “test” variable as input. Therefore, I suppose that compiler/linker mark this line as dead/unused code and strip it out. Therefore, the breakpoint at this unused code in reality points to different function – AD1_OnError().
Please check map file whether “test” variable is used/unused.
I would like to recommend using “asm NOP;” instruction for breakpoint since such instruction cannot be optimized out by compiler/linker.
Note: please be aware that VRH_0 is mapped to PAD8. You should use VRH_1 mapped to VDDA if you don't use external reference.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------