move tmr_count to mb_comlib.h
a write error fix.