0
\$\begingroup\$

My ATtiny13A fuses are set to use the internal 128 kHz clock without clock divided by 8. I found online an ArduinoISP sketch that allows me to program it with that clock speed. But then I uploaded some code with those lines at the start of my main() to set the clock division factor to 256:

CLKPR = (1 << CLKPCE); CLKPR = (1 << CLKPS3);

So my clock should normally now runs at 500 Hz. I guess it works, but I now cannot program my ATtiny13A anymore, it gives me unexpected signature error.

I found this ArduinoISP sketch online: https://github.com/lmpipaon/ArduinoISP_slow_SCK

Seems nice but it says it does not work with the 256 prescaler, which is what I need. When I try nevertheless to use the 256 prescaler with 600 baud rate in the ArduinoISP sketch, avrdude (avrdude -b600 -cstk500v1 -P /dev/cu.wchusbserialfa130 -pattiny13 -e -U flash:w:lowVoltage.hex) still gives me unexpected signature errors.

I also tried adding -B 8000 or -B 10000 with my upload command but apart from giving me different device signatures, it does not upload my code.

\$\endgroup\$
1
  • \$\begingroup\$ Holding the device in reset while powering it on will prevent the code from running. \$\endgroup\$ Commented Aug 10, 2016 at 15:01

1 Answer 1

1
\$\begingroup\$

Holding the device in reset while powering it on will prevent the code from running.

– Ignacio Vazquez-Abrams

It worked!

\$\endgroup\$

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.