Go Down

Topic: arduino pro mini - hardware serial vs software serial (Read 293 times) previous topic - next topic

_butch_

Hi,

my arduino mini 3.3V 8Mhz is talking to HM-11  BLE Device via SoftwareSerial on pins 10 and 11.
I noticed that I often got garbage characters at baud 115200 although arduino and BLE module have correct baud set. Often the chars only have a small offset in ascii table.

After reducing the baud to 19200 its solidly working. Haven't tested longer time with 57600 or 38400 to see if it is really stable.

I would like to have as low delay as possible between sending and receiving, because I will use it as remote control for small vehicles or robots.

Currently I am using HW Serial for Serial debugging / logging, setting the baud at the same level.

Is HW Serial faster than SW Serial, so could I get higher stable baud rate, if I would connect RX and TX to BLE device?

Is it possible to flash the arduino pro mini via other RX-TX ports than the HW ones?  The BLE module's connection is soldered to arduino, so I cannot remove it for a flash process of the arduino.

Thanks, Butch

PieterP

Yes, hardware serial is superior to SoftwareSerial in every way.
SoftwareSerial is a hack, that wastes resources, can be unreliable, and is much slower.
It's fine for debugging, but I wouldn't use it in any finished project.

I understand that you want low latency, but even at 19200 baud, this shouldn't be an issue (unless you're sending a lot of data). It will probably not be noticable with the naked eye.

You should be able to program the Pro Mini over SPI, but that's much more involved than using a USB to Serial adapter. I'd recommend mounting the Arduino in a socket, instead of soldering.

Pieter

jremington

#2
Jan 23, 2019, 09:26 pm Last Edit: Jan 23, 2019, 09:28 pm by jremington
You can use a programmer (this one works very well) to flash the Pro Mini, and then use the hardware serial port for other purposes.

These eBay Pro Minis have the appropriate 6 hole programmer pinout for that programmer, bottom left corner of image. Most of the other Pro Mini knockoffs don't, and if you buy the wrong one, you will have to make your own programming connector.
No PM's please.

adwsystems

You can use a programmer (this one works very well) to flash the Pro Mini, and then use the hardware serial port for other purposes.

These eBay Pro Minis have the appropriate 6 hole programmer pinout for that programmer, bottom left corner of image. Most of the other Pro Mini knockoffs don't, and if you buy the wrong one, you will have to make your own programming connector.
It was my understanding (from previous threads here and elsewhere) the Pro Mini was originated from SparkFun and they don't have a 6 hole programming port. That aside. Can you be more specific on which set of 6 holes from your link is for the programmer?

PieterP

It was my understanding (from previous threads here and elsewhere) the Pro Mini was originated from SparkFun and they don't have a 6 hole programming port.
I think you're confusing the Arduino Pro Mini with the Sparkfun Pro Micro :)

jremington

#5
Jan 24, 2019, 07:24 pm Last Edit: Jan 24, 2019, 07:29 pm by jremington
Quote
Can you be more specific on which set of 6 holes from your link is for the programmer?
ISP programming port outlined in black below. The underside of the board is clearly labeled with MOS, SCK, etc.


I have several of these. Over several years, not one has failed and they are ideal for low power projects. I remove the voltage regulator and the power LED to make the equivalent of a "bare bones" Arduino.
No PM's please.

pert

The official SparkFun Pro Mini doesn't have the ICSP header. The ones on eBay are a Pro Mini derivative that has been improved. Note also that all the holes except for the FTDI header are on-grid. The SparkFun board has A4-A7 off-grid.

Go Up