Dear all, I found the problem it is related with max232 ic infact triggered by contactor switching noise that ic get hot and only receive from the pc but unable send to the pc. When I disconnect and reconnect vcc for this ic, normal operation resumes. All the capacitors of max232 are as recommended on the data sheet. As a temporary solution I make the mcu to reset max232 ic using relay that way the whole project run reliably longer than before. But is there any better solution for the max232