Problem ATTINY85 (Watchdog WDT) + DigiKeyboard.h library NOT WORKING properly?

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
ecogreen
 
Posts: 1
Joined: Mon Nov 13, 2023 10:32 am

Problem ATTINY85 (Watchdog WDT) + DigiKeyboard.h library NOT WORKING properly?

Post by ecogreen »

hello and thank you for welcoming me
I wonder if the DigiKeyboard.h library is compatible with WDT on an attiny85?
Because I can't get the attiny freez to reboot,
I have to remove the power supply for the reboot attiny

tested with
ide 1.8.12 ide 1.8.13
ATTinyCore 1.5.2
with attiny85 16mhz int fuse F1 DF FF usbasp prog no bootloader just test wdt
with digispark 16mhz int fuse F1 DF FF usbasp prog no bootloader for pc
tested several lib DigiKeyboard


Simple test to activate or not the DigiKeyboard.h

Could I be making a mistake?

Thanks in advance for the response

Code: Select all

//test with
//exemple attiny85  16mhz fuse internal F1 DF FF  
//exemple digispark 16mhz fuse internal F1 DF FF
//programming isp usbasp
//ide 1.8.12 or 1.8.13 ATTinyCore 1.5.2
#include <avr/wdt.h>
#include "DigiKeyboard.h"          // if  active DigiKeyboard.h  wdt not reboot after x seconde freez mcu



int led = 1;  //attiny85 1 / attiny88 0 / arduino 13   

void setup() {
wdt_enable(WDTO_4S);//
pinMode(led, OUTPUT);  


for(int test_reboot = 0 ; test_reboot < 4 ; test_reboot++) 
{
  digitalWrite(led, HIGH);  
  delay(200);               
  digitalWrite(led, LOW);    
  delay(200);
}
}


void loop() {
// no need for reboot test    only with digispark 
// DigiKeyboard.sendKeyStroke(0);
// DigiKeyboard.print("hello");

while (1)
{
}
  

}

User avatar
adafruit_support_mike
 
Posts: 66992
Joined: Thu Feb 11, 2010 2:51 pm

Re: Problem ATTINY85 (Watchdog WDT) + DigiKeyboard.h library NOT WORKING properly?

Post by adafruit_support_mike »

The code you're using for the watchdog timer doesn't work on the ATtiny85.

This blog post was written by someone who had the same problem:

https://bigdanzblog.BANNED.com/2015/ ... timer-wdt/

Be sure to read all the comments, because some people couldn't get the code in the main post to work either.

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”