UART header for Arduino-based device

Good day!

I've a device built around ATMega8 chip with Arduino bootloader. I use Arduino board with chip pulled out to program it. I plan to solder this device to the perfboard and put into the case, but I want to leave possibility to reprogram it.

My plan is the following -- solder on perfoard the following headers from ATMega8:

  • RX
  • TX

The device is powered from AA batteries, Arduino board (without chip) is powered from USB. Here comes the questions:

  • Should I add GND to this? Is it safe to connect GND from Arduino borad (powered via USB) and my device's GND from batteries?

  • Is it safe to add RESET line to the header and connect it to RESET on Arduino board? By connecting reset I can get advantage of Arduino's autoreset. My device has external pull-up resistor and a button on reset line too for manual reset.

  • Should I set any protection (diodes etc) on this lines?

Thanks in advance!

Should I add GND to this?

It won't work if you don't.

Is it safe to add RESET line to the header and connect it to RESET on Arduino board?

Yes providing the grounds are connected together and they are both running off the same size voltage (they don't have to be the same supply but they need to be within 0.5v of each other)

Should I set any protection (diodes etc) on this lines

No need if the power supplies are the same.

Thanks, Mike!

Fast and precise answer as usual, one shot -- one hit! :slight_smile:

One more thing :slight_smile:

If I power my device from 3 AA batteries, that gives me 1,5*3 = 4,5V or less and Arduino is 5V. So it is not safe?

It is always safe powering with a lower voltage. Whether it works or not is another matter. However this sort of thing should work, the only thing to watch is the voltage v maximum clock speed graph in the data sheet, but at 4v5 you are fine.

Yes, the 4.5 for Atmega8 @8Mhz I use are good, I mean slightly other thing: you mentioned that voltages of both devices should not be different more than 0.5V.

With Arduino board (that I use as USB-UART bridge) at 5V and Atmega8 with 4.5V (or even less if batteries are old) the difference should be greater.

Is this ok?

Do you have other things connected to the Tx/Rx lines also? If so you should consider a way allow them to be disconnected so the rest of your circuit does not interfere with the FTDI (or similar) output during reprogramming if you're going to have it soldered in place. Other pins may be needed also. I have a promini that is on a socket in a board with some other logic chips which the promini drives. I have a jumper between the Rx in and the buffer that I bring serial data in on, figured I'd be all set - and yet no, have to pull the promini to program it. Have not figured out where the interference is coming from, kind of a pain to disconnect wires one by one to chase it with everything all neatly wirewrapped. I've got something on every pin, even the inboard A18/A19 have square pins with a jumper going to the board. All are outputs except for the data output from the RF module, guess I can try pulling that one and see if it does it. In the meantime, I am pulling the promini to program it and just concentrating on getting the software functionality done as the hardware is all working.
Could be the 5V on the VIN pin even for all I know.

Thanks for the reply,

I plan to leave RX and TX pins only for connecting to PC, so the only question is about voltage differences above...