I set it up as below.
--- test code---
main.c file
event.c file
and then start debugging, breakpoint on 'AD1_OnError' ISR continuous.
but, ADC0EIF register value is zero. ("empty")
why is not operate ADC?
MCU : S12ZVMC128 (nxp evb)
codewarrior 10.7 version
i referenced help manual example as below
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!
-----------------------------------------------------------------------------------------------------------------------
I tested it correctly. I did not have it when I took a screenshot.
I made new project, and then operating correctly. but I could not find the cause.
thank you, have a good day
Hi Byeongjin,
I am glad that it works now correctly.
Sometimes the breakpoints may behave strangely – typically when we setup breakpoint and edit code after that. I typically select Remove all breakpoints option and setup them manually again. That fix such issues in most of the cases.
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!
-----------------------------------------------------------------------------------------------------------------------