September 18, 2024

Biscotti firmware -- flash it into a DIP package device

The idea here is to put the DIP package onto a breadboard and look at the PWM waveforms. We set fuses first, then flash the hex file:
make fuse
avrdude -p attiny13 -c usbasp -B10 -U hfuse:w:0xFF:m -U lfuse:w:0x75:m
Set SCK frequency to 93750 Hz

Processing -U hfuse:w:0xFF:m
Reading 1 byte for hfuse from input file 0xFF
Writing 1 byte (0xFF) to hfuse, 1 byte written, 1 verified

Processing -U lfuse:w:0x75:m
Reading 1 byte for lfuse from input file 0x75
Writing 1 byte (0x75) to lfuse, 1 byte written, 1 verified

make flash
avrdude -p attiny13 -c usbasp -B10 -U flash:w:biscotti.hex
Set SCK frequency to 93750 Hz
Set SCK frequency to 93750 Hz
Reading 968 bytes for flash from input file biscotti.hex
Writing 968 bytes to flash
Writing | ################################################## | 100% 7.59 s
Reading | ################################################## | 100% 5.61 s
968 bytes of flash verified

Avrdude done.  Thank you.
And you are welcome. That was easy enough.

Put it on a breadboard

There is just one trick to running this on a breadboard and that is that it will be monitoring battery voltage on pin 7. I dig up a 4.7K and 22K resistor and they give me a voltage of 0.92 volts.

I connect pin 8 to Vcc (5 volts) and pin 4 to Ground.

I connect a scope probe to pin 5 and I see a waveform.

It must have fired up in "moonlight" mode as I see:

8.62 kHz (116 us period) with 450 ns pulses. -- 0.388 percent
8.60 kHz (116 us period) with 3.2 us pulses. -- 2.758 percent
17.2 kHz (58 us period) with 7.6 us pulses.  -- 13.10 percent
17.2 kHz (58 us period) with 24.4 us pulses. -- 42.07 percent
On all the time.
I also get two defunct strobes (I commented out the strobe code to save space in flash), then I get 5 flashes from a battery check mode. The battery check flashes use 17.4 kHz with a 7.6 us pulse.

All of this does look like Group 1.


Feedback? Questions? Drop me a line!

Tom's Light Info / [email protected]