This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
If you'd try to catch a salmon with a debugger, it would be rotten long before you would see the catch in the debugger window.7ACDRIVER said:but I can never catch it as '1' even when putting a breakpoint at the next instruction after setting it.
In other words: the ADC is analog hardware. It is completely unimpressed by the debugger and its power over the CPU core. The debugger stops the CPU, but the rest of the world, including the ADC, keeps turning. So when your debugging software finally requests the content of this register (including the ADC10SC bit), this bit has been updated by the hardware centuries ago.
It's a common mistake amongst newbies to the microcontroller world, that they expect the debugger to freeze the whole realtime world. No, all the debugger can do is stopping the progress of the code (and maybe ACLK/SMCLK too). Everything else continues. Including input signals, radio waves, interface bit timings etc.
In other words: the debugger is the right tool to check the code, but it is the wrong tool to check anythign that is related to code-flow-independent things. For this kind of things, a logic analyzer or a digital scope are by far the superior tools.
Exactly. That's it. And the conversion is complete loooong before the debugger has even sent the request for the register content to the MSP through the high-latency USB connection.7ACDRIVER said:or it is being reset at the completion of the conversion
**Attention** This is a public forum