I'm using ATMEGA328P implement on a miniPCB to control the Raspberry Pi Start and control LED Status. The code works fine when ATMEGA328P is plugged on Arduino UNO board, but on the PCB, on the first start, the LED has an strange behaviour, switching on the LED when the LED should be off.
If I connect the ATMEGA328P miniPCB RX/TX to Arduino board (connecting to GND too) the behaviour is perfect, but if I disconnect RX/TX lines from Arduino board, the LED does something strange the first time.
The ATMEGA is flashed with Arduino UNO code, I have deleted Serial.begin and all serial commands, but if ATMEGA328P is not connected to RX/TX board pins, the led does strange things the first time. What could be the problem?
Diagram block added. ATMEGA328P board is supplied by 5V and GND Raspberry pins. When I connect RX line with ARDUINO board (without ATMEGA328P chip) I connect all the GNDs between them.
Between Raspberry and Arduino there is not communication, only GPIOs and write and read HIGH or LOW.
Thank you so much.