Skip to main content
Share Your Experience: Take the 2024 Developer Survey
11 votes

On an esp8266 what is faster, 64-bit math or float math?

Calculating the relative performance of 64 bit integer versus floating point multiplication is a little more difficult than it would appear. It's easy to time a loop that does thousands of ...
romkey's user avatar
  • 1,554
8 votes
Accepted

Will an ATmega2560 board be faster than a Uno for hard real-time data logging?

No, it will not be any faster. The extra instructions are to access the extra flash memory of the 2560. Instructions like EIJMP - Extended indirect jump, EICALL - Extended indirect call, etc. The ...
Majenko's user avatar
  • 105k
6 votes

How do I convert 0-5v PWM to a 0-12v PWM

I advice you to learn about basics of how to connect external components to MCU. Anwser to your question is simple transistor amplifier... So you can use bipolar transistor (NPN/PNP) or MOSFET... ...
Sahasrar's user avatar
  • 161
6 votes

On an esp8266 what is faster, 64-bit math or float math?

OK, I took the trouble to code fixed-point routines and test them. Here is the code ... // fixed-point routines for 20 bit integer / 12-bit fraction // format 0xfffff.fff, max value is +-524288.9998 ...
mark-hahn's user avatar
  • 287
5 votes

Will an ATmega2560 board be faster than a Uno for hard real-time data logging?

Use the newest Arduino IDE, because some time ago the 'lto' option was added which is a major optimization for both speed and size. It is possible to test a few compiler options with the #pragma. Try ...
Jot's user avatar
  • 3,246
5 votes
Accepted

What is the maximum frequency input signal that I can accurately track on a GPIO pin?

As Majenko wrote, when you only rely on software to measure the frequency on a IO pin, it will always be rather slow. And it also depends on the code, that you use. Functions like digitalRead() are ...
chrisl's user avatar
  • 16.3k
3 votes

Will an ATmega2560 board be faster than a Uno for hard real-time data logging?

In the platform.txt file found in ~/Arduino15/packages/arduino/hardware/avr/1.6.17 or similar, you can change the three instances of -Os with -Ofast. The size of the code can increase dramatically ...
dda's user avatar
  • 1,588
3 votes
Accepted

Why ESP8266 slower than Arduino nano?

However, despite ESP8266 running at 160MHz, 10 times faster than nano, it's taking 3.5 ms to complete the loop, compare to 2.5 ms than that of nano. There's a number of reasons for that. Chiefly: ...
Majenko's user avatar
  • 105k
3 votes

Am I at the limit of UART transmission time?

At 115200 baud you can send 11520 characters per second. At 20 bytes per packet you can send 576 packets per second. That's 1,736µs per packet. That's assuming zero wait between bytes. That's not ...
Majenko's user avatar
  • 105k
3 votes

Arduino Nano: Send a few bytes over Serial with as little delay as possible

"Slowing down to speed up". - a Chinese proverb The problem is with your python code. Not sure what your computer's operating system is, but if you are using Mac or Linux, if you run top ...
hcheung's user avatar
  • 1,381
3 votes

How do you deal with balancing the limited storage of Arduino with the decrease in speed if you just print everything as it gets measured?

This is all about choosing the right tool for the job. At the moment you're trying to fit 50 clowns into a mini. While there are ways of doing it (by extending the "mini" outwards with extra ...
Majenko's user avatar
  • 105k
3 votes
Accepted

How to increase pinout switching?

You do not need to go all the way down to assembly in order to get that speed. You can do direct port access from your .ino file: void setup() { DDRA |= _BV(PA0); // pin 22 = PA0 as output ...
Edgar Bonet's user avatar
  • 43.2k
2 votes
Accepted

How fast is a SD page read from a file?

So my question: is 20 ms enough to read like 50 pages of 512 bytes from an SD card which are located on different (but known) file offsets within a 2+ MB file? Let us do the numbers: 50 * 512 = 25 ...
Mikael Patel's user avatar
  • 7,969
2 votes

How do I lower clock speed for MKR1000?

48 MHz is a multiple of 16MHz. Why not just adjust the timing code to account?
jose can u c's user avatar
  • 6,974
2 votes
Accepted

Can I get the current connection speed with ESP8266?

Wifi modules decide on link speed based on signal strength. So you can estimate the link speed with signal strength, which you can get with WiFi.RSSI(network). The datasheet of ESP8266 contains a ...
Dmitry Grigoryev's user avatar
2 votes

How to get Velocity and Displacement from IMU sensor?

The error in this method would be massive. Velocity is the integration of acceleration over time. However, you don't have acceleration over time - you only have acceleration at discrete points in ...
Majenko's user avatar
  • 105k
2 votes

What is the maximum SPI speed for a slave Uno/clone?

The maximum speed for Arduino as a slave is F_CPU/4, so it's 4Mbps. When the Arduino is the master it can work at F_CPU/2, so it's 8Mbps
bouaaah's user avatar
  • 71
2 votes
Accepted

GPS showing incorrect speed

Speed calculation in most GPS systems is very crude. It consists of simply "Where was I then? Where am I now?". Many will also add "How long has passed between then and now?", but many also don't - ...
Majenko's user avatar
  • 105k
2 votes
Accepted

Uniform timing when using Arduino for data acquisition

the ADC is LTC1859 and triggers on the slave select falling edge. No, it doesn't. Here is a link to its datasheet. It has a pin labeled CONVST, for “conversion start”. According to the section Pin ...
Edgar Bonet's user avatar
  • 43.2k
2 votes
Accepted

Increase and Decrease Motor Speed

It won't work, as you don't give it any time to do anything. The PWM works about 1kHz and motor needs much more time to start rotating. And you are sending values as fast as possible (it means ...
KIIV's user avatar
  • 4,752
2 votes
Accepted

Creation of multiple power cells to be controlled by Arduino

OK. Looks much better now. And I see one problem. It seems that the normal way to do the speed control is with a pot. A variable voltage at the input depending on the rotation. The Arduino low end ...
Rudy's user avatar
  • 993
2 votes

How to increase the serial port's data throughput

If you are looking for throughput then stop sending the ASCII conversion of numbers and just send the numbers. In other words, use Serial.write() rather than Serial.print(): you can send ~25k integers ...
Roberto Lo Giacco's user avatar
2 votes

Ethernet Shield: Maximum speed

A guy on this forum reports achieving 100 Kbyte/sec with a W5100 ethernet shield, which would be 800 kbit/sec: https://forum.arduino.cc/index.php?topic=555957.0
EricP's user avatar
  • 121
2 votes
Accepted

Ethernet Shield: Maximum speed

It's not just the SPI what limits overall speed. You also need some proccessing power, and AVR based Arduinos lacks of it. It all depens what do you want to do with data. If you need some serious ...
KIIV's user avatar
  • 4,752
2 votes
Accepted

Serial Port fails with speeds greater than 19200

Answer is simple. You assign 38400 to a variable of type int. The signed range of integer values that can be stored in 16 bits is −32,768 through 32,767;
Juraj's user avatar
  • 18k
2 votes
Accepted

Measure revolutions per second with reed switch

It sounds like occasional "misses". Possible causes include: the magnet passing far enough from the reed switch to "only just" trigger it [narrow the gap.]; the magnet's passage being too short for ...
JRobert's user avatar
  • 15.3k
2 votes

Determing approximate bicycle speed for distancemeter

I have built many years ago a device nearly identical to what you describe. I did not have the additional requirement of a minimum speed of 10 kph, however. As noted in the comments, that is likely ...
fred_dot_u's user avatar
2 votes
Accepted

How to slowly change direction of the stepper motor with AccelStepper?

I have tested it on real motor, and it works as I want with function .moveTo . Speed slowly changed from +maxSpeed to -maxSpeed acording to Acceleration #define maxSpeed 1000 #define Acceleration 500 ....
user1329019's user avatar
2 votes

How do I convert 0-5v PWM to a 0-12v PWM

As far as I can tell the Arduino does not have open collector outputs, so you can mimic one as follows. The following inverts the Arduino output signal, so some adjustment is needed there when ...
copper.hat's user avatar

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