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?

BillyBag2
  • 217
  • 3
  • 7

3 Answers3

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.

Edgar Bonet
  • 45,094
  • 4
  • 42
  • 81
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.

handle
  • 141
  • 2
  • 8
jose can u c
  • 6,974
  • 2
  • 16
  • 27
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.

Gerben
  • 11,332
  • 3
  • 22
  • 34