I have very little background in electronics, I'm from software background.
I'm interested to design a system in which there is an 8-bit micro-controller which should get powered from two different sources:
- From a battery (in Field mode) and
- From a USB port (in Factory mode)
Further, the software running on the micro-controller when it gets powered, on the basis of the power source, should enter into respective modes of operation. When powered from battery the algorithm should in run in Field mode and when from USB in Factory mode.
If there are simple ways to do this, then it will save a ton of my efforts to find out other ways of detecting where the device is.
Can anybody help me understand how to achieve this?
Thank you.