I have designed a PCB board to communicate with Modbus devices. I've use STM32F103RBT6 mcu and ADM485JRZ for RS485 communication. I have not soldered any other parts of the pcb except the micro and ADM485 and its driving circuit and I feed 3.3v (just for mcu) and 5v (just for ADM485) externally and I pulled down the BOOT0 pin through a 10kohms resistor and used external 8MHz crystal with 22pF ceramic capacitors and I used 2 LEDs to show the communication status.(LED1=on & LED2=off means data is transmitting and LED1=off & LED2=on means data is receiving and when both LEDs are off means no data is transmitting nor receiving).
The micro works properly and communicate with a Modbus key for about 10 minutes for the first time when I switch the 3.3v power on and both LEDs toggle as they are programmed. But after that, this communication stops and both LEDs are on(while no such thing is programmed for LEDs). When I power off the 3.3v and wait some time and feed it back o the micro, it again works properly and no errors happen. But this time micro works properly about 2 or 3 minutes.
And I've done it several times and I've seen the more I wait, the more it works properly(but never worked more than 10 minutes.).
Do you have any ideas why it's happening?
Any helps would be appreciated.