ESP32 Development Kit Datasheet Highlights

ESP32-WROOM-32-Datasheet

ATtiny85 Development Board (Digispark) Datasheet Highlights

ATTINY85-Datasheet

Comparison Summary

eps32vsattiny85
Feature ESP32 ATtiny85
Processing Power Dual-core 32-bit processor at 240 MHz 8-bit processor at 20 MHz
Connectivity Wi-Fi and Bluetooth support No native connectivity
GPIO and Peripheral Interfaces 34 GPIO pins, ADC, DAC, PWM, communication protocols 6 GPIO pins, limited I/O options
Power Consumption Higher consumption, especially with Wi-Fi/Bluetooth Low-power, efficient for simple tasks
Development Workflow PlatformIO, more complex libraries Arduino IDE, limited libraries

ATTiny85 Digispark on Arduino IDE

  1. Open Arduino IDE and go to File > Preferences.
  2. In the Additional Board Manager URLs field, add the following URL: https://raw.githubusercontent.com/digistump/arduino-boards-index/master/package_digistump_index.json
  3. eps32vsattiny85
  4. Go to Tools > Board > Board Manager and search for "Digistump AVR Boards."
  5. Install Digistump AVR Boards by Digistump.
  6. eps32vsattiny85
  7. Select the correct board configuration:
    • Go to Tools > Board and select Digispark (Default - 16.5 MHz).
  8. Uploading Code to Digispark:
    • The upload process requires the board to be unplugged initially.
    • Click "Upload" in Arduino IDE. When prompted, plug in the Digispark board.
    • The uploader will detect the board and overwrite the old program with the new code.
  9. eps32vsattiny85
  10. Since the Digispark lacks a serial interface via USB, use DigiKeyboard to output results directly to a text editor by simulating keyboard inputs.
  11. eps32vsattiny85

Code for Performance Testing on ATtiny85 (Digispark)


            #include <DigiKeyboard.h>

void printText(const char* text) {
    while (*text) {
        DigiKeyboard.write(*text++);
        DigiKeyboard.delay(60);
    }
    DigiKeyboard.println("");
    DigiKeyboard.delay(400);
}

void printNumber(unsigned long number) {
    char buffer[10];
    ltoa(number, buffer, 10);
    printText(buffer);
}

void setup() {
    DigiKeyboard.delay(1000);  // Time to open a text editor
    printText("Starting Performance Test...");

    // 1. Test Arithmetic Speed
    unsigned long startTime = millis();
    volatile long sum = 0;
    for (long i = 0; i < 100000; i++) {
        sum += i;
    }
    unsigned long endTime = millis();
    printText("Arithmetic Time: ");
    printNumber(endTime - startTime);
    printText(" ms");

    // 2. Test Digital I/O Speed
    pinMode(1, OUTPUT);
    startTime = millis();
    for (long i = 0; i < 100000; i++) {
        digitalWrite(1, HIGH);
        digitalWrite(1, LOW);
    }
    endTime = millis();
    printText("Digital I/O Time: ");
    printNumber(endTime - startTime);
    printText(" ms");

    // 3. Test Delay Accuracy
    startTime = millis();
    delay(1000);
    endTime = millis();
    printText("Delay Accuracy: ");
    printNumber(endTime - startTime);
    printText(" ms");

    printText("Performance Test Completed.");
}

void loop() {}
        

Expected Output on Text Editor (via DigiKeyboard)

Starting Performance Test...
Arithmetic Time: 195 ms
Digital I/O Time: 703 ms
Delay Accuracy: 969 ms
Performance Test Completed.

ESP32 Development Board on PlatformIO

  1. Open PlatformIO and start a new project by clicking on New Project.
  2. eps32vsattiny85
  3. Select the correct board, give your project a name, and choose the development framework.
  4. eps32vsattiny85
  5. Set the correct baud rate for serial messages. Open the platformio.ini file and set the baud rate to 115200:
  6. monitor_speed = 115200
    eps32vsattiny85
  7. Build the code by clicking on the Build icon.
  8. eps32vsattiny85
  9. After building successfully, click the Upload icon to flash the code to your ESP32.
  10. eps32vsattiny85
  11. Open the Serial Monitor to view the results. Set the baud rate to 115200 to ensure correct display.
  12. eps32vsattiny85

Expected Output on Serial Monitor

Starting Performance Test...
Arithmetic Time: 4 ms
Digital I/O Time: 68 ms
Delay Accuracy: 1001 ms
Performance Test Completed.

Summary of Performance Testing Code

The performance testing code for both the ATtiny85 (Digispark) and ESP32 microcontrollers is designed to evaluate basic processing and operational capabilities by conducting three performance tests:

Performance Comparison: ATtiny85 vs ESP32

Test Type ATtiny85 (Digispark) ESP32
Arithmetic Speed 195 ms 4 ms
Digital I/O Speed 703 ms 68 ms
Delay Accuracy 969 ms 1001 ms

Suitability for Applications

The ESP32 outperforms the ATtiny85 in terms of processing power and speed. With significantly faster arithmetic and I/O operations, it is well-suited for applications requiring complex calculations, real-time data processing, IoT capabilities, and networked applications due to its integrated Wi-Fi and Bluetooth.

The ATtiny85, while slower, is highly efficient for simple tasks and consumes less power. It is ideal for low-power, isolated applications such as small embedded systems, simple sensors, or tasks where only basic digital I/O control is needed without connectivity or intensive processing.

In summary, choose the ESP32 for high-performance, connected, or real-time applications and the ATtiny85 for basic, low-power, standalone projects.

Download Links:

Link to the code for testing the Digispark-ATTINY85-Board: Download

Link to the code for testing the ESP32-Board: Download

I have tested other boards with Michael Bennemann: Link