kumt wrote: ↑Wed Oct 23, 2019 9:36 pm
Is it possible to route DAC values to ADC internally for the sole purpose of testing ADC functionality?
I don't think so... (or at least I'm not aware of a way to do this, but haven't looked in detail). It would probably be simpler to either wire it up externally, or bypass it at the software level.
kumt wrote: ↑Wed Oct 23, 2019 9:36 pm
How to avoid loss of data transfer from ADC to SD card during a power cycle? For example: If I am continuously logging data into a file on the SD card for 30 minutes and the power turned off say after 15 min of data logging. What is the best way to save 15 minutes of data safely?
What's the actual problem you're seeing? Do the writes go missing? Or are you seeing filesystem corruption?
One thing is to ensure is that you flush the file after each write.
kumt wrote: ↑Wed Oct 23, 2019 9:36 pm
Is it possible to implement unit testing in pyboard?
For your actual Python code... I'd unit test it in regular Python on your PC, using all the regular Python unit testing and mocking libraries.
Or use the Unix (or Windows) "port" of MicroPython, which should be almost identical to running it on the pyboard (but without the hardware access, which you could provide stubs for).
If you want to test it on real hardware, one thing you could look at is the MicroPython test suite, which has a way to run on hardware (see tests/run-tests, and in particular look at the test cases in tests/pyb).
kumt wrote: ↑Wed Oct 23, 2019 9:36 pm
What is the best way to document the code?
Comments is the obvious answer, but of course this means that your code will end up being larger, which may cause it to no longer fit on the board. The solution to this is to use the cross compiler (mpy-cross) to covert it to a .mpy file before copying to the board.