• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    C
  • Created over 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Improved version of Digistump avr core for Arduino

Deprecated and now (2023) unsupported!
Please use ATTinyCore instead!
 

Improved version of Digistump avr core for Arduino

Available as Arduino Board Manager entry "Digistump AVR Boards" using the Board Manager URL: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json

Version 1.7.6

New micronucleus bootloader and binary version 2.6 with info function.
First version without MH-ET LIVE Tiny88(16.0MHz) support, since it is now supported by ATTinyCore. It is not planned to add MH-ET LIVE Tiny88 support in the future.

TestCompile Commits since latest Hit Counter

Another great core for ATtinies with ongoing support is the ATTinyCore of Spence Konde, which currently added micronucleus support. Use the Board Manager URL: http://drazzy.com/package_drazzy.com_index.json for it.

Reduced code size was enabled by the following changes:

  • To shrink generated code size by 5 to 15 percent (depending on your code) the lto flag was added in platform.txt. To help finding code which consumes the flash, the generating of disassembler and memory map files are added. For Arduino IDE you will find these files in C:\Users<Name>\AppData\Local\Temp\arduino_build_.
  • To reflect the smaller bootloader size of micronucleus version 2.5 which allow 6586 instead of 6012 bytes (+11%) the upload.maximum_size entry was changed in boards.txt.
  • Since the original gcc version does not support the lto flag, the compiler path was changed to the latest Arduino gcc (7.3.0-atmel3.6.1-arduino5) in the package_digistump_index.json.

Other improvements

  • Added #define LED_BUILTIN in some pins_arduino.h.
  • Added #define __FlashStringHelper fstr_t in Print.h.
  • Updated broken extensa links for xtensa-lx106-elf-gcc in package_digistump_index.json.
  • Included most pull requests done after the 1.6.7 release like recipe.output.tmp_file={build.project_name}.hex in platform.txt and EEPROM library.
  • Added recipe to update booltloader by Arduino IDE.
  • Removed the non trusted post_install.bat since Arduino code states: // Set main and bundled indexes as trusted => all others are untrusted.
  • Extended DigisparkKeyboard library with 22 keyboard layouts from Teensyduino Core Library, fixed bugs, documented and improved it. Here it is documented how the mapping works, so now you can fix wrong mappings by your own (but please give me feedback to include the fix).
  • Fixed and extended a growing number of examples.

Digisparks

Installation

To get all the benefits, just replace the old Digispark board URL http://digistump.com/package_digistump_index.json (e.g. in Arduino File/Preferences) by the new https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json and install the Digistump AVR Boards version 1.7.2 or later.

Boards Manager

Manual installation

  1. Download this repo.
  2. Create a directory C:\Users\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.x and extract the digistump-avr-1.7.x.zip to it.
  3. Create a directory C:\Users\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.5 and extract the tools\micronucleus-cli-2.5-i686-mingw32.zip to it.
  4. Extract the file package_digistump_index.json to *C:\Users\AppData\Local\Arduino15*.

As reference you may look at your C:\Users\AppData\Local\Arduino\packages directory to see how other packages are installed.

Driver installation

For Windows you must install the Digispark driver before you can program the board.
if you have the Digistump AVR Boards already installed, then the driver is located in %UserProfile%\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.5\Digistump_Drivers. Just execute the Install_Digistump_Drivers.bat file.
Or download it here, open it and run InstallDrivers.exe.

Update the bootloader to a new version

Different bootloader configurations are available here.
To update your old, flash consuming bootloader, you have 2 choices.

  1. Use the new Digistump board manager URL (see above), choose a bootloader with Tools > Micronucleus variant and then burn it with Tools > Burn Bootloader.
    Burn Bootloader

  2. Run one of the Windows scripts like e.g. the 0_Upgrade-t85_recommended.cmd. The internal mechanism is described here.
    You may also test the t85_agressive bootloader, a configuration overwiew is available here. It works for my boards but the USB timing is not guaranteed as stable as in the other configurations.

Fuse setting

The meaning of fuses can be seen with the Engbedded Atmel AVR® Fuse Calculator. Windows helper scripts for setting fuses can be found here.

The default fuses for a Digispark board are:

  • ATtiny85 Lfuse: 0xE1 - (digispark default) PLL Clock + Startup 64 ms
  • ATtiny85 Hfuse: 0xDD - External Reset pin enabled (Pin5 not usable as I/O) + BOD 2.7 V + Enable Serial Program and Data Downloading
  • ATtiny85 Efuse: 0xFE - self programming enabled.

BOD enabled requires additional 20 µA in sleep state and therefore may be not desirable for low power battery applications. To disable BOD, use 0xDF as Hfuse.

The default fuses for a Digispark Pro board are:

  • ATtiny167 Lfuse: 0xFF - External crystal osc. Frequency 8-16 MHz + Startup 65 ms
  • ATtiny167 Hfuse: 0xDC - External Reset pin enabled + BOD 4.3Volt + Enable Serial Program and Data Downloading
  • ATtiny167 Efuse: 0xFE - self programming enabled.

Flash the bootloader to a bricked device

This can only be done by means of a High Voltage programmer.

16.5 MHz or 16 MHz?

You require 16.5 MHz only if your appliction uses the V-USB library, i.e. if it acts as an USB devive like mouse, keyboard etc.
In all other cases it is recommended to use the standard CPU frequencies of 16, 8, 1 MHz. This is the frequency the CPU is running after the bootloader part, which must run with 16.5 MHz!

Power reducing

Information about reducing power consumption can be found here and here. Final power reduction

Pin layout

ATtiny85 on Digispark

                       +-\/-+
 RESET/ADC0 (D5) PB5  1|    |8  VCC
  USB- ADC3 (D3) PB3  2|    |7  PB2 (D2) INT0/ADC1 - default TX Debug output for ATtinySerialOut
  USB+ ADC2 (D4) PB4  3|    |6  PB1 (D1) MISO/DO/AIN1/OC0B/OC1A/PCINT1 - (Digispark) LED
                 GND  4|    |5  PB0 (D0) OC0A/AIN0
                       +----+
  USB+ and USB- are each connected to a 3.3 volt Zener to GND and with a 68 ohm series resistor to the ATtiny pin.
  On boards with a micro USB connector, the series resistor is 22 ohm instead of 68 ohm. 
  USB- has a 1.5k pullup resistor to indicate a low-speed device.
  USB+ and USB- are each terminated on the host side with 15k to 25k pull-down resistors.

ATtiny167 on Digispark pro

Digital Pin numbers in parenthesis are for ATTinyCore library

                  +-\/-+
RX   6 (D0) PA0  1|    |20  PB0 (D8)  0 OC1AU
TX   7 (D1) PA1  2|    |19  PB1 (D9)  1 OC1BU - (Digispark) LED
     8 (D2) PA2  3|    |18  PB2 (D10) 2 OC1AV
INT1 9 (D3) PA3  4|    |17  PB3 (D11) 4 OC1BV USB-
           AVCC  5|    |16  GND
           AGND  6|    |15  VCC
    10 (D4) PA4  7|    |14  PB4 (D12)   XTAL1
    11 (D5) PA5  8|    |13  PB5 (D13)   XTAL2
    12 (D6) PA6  9|    |12  PB6 (D14) 3 INT0  USB+
     5 (D7) PA7 10|    |11  PB7 (D15)   RESET
                  +----+
  USB+ and USB- are each connected to a 3.3 volt Zener to GND and with a 51 ohm series resistor to the ATtiny pin.
  USB- has a 1k5 pullup resistor to indicate a low-speed device.
  USB+ and USB- are each terminated on the host side with 15k to 25k pull-down resistors.

MH-ET LIVE Tiny88 (16.0MHz) board

Digital Pin numbers in parenthesis are for ATTinyCore library

                       USB
                     +-\__/-+
              PA2  15|      |14  PB7
              PA3  16|      |13  PB5 SCK
           17 PA0  A6|      |12  PB4 MISO
           18 PA1  A7|      |11  PB3 MOSI
     (D17) 19 PC0  A0|      |10  PB2 OC1B/PWM SS
     (D18) 20 PC1  A1|      |9   PB1 OC1A/PWM
     (D19) 21 PC2  A2|      |8   PB0
     (D20) 22 PC3  A3|      |7   PD7 RX
SDA  (D21) 23 PC4  A4|      |6   PD6 TX
SCL  (D22) 24 PC5  A5|      |5   PD5
     (D23)    PC1  25|      |4   PD4
RESET         PC6 RST|      |3   PD3 INT1
LED           PD0   0|      |5V
USB-          PD1   1|      |GND
USB+  INT0    PD2   2|      |VIN
                     +------+
  USB+ and USB- are each connected to a 3.3 volt Zener to GND and with a 68 ohm series resistor to the ATtiny pin.
  USB- has a 1k0 pullup resistor to indicate a low-speed device.
  USB+ and USB- are each terminated on the host side with 15k to 25k pull-down resistors.

  Pins not available: PB6 is CLOCK_IN, PC7 is 25

Oak board

The Arduino ESP8266 core available with https://arduino.esp8266.com/stable/package_esp8266com_index.json supports the Digistump Oak board now, better use that.

Revision History

Version 1.7.6

  • Fixed bug #52 - pinMode(Pin,INPUT) does not disable internal pullup.

Version 1.7.5

  • New micronucleus bootloader and binary version 2.6 with info function.
  • First version without MH-ET LIVE Tiny88(16.0MHz) support, since it is now supported by ATTinyCore.

Version 1.7.4

  • Defined symbols DIGISTUMPCORE, DIGISTUMPCORE_MAJOR etc.
  • Last version with MH-ET LIVE Tiny88(16.0MHz) support, since it is now supported by ATTinyCore.

Version 1.7.3

  • Improved bootloaders.
  • Added Attiny support to usbconfig.h.
  • Added Burn Bootloader Method like in ATTinyCore.
  • Removed digistump-sam from repo.
  • ISR_NOBLOCK in millis interrupt only active for 16.5 MHz setting.
  • Improved DigiKeboard.h and keylayouts.h.

Version 1.7.2

  • Updated examples and added warnings for CDC examples.
  • Version to force update of all 1.7.1 changes.

Version 1.7.1 - rolling version

  • New micronucleus binaries for all platforms.
  • Bootloaders with updated MCUSR handling.

Version 1.7.0

  • Support of the cheap Chinese MH-ET LIVE Tiny88(16.0MHz) board with ATTinyCore.
  • Corrected wrong mouse buttons PR#2.
  • Updated boards.txt to make use of menus. Therefore some board names changed like digispark-tiny1 -> digispark-tiny:clock=clock1 etc.
  • Set OSCCAL to factory default instead of using a rule of thumb, which was not reliable.
  • Added linker flag -mrelax. This reduces code size at least for ATtiny167.

Version 1.6.8

  • The original Digistump version with lto and changed upload.maximum_size for micronucleus bootloader 2.5.
  • Added LED_BUILTIN definition in pins_arduino.h.
  • Added #define __FlashStringHelper fstr_t in tiny/Print.h.
  • Updated broken extensa links for xtensa-lx106-elf-gcc in package_digistump_index.json.
  • Included most pull requests done after the 1.6.7 release like recipe.output.tmp_file={build.project_name}.hex in platform.txt and EEPROM library.
  • Added recipe to update bootloader by Arduino IDE.
  • Changed message for BIN redefined in Print.h and it can be suppressed by commenting out #define SUPPRESS_BIN_WARNING in line 39 in Print.h.
  • Commented out the annoying #define true 0x1 and #define false 0x0 in wiring.h.
  • Removed unnecessary files like .gitignore.
  • Added #define TwoWire USI_TWI in Wire.h.
  • Changed #include <avr/delay.h> to #include <util/delay.h> in 3 files.
  • Included Multi-Keyboard Layout MOD.
  • Redefining BIN to 2 for print. BIN can not longer be used as bit position (7) for the x5 ADC "Bipolar Input Mode".
  • Enabled all warnings at compile time and removed compiler warnings in tiny core.
  • Modified definition for yield() in WProgram.h to avoid error "undefined reference to `yield()'".
  • Enabled compiler.cpp.extra_flags.

Requests for modifications / extensions

Please write me a PM including your motivation/problem if you need a modification or an extension.

If you find this library useful, please give it a star.

More Repositories

1

ServoEasing

Arduino library to enable smooth servo movement.
C++
305
star
2

Talkie

Refurbished Arduino version of the Talkie library from Peter Knight.
C++
210
star
3

Smart-Battery-Module-Info_For_Arduino

Arduino sketch, which helps detecting the connections of the I2C interface and prints info available from the SMB (SmartBatteryModule) laptop battery pack.
C++
111
star
4

micronucleus-firmware

Fork for the firmware / digispark part of the micronucleus repository
C
76
star
5

NeoPatterns

Patterns for NeoPixel strips and matrixes including the patterns of the NeoPattern Example by Adafruit.
C++
67
star
6

ATtinySerialOut

Minimal bit-bang send serial 38400/115200 baud for 1MHz or 115200/230400 baud for 8 or 16MHz ATtiny clock
C++
63
star
7

JK-BMSToPylontechCAN

Converts the JK-BMS RS485 data to Pylontech CAN data
C++
60
star
8

Arduino-BlueDisplay

Arduino library for the BlueDisplay App. The App converts your smartphone into an Android remote touch display.
C++
45
star
9

arduino-test-compile

Github Action to compile all examples of an Arduino library for one board and check for errors
Shell
41
star
10

PWMMotorControl

Arduino library to control brushed DC motors by PWM. Uses optional attached encoders to drive fixed distances.
C++
40
star
11

Arduino-FrequencyDetector

Fast audio frequency detector without fft for plain Arduino and Attiny85. Whistle switch example included.
C++
39
star
12

Ultimate-Battery-Tester

The ultimate battery tester with ESR measurement and discharge graph. Based on an Arduino Nano and a 1602 LCD.
C++
38
star
13

digitalWriteFast

Arduino library for faster and smaller digitalWrite(), digitalRead() and pinMode() functions using direct port manipulation for constant pin numbers.
C
24
star
14

ATtiny-HighVoltageProgrammer_FuseEraser

Using an Arduino and 12 Volt to erase wrong ATtiny fuse settings by High-voltage Serial Programming
C++
21
star
15

PlayRtttl

Arduino library to play RTTTL melodies / ringtones non blocking from FLASH or RAM.
C++
19
star
16

STMF3-Discovery-Demos

Apps for a STMF3-Discovery board with HY32D touch screen or BlueDisplay App - DSO, FrequenySynthesizer, Accelerometer and DAC demo etc.
C++
19
star
17

SoftStart

Generates TRIAC control pulse for soft start of motors used in circular saw and other DIY tools.
C++
17
star
18

Arduino-RobotCar

Enables autonomous driving of a 2 or 4 wheel car with an Arduino and a Adafruit Motor Shield V2. To avoid obstacles a HC-SR04 Ultrasonic sensor mounted on a SG90 Servo continuously scans the area. Manual control is by a GUI implemented with a Bluetooth HC-05 Module and the BlueDisplay library.
C++
16
star
19

Arduino-Utils

Utility collection for Arduino programming
C++
14
star
20

LCDBigNumbers

Arduino library to write big numbers on a 1602 or 2004 LCD.
C++
14
star
21

Arduino-Simple-DSO

Simple DSO software based on standard Arduino boards, a HC-05 and the BlueDisplay library.
C++
11
star
22

Arduino-OpenWindowAlarm

Issues an alarm, if window is open for more than 5 minutes. Arduino sketch for ATtiny85. Battery operated (6 microAmpere).
C++
11
star
23

android-blue-display

The App receives basic draw and GUI requests from Arduino etc. over Bluetooth (HC-05) and renders it. It also sends touch events over Bluetooth back to Arduino.
Java
10
star
24

EasyButtonAtInt01

Arduino library for push buttons at INT0 and / or INT1 pin (pin 2 / 3). Provides debouncing and toggle button functionality.
C++
10
star
25

ESP32-Cam-Sewer-inspection-car

Tiny and cheap robot car for inspecting sewer pipes >= 125 mm. With pan servo for the ESP32-Cam module
C++
8
star
26

LightweightServo

Lightweight Servo library for Arduino for 2 Servos at Pin 9 and 10. Needs only timer1, no interrupts or other resources.
C++
7
star
27

Arduino-DTSU666H_PowerMeter

Arduino Nano substitute for a RS485 3 Phase DTSU666-H coil based power meter. Less resolution, but better display
C++
7
star
28

OpenledRace

OpenLedRace version with accelerator or button inputs, track animations and winner melody
C++
5
star
29

SimpleTouchScreenDSO

Simple DSO Software for Arduino Uno/MEGA with a Touchscreen Shield
C++
4
star
30

iButtonProgrammer

Arduino UNO / Nano iButton reader as well as programmer for writable iButtons of type RW1990
C++
4
star
31

QuadrupedControl

Arduino Library for controlling a mePed robot V2 with 8 servos using an IR remote.
C++
4
star
32

SloeberTutorial

Tutorial for the Sloeber Eclipse plugin
Batchfile
3
star
33

github.io

GitHub pages for my projects
2
star
34

Arduino-Lessons-for-School

Arduino lessons for the Arduino course at the Gymnasium for 15 year old pupils (grade 8+9)
C++
2
star
35

Github-Actions

Github actions script for testing build of Arduino libraries with arduino-test-compile
C++
2
star
36

android-SystemSoundDemo

App to show and play all tones from android.media.ToneGenerator.
Java
1
star
37

RobotArmControl

Program for controlling a MeArm / RobotArm with 4 servos using 4 potentiometers and/or an IR remote
C++
1
star
38

AvrTracing

The last hope for the desperate AVR programmer. A small (344 bytes) Arduino library to have real program traces and to find the place where your program hangs
C
1
star