Problem

Hi all,

I have been building electronic projects as a hobby for about 35 years. I etch my own pcb where needed and while I don't write code, i have been programming pic and avr's for about 15 years. However, I am relalively new to Arduino.

I have successfully uploaded sketches to pro mini's but recently tried to upload a couple of sketches to ATtiny45 and 85 chips but am having issues. One of the sketches was written for both pro mini and tiny85, no issues with pro mini version. I am using all the same gear with 85 as pro mini.

The problem seems very inconsistant, I mostly get verification issues. sometimes sketch will upload but when it does timing is slow. With one of the 2 projects sketch has uploaded correctly maybe 2 times out of 100. The same thing happens with 2 different, but similar projects that use tiny. I have tried different pc, chips, IDE version. The only same hardware would be the usbasp, but I have no issues uploading sketcches to pro mini's with it.

Projects are ppm gernerator/reader related.

Could it be something to do with board manager.

Please help, it would be much appreciated.

Davo

Have you checked the fuse settings on he attiny? What clock speed are you running at? You'll need to make sure you pick the right definition for the clock speed you're using or the timing will be off.

Yes.

But that does not explain all the issues I am having.

In fact I got a new batch of ATTiny today. Followed project instructions as follows:

tools > Select board > ATtiny 25/45/85 tools > select chip > ATtiny85 tools > select clock > 16Mhz tools > programmer > Usbasp tools > burn boot loader, I got no errors sketch > upload using programmer, error as follows

verification error, first mismatch at byte 0x0000 0x00 !=0xa4 avrdude:verification error: content mismatch

Remember, I said in first post that sometimes I get errors, sometimes sketch uploads but timing is wrong, sometimes, but rarely, sketch uploads correctly but not yet with current project.

I also get errors when trying to burn boot loader

Problem is very inconsistant.

Out of curiosity and to be clear as I am new to Arduino, do O burn boot loader “and” upload sketch at 16Mhz.

Also remember that this project was also written for pro mini and that uploads and works as it should, the problems I am having are only with ATtiny.

PPMtesterATtiny85OLED.ino (8.57 KB)

Have you got an Uno or Nano spare? Load up the ArduinoISP sketch and try using that to upload to the ATtinies. If that works ~100%, it would point the finger at your USBasp.

My USBasp works close to 100% reliably, so they are not a bad design.

I have a spare pro mini can you confirm if I can use that or not. I also have a couple of different ftdi and a couple of 328p on the way.

I have done a fair bit of reading and am aware I can go down that road, and it has crossed my mind to by an uno, they are cheap enough.

Pro mini should be fine. Read a tutorial on using ArduinoISP. You need to use an "anti-reset" cap for example.

I've never used 16MHz on an ATtiny85, although I've read that it can be done, even without an external crystal/resonator. So maybe try 8MHz internal clock.

What are fuses of the ATTiny? If the Tiny is from a dubious source (eBay, Aliexpress) it may have SPI programming or reset disabled. Also lock bits may be set. If lock bits and fuses are OK I would suspect wiring error - may with ISP some external circuit loads the programming signals too much?

Quote "may with ISP some external circuit loads the programming signals too much?" end quote

Sorry, don't understand above sentence.

As for wiring, I am certain no issues there.

I have tried using digispark board, my own etched board with virgin chip, and third vero strip board with virgin dip chip, same result with all.

PaulRB: Pro mini should be fine. Read a tutorial on using ArduinoISP. You need to use an "anti-reset" cap for example.

I've never used 16MHz on an ATtiny85, although I've read that it can be done, even without an external crystal/resonator. So maybe try 8MHz internal clock.

I have tried many things, internal 1mhz, 8mhz, 16mhz and external 16mhz with 16mhz resonator.

I am clutching at straws and just throwing this out there but could it be baudrate? tiny board manager related?

Made an uno using pro mini.

Burnt boot loader ok Uploaded sketch ok

Project still does not work correctly.

Are you programming a bare chip or some breakout board as Digispark? AFAIK Digispark has reset disabled so you cannot enter serial programming. What are fuses of the ATTiny? Are you able to read them?

Last post was with previously used (for this project using usbasp) 85 dip chip in my own board. It has 5v reg and required caps. No I can't read fuses.

I just put in a new 85 dip in board and uploaded sketch with arduino, apart from a glitching oled (has never done this) readings all look good.

"Maybe" a little closer.

So "maybe" usbasp won't program the tiny's for some reason. I did of course have to use it to program pro min as arduino isp.

"maybe" the usbasp is bricking chips somehow, which I have suspected has been happening, I don't know.

Sorted oled issue.

So it looks like issue was usbasp related, for some reason the one I have won't program ATtiny's. Programming with arduino isp was the solution.

If anything changes for the worse i will let you all know.

Thanks very much for all your help, much appreciated.

Regards Davo

What fuse settings do you have? You say you're running at 16MHz but IIRC (and it has been a while) the tiny 85s I got all came fused for 8MHz.

Thanks, but if you read my last post I have solved problem, which was my usbasp.

Fyi, (I guess it depends who you talk to) as far as I know digispark comes with blink loaded and fuses set for internal 16Mhz, virgin chips comes with fuses set fot 1Mhz.

ATtiny 25/45/85 can have fuses set (burn boot loader) for 1, 8 and 16Mhz (internal).

cheers

To be more specific:

David Mellis v1.0.2

Arduino IDE clock can be set to:

internal 1Mhz, 8Mhz and 16Mhz

external 8Mhz, 16Mhz and 20Mhz