Hello pals,
As I may have mentioned earlier, I am currently working as R&D engineer in Instrumentation Division. Hence, my current posts will be regarding to challenges faced by the Online Instruments, where the functioning of those instrument for 24×7 are at most important.
Recently faced problem was:
If any of the I2C based components that are faulted, then the controller used to get hanged. Quite a few forums discussed about the problem but didn’t find how to overcome the problem.
Below is the method which use Watchdog timer to find the faulted RTC (for eg):
1. Define a variable to store in internal EEPROM memory of a microcontroller, and initialise to some known value(test_var=0x03).
2. Write a function named Self_test with content as below:
a. Rewrite the variable with some other known value(say test_var=0x04).
b. Start the Watchdog timer.
c. Read/write the RTC.
d. Stop the timer.
d. Now change back the value of that variable(test_var=0x03).
3. If the RTC is not working, the controller is restarted and now you check back the test_var value.
4. If you still have test_var variable’s value 0x04, then you say RTC is faulted.
You can have multiple and varied components self-tested, by having their respective error values.
There may be other ways to do these but, make sure you do. This provides better diagnosis to your instrument and instrument can self check itself!
-Happy Instrumenting!