As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [performance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
79 views

best practice for performance: empty loop() when using interrupt?

I'm working on a little midi hardware project and I'm using attachInterrupt() to assign a callback function to an interrupt pin. Nothing gets done in the loop function, so it looks like this: void ...
strudelkopf's user avatar
-1 votes
1 answer
64 views

UDP Packet Loss

I have an application on a PC that sends 10 UDP packets to an Arduino Portenta board. When sending packets with no delay, half of them are lost. Wireshark shows the packets are correctly sent by the ...
Simon's user avatar
  • 99
0 votes
1 answer
192 views

Hardware implementation of trigonometric functions? [closed]

Is anybody aware as to whether there are any modern microcontrollers that have hardware implementations of trigonometric functions? According to my understanding, modern CPUs have basic maths ...
fortytoo's user avatar
  • 101
1 vote
1 answer
64 views

What is the overhead of a saturated serial connection at 256k baud?

I have am putting together multiple arduinos on a RS485 network (connected to Rx/Tx on the arduino and using Serial - connection via one of these https://www.ebay.co.uk/itm/272929871278) - RS485 ...
Simm's user avatar
  • 51
1 vote
1 answer
227 views

Asymmetric encryption on a Teensy?

I want to monitor an input and then send the information in an encrypted way that can't be easily unlocked even if a malicious actor gets access to the device itself. I'm new to using the Teensy ...
joel_xay's user avatar
1 vote
0 answers
54 views

Having a bunch of global variables or calculate them on the go on an Arduino, as far as memory is concerned

So I'm new in the arduino world but I have a grasp of object oriented programming, and decided to write a little library for running games on an arduino mega using a display. My question is, I'm ...
Juan's user avatar
  • 11
2 votes
0 answers
78 views

Reliably using analogRead as a compact digitalRead

My goal is to reduce pins being used for micro-controllers with limited pins, or projects requiring a few different digital input values. How I intend to do so is by using ADC pins to gather four ...
B7th's user avatar
  • 167
1 vote
0 answers
126 views

I have three load cells can I sum all the three into Arduino to be one output? If yes how?

I am doing stand thrust and I have three load cells to measure the force. I would like to know if I can sum them to gather into the Arduino or I should use a junction box.
mansour ahmed's user avatar
1 vote
0 answers
991 views

Reduce time between two consecutive SPI transfers on ESP32

I'm trying to drive an external DAC via SPI interface using ESP32 chip. But I cannot achieve the desired speed (>1M transfers/sec, each transfer consists of 16bits). The reason is not the SPI speed ...
Wjx's user avatar
  • 111
1 vote
2 answers
233 views

Use of "static" with "RTClib"

I've got a question concerning the Arduino library "RTClib" by Adafruit and the use of the word "static". Here you can see an excerpt from the example provided for the pcf8523 real-time clock: #...
blackdaw's user avatar
0 votes
2 answers
322 views

Difference in increment & decrement loop execution speed

I was experimenting with for loops when I noticed that a simple increment loop executes faster than a decrement loop. I can't think of any reason why it should be like that. Is there something in my ...
Zaffresky's user avatar
  • 183
4 votes
1 answer
3k views

Why does Arduino IDE take so long to open?

I have Arduino IDE, version 1.8.10 (Windows 10 x64, 8GB RAM, i5-7200 @2.5GHz) on a network drive mapped to D:, on a 100Mbit wired network and fast file server. If I navigate to the network shared ...
Ryan Griggs's user avatar
0 votes
1 answer
1k views

real-time reading of a quadrature encoder at full resolution with only one interrupt on ATmega328

I want to read a quadrature rotary encoders at full resolution with only one interrupt on Arduino Nano (ATmega328). So I found out that we can use XOR to reach a full resolution: Where pin 3 ...
Foad's user avatar
  • 143
1 vote
0 answers
50 views

Same software on single ESP-12f slower than on NodeMCU

I have programmed a small software to control an LED strip using an esp. I've written a web app which sends a request to the esp which then applies the color. So far everything works, but I've got a ...
matthesinator's user avatar
2 votes
1 answer
3k views

Slow refresh rate on I2C OLED screen

I'm trying to create a small handheld console with 6 buttons and an I2C 0.96" OLED display: https://imgur.com/a/AKiRMWN The directional buttons use the analog pin and different resistors technique to ...
none none's user avatar
  • 133
5 votes
3 answers
4k views

Why is Serial.Write that slower when writing x+1 characters than when it is writing x characters?

Using Serial.Write() in a time sensitive application. I realize that the number of characters being written not only had an impact on the time spent writing in the buffer, but actually had a bigger ...
Alex Millette's user avatar
-3 votes
2 answers
273 views

Why would anyone use Arduino in 2017? [closed]

Sorry for clickbait question but it really bugs me why Arduino is still a thing in the age of ARM based boards like Pine64, Raspberry Pi, Bannana Pi, Whatever Pi etc. I'm more or less aware of ...
Lapsio's user avatar
  • 113
7 votes
5 answers
2k views

When Raspberry Pi is preferred over Arduino

We are doing some projects in class. One of my friends is doing a weather and humidity station using raspberry Pi with a couple of sensors and LCD. I have a little experience in Arduino. So I asked ...
Meenie Leis's user avatar
2 votes
2 answers
233 views

for loop reads pots, passes value to PWM pins, can this be in the same for loop?

In the code below I am using a for loop to iterate over analog pins (potentiometers) and pass their value, after being mapped, to PWM enabled analog output pins (currently controlling LED brightness). ...
caseyanderson's user avatar
1 vote
1 answer
3k views

Optimizing Arduino File Selection from SD card

the following code will display the files on an SD card in an Arduino and allow the user to open a file of their choosing. Here's the code with a walkthrough of what it does. In the Init state, I ...
ATE-ENGE's user avatar
  • 913
1 vote
1 answer
334 views

Speedometer slow reaction arduino

I'm trying to make a speedometer, with utilization of interrupt for get number of pulse and some calculation for getting speed, but when compute speed the arduino freeze for some second and i lose ...
Francesco Valla's user avatar
-1 votes
1 answer
866 views

How to speed up writing a file to a WifiClient?

I'm working with a Realtek Ameba IoT RTL8195 board that's compatible to Arduino. I have a text file on an SD card that I want to send via HTTP over wifi, with the Ameba acting as a server. I ...
cross's user avatar
  • 23
0 votes
1 answer
244 views

Extrapolate require MCU from Arduino MEGA2560 performance

I am running a control program for an ebike on an Arduino MEGA2560 which uses this MCU: http://www.atmel.com/devices/atmega2560.aspx. Currently, the program loops every 100ms which gives me a sample ...
Eliott W's user avatar
  • 131
2 votes
2 answers
2k views

Does serial speed affect performance of other tasks?

I have explored Google and the Arduino site and this site and cannot find a mention of this, so my guess is that serial is handled by a separate component to the core processing and so different ...
AberrantWolf's user avatar
1 vote
1 answer
74 views

Performance tuning PORTB manipulation - mask

I have the following snippet that seems to be taking a total of 6 CPU cycles per invocation. Can I speed this up somehow? x is a byte with the 3 lowest bits set. #define SET_COLOR(x) PORTB = (PORTB ...
ChristopheD's user avatar
5 votes
3 answers
3k views

Will unnecessary Serial.print() statements slow down my program?

I have lots of Serial.print() and Serial.println() statements throughout my (rather large) program for debugging when things fail. I've commented out the Serial.begin() statement so I don't slow down ...
Alexander Mills's user avatar
8 votes
2 answers
4k views

OOP vs Inline with Arduino

I have been programming for quite a while now but I am new to Arduino and AVR Programming. The main question I have about programming these Micro-controllers is are there major differences in ...
Andy Braham's user avatar
1 vote
1 answer
335 views

Help needed understanding Due performance

I'm going to be writing some performance critical code and have started trying to get an understanding of timers and how much "work" the Due CPU can do per second. To help get started with this, I ...
Mick Waites's user avatar
0 votes
1 answer
351 views

Comparison of an Arduino's performance?

How does an AVR-based Arduino's CPU performance compare to a vintage PC (Apple II, PC-XT, TRS-80, et.al.)? How many megaflops of number crunching can one get out of an AVR-based Arduino?
hotpaw2's user avatar
  • 279
4 votes
1 answer
5k views

How much can an Uno be overclocked?

When running the board at room temperature (20 C) without any extra cooling mechanisms added, how much can the Arduino Uno be overclocked? Also, what would I need to change/update to overclock the ...
asheeshr's user avatar
  • 3,757
20 votes
2 answers
12k views

Would an infinite loop inside loop() perform faster?

When you're writing a typical sketch, you usually rely on loop() being called repeatedly for as long as the Arduino is running. Moving in and out of the loop() function must introduce a small overhead ...
Peter Bloomfield's user avatar
10 votes
2 answers
3k views

Why is int only 2 bytes?

When using C/C++ on other platforms, the int type is typically 4 bytes (or potentially more). However, on Arduino, it's only 2 bytes. Why is it different? Does it affect performance if I always use ...
Peter Bloomfield's user avatar