Digispark (attiny85)
Перейти к навигации
Перейти к поиску
Для работы читаем:
https://digistump.com/wiki/digispark/tutorials/connecting https://digistump.com/wiki/digispark/tutorials/linuxtroubleshooting
Для установки поддержки Digispark (attiny85):
Files -> Preference -> Additional Boards Manager URLs:
Вставляем ссылку:
http://digistump.com/package_digistump_index.json
Устанавливаем плату:
Tools -> Board:.... -> Boards Manager
Выбираем Type:
Contributed
И выбираем Digistamp ARV Boards by Digistamp
Конфигурация Arduino IDE для работы с платой:
Tools -> Boards -> Digispark (Default - 16.5MHz)
Затем
Tools -> Programmer -> Micronucleus
В Ubuntu требуется (читаем ссылку выше) создать файл
/etc/udev/rules.d/49-micronucleus.rules
и запишем в него:
# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules (preferred location)
# or
# /lib/udev/rules.d/49-micronucleus.rules (req'd on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
После этого выполняем
sudo udevadm control --reload-rules
Скетч Blink (моргает раз в секунду светодиодом) для тестирования:
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(0, OUTPUT); //LED on Model B
pinMode(1, OUTPUT); //LED on Model A
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(1, HIGH);
delay(1000); // wait for a second
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(1, LOW);
delay(1000); // wait for a second
}
Не прошивается
Рекомендую в функцию setup() в начало поставить
sleep 5
Для того что бы загрузчик успел поменять программу в случае чего.
Если вы этого не сделали, то можно закоротить P5 (RESET) на землю, запускаем прошивку, пока система ждет подключения (60сек) подключаем и затем отключаем P5 от земли.