Go Down

Topic: Assistance needed programming the ATTiny84 with the Arduino Uno ATMega328P-PU. (Read 8745 times) previous topic - next topic

eraney

I purchased what I thought was a 20 MHz chip,  but reading the datasheet the 20 MHz signal is the maximum rating from an external source.

SKU:COM11232  ATTiny84 14 pin 20 MHz 8K 12A/D was purchased from SparkFun

The device is shipped with CKSEL = "0010", SUT = "10", and CKDIV8 programmed. The default
clock source setting is therefore the Internal RC Oscillator running at 8.0 MHz with longest startup
time and an initial system clock prescaling of 8, resulting in 1.0 MHz system clock. This
default setting ensures that all users can make their desired clock source setting using an in-system
or high-voltage programmer.

The boards.txt files that was used had three options for the ATTiny84:
ATTiny84 (internal 1MHz Clock)
ATTiny84 (internal 8MHz Clock)    (This one works without the external 20 MHz signal)
ATTiny84 (external 20MHz Clock)  (This is the one that I chose)

The bootloader looked for a 20 MHz external clock, which at the time did not exist and gave an error:
"avrdude: Yikes!  Invalid device signature." .

I added 1 @ 20 mhz crystal and 2 @ 22 pF capacitors on XTAL1 XTAL2 which created an external AVR oscillator and now the bootloader for the ATTiny 84 ran successfully.

NOTE:
If the chip is programmed at 20 MHz, then the configuration needs to contain the 20 MHz external source for communication even if you are attempting to set it to the internal 8 MHz clock.

If the chip is programmed at 8 MHz, then the configuration uses the internal clock but needs to contain the 20 MHz external source for if you are attempting to set it to the external 20 MHz clock.

twice

You bought the Attiny84 set to run with its internal RC oscillator.
Finally, without setting the Attiny84 to work with the 20 MHz Crystal, you attached the external oscillator and you programmed the controller.
How is it possible?

Likely your chip was already set for external crystal which is not its default state.

Go Up