Hot answers tagged

19 votes
Accepted

What's the difference between all the Software Serial Libraries? Which one is Arduino Nano compatible?

This answer lists the 4 basic choices: HardwareSerial, always the best. Simply use the pre-defined Serial variable. On some Arduinos, there are extra HardwareSerial ports, called Serial1, Serial2, ...
  • 2,009
13 votes
Accepted

How to work with non-traditional UART baud rates

The Arduino Nano cannot do 800 kb/s. As you can see in the source code, the bit duration is rounded to the nearest multiple of 8 CPU cycles. In your case, it is rounded to 3 × 8&...
  • 39.3k
6 votes

How to define a SoftwareSerial object inside a class?

Personally I wouldn't go down this route. Instead I would pass a Stream object (as a pointer or a reference) to the constructor and use that. Then it is up to your sketch to define what that Stream ...
  • 104k
6 votes

How to upload code without closing puTTY

There is an open source project that will do what you want. http://com0com.sourceforge.net/ The com0com will create virtual com ports for the programs to connect to. The hub4com will allow you to ...
  • 1,213
5 votes
Accepted

Is it possible to receive a 9 bit protocol on the Arduino Uno with Arduino?

If you want to set the UART to 9-bit mode, you will have to set the UCSZ02 bit of the _ucsrb register to 1 in HardwareSerial::begin(). For example: void HardwareSerial::begin(unsigned long baud, byte ...
  • 39.3k
5 votes
Accepted

Is it possible to extract a hex file via UART from an Arduino?

AVRDUDE which is used by the IDE to send the content of HEX file from your computer, as a feature letting it to get back the data of the flash, in order to compare and see if data are correct. For a ...
  • 335
5 votes

How to chose softserial library use on Arduino project?

I think your problem is that you need 4 serial ports. With software serial that's just not going to happen: SoftwareSerial can only receive on one serial port at any given time. AltSoftSerial is ...
  • 104k
5 votes
Accepted

Send structure through Serial

I tried the code from the link you posted and it worked: struct Gyro_data_structure { char command_name[6]; int gyro_X; int gyro_Y; int gyro_Z; }; struct Gyro_data_structure ...
  • 407
5 votes

Serial.print skips or hangs inside a "if" statement. Trying to call a function VIA serial uart

High likely you are exceeding your character array, see: char a[5]; Which can hold 5 characters. However, you write: if(strcmp(a,"RGB_1") == 0) Which assumes you receive "RGB_1" ...
5 votes
Accepted

Bi-directional UART communication on single data wire, possible?

You can have bidirectional communication over a single wire by using open-collector outputs. For this, you could add a circuit like this on each side of the link: simulate this circuit – ...
  • 39.3k
4 votes
Accepted

ESP8266 not able to communicate over serial connection with arduino UNO

The problem is in your loop() function. On each iteration, you will receive at most one character from the SoftwareSerial, while writing the same AT command again and again. As a result, your slave ...
4 votes
Accepted

Can Arduino Leonardo use USB port and RX TX serial pins at the same time?

32u4 is multi-serial uC. USB connection works on default serial communication which can be used via Serial.print("somevalue"). On the other hand if you want to use RX/TX on pins 0, 1 which are ...
  • 394
4 votes
Accepted

How do I know the IP address assigned to an ESP8266?

If you give your board a name with WiFi.hostname("MyESP8266"); (for example) you can then look on your router in the section that lists DHCP assignments (on my Netgear it's Attached Devices). That ...
  • 104k
4 votes

Double Speed Operation for USART on Arduino Mega 2560

When in double-speed mode, as noted in the manual, fewer samples are used. In Asynchronous serial communication, there is no clock signal, so the clock that keeps the two devices in sync is ...
  • 6,952
4 votes
Accepted

Baud rate of Arduinos bootloader

The bootloader runs in the 328, and just as your application programs do, it sets a UART baud-rate for uploading programs to the Uno. Current bootloaders use 115200 baud for upload; the most recent ...
  • 14.7k
4 votes
Accepted

Arduino Mega reading same information that it's sending out via serial

I ran a slightly modified version of your test code on a Mega 2560 and got no echo at all; Unless I totally misunderstood your problem description, there must be something else going on. Here's the ...
4 votes
Accepted

Arduino UARTS Auto addressing slaves

The first slaves will be plugged in and will send to the master his default address If this happens while the master is talking to one of the other slaves, you risk a collision. I suggest a very ...
  • 39.3k
4 votes
Accepted

Standalone ATmega328P stops responding when RX is connected

There are two things wrong with the circuit in that demo. There is no decoupling capacitor on the power pins. This is required to keep the power stable during opertaion. More critically: this is ...
  • 104k
3 votes
Accepted

Cannot control servos through 32-servo-controller on Aurduino Duamilanove

There is one connection missing - the one that powers the servo and board. At the moment your servo board is getting a small amount of power through the RX pin - disconnect it immediately, you are ...
  • 104k
3 votes
Accepted

Custom Arduino library problem

uart::uart(void); That's a prototype, not a function. It needs a body. Also, using "void" to say "no parameters" is really confusing. Better to leave it out all together. uart::uart() { } uart....
  • 104k
3 votes
Accepted

What protocols and tools does Arduino Due use for flashing and debugging?

The Due (more specifically the SAM3X) uses its own proprietary protocol. It's all embedded in the bootloader, which is hard wired in the ROM and can never be changed (idiotic if you ask me). I know ...
  • 104k
3 votes
Accepted

Accepting strings and integers via UART

As we don't know what you are using as a terminal program we can't comment specifically on your choice of EOL characters. It is likely you are receiving everything in ASCII code. That is, when you ...
  • 6,786
3 votes
Accepted

ESP8266 Programming using ESP-01 to USB converter

Finally I made a breadboard connection joining ESP8266's GPIO 0 and GND to Programmer's GND for flashing the chip For more info Additional Reference: Programming ESP8266
3 votes

How to save a hex file into Arduino Flash to send it via Serial?

If I understand your question correctly, you need to integrate this data into a .ino script. Probably as a byte array. Then the script can read the array and Serial.write its content. You could ...
  • 1,551
3 votes
Accepted

UART communication issue on Arduino Mega

Serial.flush() only empties the output buffer, so that won't achieve anything. Reading exactly 9 bytes and hoping they match the input stream is not very effective, as you found. If you are out of ...
  • 35.7k
3 votes

Single-channel serial communication

Bidirectional Asynchronous Serial schemes are not uncommon. The famous ones, like RS485, utilize special line drivers and differential signalling, but for short distances you can accomplish something ...
3 votes

Capacitor Questions

Every active chip should have adequate decoupling. That is the point of C3, to provide decoupling for the MCU. It is required. While you don't need capacitors on the output of a non-existent ...
  • 104k
3 votes
Accepted

Stopping Serial on RX/TX pins while running Serial on USB

The Serial and Serial1 are two seperated ports. They are not connected. The Serial is the USB serial and does not use pin 0 and 1 at all. The Serial1 is the hardware serial port at pin 0 and 1, but if ...
  • 3,145
3 votes

Solution for simple multi-Arduino communication network (or alternative?)

Thanks all for your answers. I did some more research with the new info you provided and found my perfect solution: TCA9548A. That's a 1-to-8 port i2c multiplexer that will allow the master MEGA2560 ...
  • 61
3 votes
Accepted

how to send data to Adafruit Bluefruit Feather (32u4) over bluetooth?

The “UART” being referred to is the Nordic UART GATT Service. This is not a serial port or USB connection. It is a high level BLE protocol that simulates a serial port via the Bluetooth connection. ...

Only top scored, non community-wiki answers of a minimum length are eligible