Using the Serial port

Hi all,

I want to drive this audio device: DFPlayer_Mini_SKU_DFR0299-DFRobot . It uses asynchronous serial, at 5v levels, and 9600 bps, and it would seem that the regular on-board serial capability of the Uno I'm using could potentially do this just fine.

I fully realize that I won't be able to use this to communicate simultaneously with both the IDE/USB serial system and the audio device. I'm fine with that limitation, and indeed, I'm fine with physically disconnecting the audio board while uploading my program.

My question however, is this. If I attach this device to pins 0 and 1, will there be an electrical conflict with the output of whatever it is that interfaces between the USB port on the Uno and the actual ATmega chip?(Obviously, I can disconnect the audio board while uploading, but I can't disconnect the USB interface while running!) My expectation is that there will be active electronics driving the ATmega's pins, and if I start trying to drive them too, we'll be fighting one another. On the other hand, if that's the case (i.e. if the USB interface is not tri-stated in some way) then why did they bother to break out those pins in the first place :slight_smile:

Hoping someone can tell me if it's safe and practical to connect the device this way.

As side notes:

  1. I know I can use a software serial library and pick two other pins, but I'd rather avoid that, given that I understand there's real serial hardware already there on the ATmega.

  2. part of the reason I want to do it this way is that I intend to take this project "off board" and end up with an ATmega chip running this thing stand-alone, without the supporting Uno hardware. In that case, all the USB stuff is gone anyway.

The following diagram indicates that the RX/TX pin of your audio device carries TTLUART signals; so, you can connect the device directly with UNO preferably with a soft UART (SUART) Port instead of a hard UART Port (0, 1) as the later is engaged with Serial Monitor/IDE for sketch debugging and uploading.

Hi Golam, thanks for taking the time to give input. However, this is actually what I want to avoid if I can. My question is specifically about whether it's electrically acceptable to connect things to the actual TX/RX pins, provided I only do so after disconnecting the USB port. This is preferable, since this will be the situation after I move my prototype off the Uno and onto a "naked" ATmega chip.

Thanks again!

Pins 0 and 1 - as they appear on the headers - are isolated from the USB chip by 1k resistors so the serial (not "TTL") interface on the DFPlayer should override this nicely.

Poor idea to use a "naked" ATmega - just use a Pro Mini board. Cheaper, easier and more reliable.

Excellent news, many thanks, much appreciate the information

tobyeggitt:
My question however, is this. If I attach this device to pins 0 and 1, will there be an electrical conflict with the output of whatever it is that interfaces between the USB port on the Uno and the actual ATmega chip?

Yeah If you connect your module with hardware serial, then you won't be able to upload code, as these Pins 0 & 1 are internally connected with USB.

Similarly, in operation if you are sending or receiving any Serial Data using USB then it will create problem.

So, it's always better & recommended that you use Software Serial instead of hardware serial.

Or use a board like the Pololu A-Star, which has two hardware UARTs available.

jackthomson42:
Yeah If you connect your module with hardware serial, then you won’t be able to upload code, as these Pins 0 & 1 are internally connected with USB.

Similarly, in operation if you are sending or receiving any Serial Data using USB then it will create problem.

As he refers to swapping to a “naked” ATmega chip (not a good idea as I have pointed out, a Pro Mini is more practical), I think we can conclude that he has no intention of communication with a PC. :grinning:

In fact, the vast majority of applications for an Arduino do not involve (wired) connection with a PC because if you need a PC, you would generally be using the PC itself as the “brains”. :sunglasses:

Paul__B:
… “naked” ATmega chip (not a good idea as I have pointed out, a Pro Mini is more practical), I think we can conclude that he has no intention of communication with a PC. :grinning:

Paul has picked up on the details here :slight_smile: This is indeed a totally standalone device, and I have no use for external communication other than with a human via the four buttons and an OLED display.

I will ask, however, if Paul would be willing to expand on why he thinks the naked ATmega is undesirable. My reasoning so far: At $2/CPU plus pennies for a crystal and caps, combined with the programming capabilities of an Arduino Uno with a ZIF socketed CPU (and a trivial breadboard circuit for burning bootloaders) this seems like a fine way to go. Oh, also, this project mandates that I design a PCB for the rest of the circuits, so including the CPU on that board is not a big deal either (through-hole version, for sure!)

But, so often one’s own fine plans miss something that’s obvious to other folks, so what are the features you think I shall regret leaving behind if I go “naked”?

And again I might be missing something but the Pro Mini seems to be “retired” https://store.arduino.cc/usa/arduino-pro-mini

The Pro Mini may be "retired" on the Arduino site, but China and eBay neither know nor care about that. :roll_eyes:

If you can get a CPU for $2, then you can get a "clone" Pro Mini for the same price and I am pretty sure it will be the same chip manufacture.

If you are making one - or ten - units, then it simply is not worth the trouble of inventorying the parts if you can simply mount a Pro Mini as a daughterboard. And you can even mount a daughterboard over other parts in "high-rise" fashion.

And again I might be missing something but the Pro Mini seems to be "retired" https://store.arduino.cc/usa/arduino-pro-mini

The Pro Mini was designed by Sparkfun (possibly for Arduino). It's still available: https://www.sparkfun.com/products/11113. As expected, it's more expensive than the clones.

All useful insight. Thanks everyone!