2

I have a low voltage (3.2v) application. I was hoping to use the Digispark. I have a solution using a separate Tiny85, but want to use the Digispark USB programming.

To run at lower voltage I think you need the lower clock rate. I have done this using the standalone Tiny85. I could hook up the Digispark to the programmer direct and change the frequency fuses, however...

I assume reducing the clock rate by programming the fuses would break the Digispark boot loader as it would have the wrong timing. Correct?

Can I dynamically switch the clock frequency in my code after the bootloader or is it fuse controlled only?

Is the bootloader available and could I change it to a lower frequency? Would there be a lot of work changing the code to a different freq? Would it be powerful enough to run the USB bootloader?

3 Answers 3

3

You can set the clock prescaler at run time. For example:

#include <avr/power.h>

void setup()
{
    clock_prescale_set(clock_div_8);
    // etc...
}

More details in the documentation from avr-libc.

Note that with this method your Digispark will still be overclocked when booting, so it might not be 100% reliable. But it will be overclocked only for a very short time.

3
  • I was kind of hoping it would hobble through the boot loader over clocked as I do not need it to actually connect to usb at the low voltage.
    – BillyBag2
    Commented Nov 3, 2016 at 0:05
  • @BillyBag2: I would expect it to work. See the answers to this related question: Arduino 16 MHz with only 3.3V?. Commented Nov 3, 2016 at 8:37
  • Thanks Edgar, This was useful for me for a Digispark ATTiny85 (china clone) that is talking I2C to an ESP8266 NodseMCU v3 Lolin. I have divided by 4 and still works. The ATTiny´s own current consumption has lowered from 11.2mA @16Mhz to 5.6ma. The ATTiny is powered 3.3v from the NodeMCU's regulator 3.3v output to it's 78L05 (output). I have disabled both LEDs with two, almost invisible, small cuts in the PCB, i could re-solder if necessary. I am using Rambo's TiniwireS library for I2C. Thanks again. Commented May 5, 2018 at 21:12
2

The digispark uses the micronucleus bootloader.

You can flash that directly onto an Tiny85 without needing the digispark module. So your existing Tiny85 solution could acquire the USB bootloader if you can spare the 2k program space for the bootloader.

I realize this is not a direct answer to your question, but you did note that you have a Tiny85 solution and wanted USB bootloader support on it.

0

Maximum safe frequency at 3.2V is around 12.7Mhz. See figure 20-2 in the datasheet.

This is indeed lower than the 16MHz the digispark is running at.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.