ATTiny Cores Compatibilty, Att: Dr Azzy - Help!

I just upgraded the firmware in my USBASP programmer which revealed/turned into an absolute nightmare.

My old setup was version 1.5.7 of the IDE and the high-low tech ATTiny cores.
It all worked fine until I had to upgrade the IDE to 1.6.5 r2.

Under my old setup I could burn the bootloader onto an ATTiny85 and upload sketches using an Uno as ISP.

My new setup uses version 1.6.5 r2 of the IDE and the ATTiny cores maintained by D Azzy.
All seemed fine as I could still upload sketches onto the ATTiny's prepared under my old setup.

To make life easier, I recently bought a USBASP programmer with which it seemed I could also upload sketches onto the ATTiny's prepared under my old setup.

The USBASP programmer came with old firmware, which I decided to upgrade and which started my current (ongoing nightmare).... The firmware upgrade itself went without a hitch.

With my new setup and upgraded firmware on the USBASP programmer, I can nether upload a sketch nor burn a bootloader onto an ATTiny85.

Reverting back to using an Uno as ISP, I can upload a sketch but I cannot burn a bootloader onto an ATTiny85.

I have a ATTiny85 Arduino with programming header - no combination works.

A: PCB + ICSP Header (worked previously with Uno as ISP)

  1. USBASP + IDE 1.6.5 - Upload Blink

Sketch uses 828 bytes (10%) of program storage space. Maximum is 7,616 bytes.
Global variables use 9 bytes of dynamic memory.
avrdude: set SCK frequency to 375000 Hz
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

  1. USBASP + IDE 1.6.5 - Burn bootloader
    avrdude: set SCK frequency to 375000 Hz
    avrdude: error: programm enable: target doesn't answer. 1
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.
    Error while burning bootloader.

  1. USBASP + IDE 1.5.7 - Upload Blink
    Sketch uses 828 bytes (10%) of program storage space. Maximum is 7,616 bytes.
    Global variables use 9 bytes of dynamic memory.
    avrdude: error: programm enable: target doesn't answer. 1
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.

  2. USBASP + IDE 1.5.7 - Burn bootloader
    avrdude: error: programm enable: target doesn't answer. 1
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.


  1. Uno as ISP + IDE 1.5.7 - Upload Blink
    Build options changed, rebuilding all

Sketch uses 828 bytes (10%) of program storage space. Maximum is 7,616 bytes.
Global variables use 9 bytes of dynamic memory.
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

  1. Uno as ISP + IDE 1.5.7 - Burn bootloader
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

  1. Uno as ISP + IDE 1.6.5 - Upload Blink
    Build options changed, rebuilding all

Sketch uses 828 bytes (10%) of program storage space. Maximum is 7,616 bytes.
Global variables use 9 bytes of dynamic memory.
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

  1. Uno as ISP + IDE 1.6.5 - Burn bootloader
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

Error while burning bootloader.

The only way I can upload anything onto the ATTiny85 is with a breadboard and Uno as ISP.
However, the blink sketch blinks at 8 sec not 1 sec.
I cannot burn a bootloader under any circumstances.
:confused:

Update.

Using the ATTiny85 on a breadboard, I stuck a makeshift jumper into the "slow" jumper holes of the USBASP programmer and was able to upload the blink sketch with it.
It still blinks at 8 sec.

In avrdude.conf the bitclock setting is not set.

#default_bitclock = 2.5;

Using 2.5 for the default value does not work.
What setting do I need as the equivalent of closing the "slow" jumper?

This was a virgin chip which is now obviously set at 1MHz.
I want to change it to 8Mhz internal.
Using the same makeshift jumper, I tried to "re-burn" the bootloader but I get this error.

avr_read(): error reading address 0x0000
    read operation not supported for memory "lock"
avrdude: failed to read all of lock memory, rc=-2
Error while burning bootloader.

Another update :slight_smile:
Slowly waking up from my nightmare…

So now I can up with the USBASP programmer with a bit_clock setting of 5 in avrdude.conf;
Still having issues burning a bootloader :frowning:

Here's a point.

When quoting any sort of code - or diagnostic output - use "code" mark-up, not "quote.".

This makes it more legible (you don't want the italics), prevents it from being turned into smileys

:frowning: :confused: >:(

and allows you to copy it easily and accurately.

:grin:

Paul__B:
When quoting any sort of code - or diagnostic output - use "code" mark-up, not "quote.".

We all have our pet peeves :slight_smile:
To me it just feels wrong i.e. to have text under a "code" headed tag.
I can imagine t would be annoying having to differentiate if "code" was really code or text.

Here's a (constructive) suggestion...
The "quote" tags could lose the default italics and let the italics be optional or have plain text as an option.

The alternative is to add "plain text" tags.

Both will let code stay dedicated to code.

FAO Dr Azzy - I think there is a problem with your cores.

I updated to the latest cores.
The error message changed from this :

avr_read(): error reading address 0x0000
read operation not supported for memory "lock"
avrdude: failed to read all of lock memory, rc=-2
Error while burning bootloader.

To this:

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Error while burning bootloader.

In desperation I switched back to the high-low tech cores and voila! I can burn a bootloader - nightmare over :slight_smile:

Hum, I was successfully programming tiny 85s with it just this week whole getting the board manager stuff working...

In the last post, the lock error would happen with old versions of my core if you didn't select the right programmer (the bug was with the default avrdude.conf, and I didn't know how to point it at my version correctly except for programmers I added and which were postfixed with ATtiny Classic), but I fixed this when getting the board manager stuff working. The lock error would happen before it tried to do anything.

Where is the core that you say works?

Also, can you verify whether you had installed it via board manager or manually?

You had selected ATtiny x5 series, tiny85 for processor, and 8mhz clock?

I'd like to get this sorted ASAP - though I don't have any 85's on me atm, and I'm away for the weekend. I'll see what I can scare up to test with, but I'll definitely work on this and see fi I can figure it out today - hopefully I wont need a chip

DrAzzy:
Where is the core that you say works?

I am now using this core..

Are there any special instructions for installing your cores other than copying the folder under "hardware"?

DrAzzy:
Also, can you verify whether you had installed it via board manager or manually?

You had selected ATtiny x5 series, tiny85 for processor, and 8mhz clock?

I'd like to get this sorted ASAP - though I don't have any 85's on me atm, and I'm away for the weekend. I'll see what I can scare up to test with, but I'll definitely work on this and see fi I can figure it out today - hopefully I wont need a chip

I installed it manually, I simply copied the folder under hardware. I noticed today u have an avrdude.conf file in the folder - I did not do anything with this file.

Yes, selected ATtiny x5 series, ATtiny85, B.O.D disabled, 8MHz (internal).

You're installing it right, if you didn't, it would have said it couldn't find avrdude.conf.

Can you resync (or just grab the latest avrdude.conf) and see if it can bootload a virgin tiny85 (or tiny85 switched back to 1mhz)? I found a few delays that I think were shorter than they should be, which could explain the problems bootloading 1mhz T85's. Note that I only put in the changes for the tiny85.

I can't find any tiny85's with me, so I can't test until monday night, but if you can verify that I've fixed it, I can extend the fix to the other chips in the core and start the process for another board manager release for this critical bug.

DrAzzy:
I found a few delays that I think were shorter than they should be

@DrAzzy it's funny I was just looking at this pull request: Add avrdude.conf patch to increase delays for ATtiny85 erasing and uploading. by tdicola · Pull Request #21 · arduino/toolchain-avr · GitHub that increases the delays in the Arduino avrdude.conf for ATtiny85 when I saw this issue posted to your core. Maybe that could be useful to you in determining the correct delay values.

Yup, that's the change I pulled in.

Does it work now?

DrAzzy:
Can you resync (or just grab the latest avrdude.conf) and see if it can bootload a virgin tiny85 (or tiny85 switched back to 1mhz)? I found a few delays that I think were shorter than they should be, which could explain the problems bootloading 1mhz T85's. Note that I only put in the changes for the tiny85.

I installed the updated cores and did some tests - but no cigar.
N.B. this is without setting the bit_clock.
FWIW the high-low tech cores don't need the setting.

Upload Blink:

Build options changed, rebuilding all

Sketch uses 806 bytes (9%) of program storage space. Maximum is 8,192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Burn Bootloader:
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Error while burning bootloader.

@DrAzzy I have some virgin ATtiny85s and a board with an LED(but no crystal so 8MHz max) if you want me to test anything out.

The bitclock line you reference is prefixed with a # in both default avrdude.conf and mine, indicating it’s commented out, so unless you remove the #, that line isn’t doing anything … have you changed it in the default avrdude.conf? Have you made any other changes to default avrdude.conf?

The only difference between stock avrdude.conf and mine for the attiny85 entry at this point is that my core isn’t missing the entry on how to read the lockbits… so I’m really confused as to how they could be behaving differently.

Pert - what we’re having problems with is burn bootloader on a chip that hasn’t yet been set to run at 8mhz to tell it to run at 8mhz instead of 1mhz. (aisc - that’s right, right?)

Could you do a verbose upload, and see if we get any more information out of it?

I just removed my Boards Manager install and did a manual install of the latest ATTinyCore and tested Burn Bootloader and Upload Using Programmer at 8MHz on virgin chips and also set the chips back to 1MHz and then did it again at 8MHz and had no problems with either 1.6.5r5 or the latest hourly build using USBasp without updated firmware. I can post the verbose output if you want it.

P.S. I got a chuckle out of the “wetware” issue.

DrAzzy:
The bitclock line you reference is prefixed with a # in both default avrdude.conf and mine, indicating it's commented out, so unless you remove the #, that line isn't doing anything ... have you changed it in the default avrdude.conf? Have you made any other changes to default avrdude.conf?

Yes the bit_clock is not set - as I advised in post #2.
See post #3 - if I set the bit_clock to 5 (in the default avrdude.conf) I could upload using your cores, but I still could not burn the bootloader.

Per my previous post, the high-low tech cores don't need any setting, so I have commented it out.
The results in the previous post is with the bit_clock setting commented out.

Pert - what we're having problems with is burn bootloader on a chip that hasn't yet been set to run at 8mhz to tell it to run at 8mhz instead of 1mhz. (aisc - that's right, right?)

Correct. Note I am using a USBASP programmer with UPDATED firmware .

Could you do a verbose upload, and see if we get any more information out of it?

Verbose upload with bit_clock setting commented out:

Sketch uses 806 bytes (9%) of program storage space. Maximum is 8,192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
C:\Program Files\Arduino 1.6.5\hardware\tools\avr/bin/avrdude -CC:\Program Files\Arduino 1.6.5\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cusbasp -Pusb -Uflash:w:C:\Users\ais\AppData\Local\Temp\build8889916800414167481.tmp/Blink.cpp.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files\Arduino 1.6.5\hardware\tools\avr/etc/avrdude.conf"

Using Port : usb
Using Programmer : usbasp
AVR Part : ATtiny85
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00

Programmer Type : usbasp
Description : USBasp, USBasp - USB programmer for Atmel AVR controllers - fischl.de

avrdude: auto set sck period (because given equals null)
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

Verbose upload with default avrdude.conf bit_clock set to 5.

Sketch uses 806 bytes (9%) of program storage space. Maximum is 8,192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
C:\Program Files\Arduino 1.6.5\hardware\tools\avr/bin/avrdude -CC:\Program Files\Arduino 1.6.5\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cusbasp -Pusb -Uflash:w:C:\Users\ais\AppData\Local\Temp\build1922485227128446983.tmp/Blink.cpp.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files\Arduino 1.6.5\hardware\tools\avr/etc/avrdude.conf"

Using Port : usb
Using Programmer : usbasp
Setting bit clk period : 5.0
AVR Part : ATtiny85
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00

Programmer Type : usbasp
Description : USBasp, USBasp - USB programmer for Atmel AVR controllers - fischl.de

avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x1e930b
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: set SCK frequency to 187500 Hz
avrdude: reading input file "C:\Users\ais\AppData\Local\Temp\build1922485227128446983.tmp/Blink.cpp.hex"
avrdude: writing flash (806 bytes):

Writing | ################################################## | 100% 0.59s

avrdude: 806 bytes of flash written
avrdude: verifying flash memory against C:\Users\ais\AppData\Local\Temp\build1922485227128446983.tmp/Blink.cpp.hex:
avrdude: load data flash data from input file C:\Users\ais\AppData\Local\Temp\build1922485227128446983.tmp/Blink.cpp.hex:
avrdude: input file C:\Users\ais\AppData\Local\Temp\build1922485227128446983.tmp/Blink.cpp.hex contains 806 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.40s

avrdude: verifying ...
avrdude: 806 bytes of flash verified

avrdude done. Thank you.

N.B. With the bit_clock set (to 5) the sketch uploads BUT the chip is operating at 1MHz although I previously set the fuses for 8MHz AND for the upload I selected 8MHz. Somehow it is always reverting to 1MHz.

Update: I did another test to specifically check the MHz change and cannot replicate what happened before. I thought I tried to set the fuses at 1MHz and got an error, so assumed it was still at 8MHz. I suppose I might have followed that with a 1MHz test with the high-low tech which would have succeeded and could explain the change.
For now just ignore the above statement.

aisc:
the blink sketch blinks at 8 sec not 1 sec.
I cannot burn a bootloader under any circumstances.

aisc:
the chip is operating at 1MHz although I previously set the fuses for 8MHz AND for the upload I selected 8MHz. Somehow it is always reverting to 1MHz.

Only Burn Bootloader sets the fuses, Upload doesn’t change the fuses even when using the programmer to upload. So if the fuses are set to 1MHz and you are unable to Burn Bootloader then even if you Upload with the clock speed set to 8MHz the chip is still running at 1MHz so that’s why the blink is 8x longer than expected. I know there is a separate unsolved issue of why Burn Bootloader using the updated USBasp works with the high-low tech core but not DrAzzy’s core but at least this is a reason for one of the issues.

With my core, everything in the default avrdude.conf should be ignored - are you saying that changes in the default avrdude.conf are changing behavior when you've got one of my boards selected?