Unable to erase flash of ATTiny20 (using STK600 dev board).

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,

 

I am new to programming micro controllers and I just started out a month back programming ATTiny20 using STK600 development board in TPI mode. I have been trying to develop an ADC program in the ATMEL STUDIO 7 environment since one week.

 

I was able to run the first version of my program successfully but then suddenly I am not able to erase the flash of ATTiny20. The error messages usually ranges from - Unable to erase flash, Target connector seems to be reversed, unable to enter programming mode, no device signature and so on. Basically, the software cannot detect my chip anymore.

 

I am confident that the connector for TPI programming is connected correctly. The voltages are also supplied correctly - (VTARGET glowing green). Besides its STK600 so there are no worries of missing caps and resistors. I am powering the board from laptop's USB port.

 

I am not able to understand why suddenly my chip ATTiny20's device signature cannot be read. Because of inability to erase the flash, my chip is now "frozen" with the previous program.

 

I would be very happy if somebody can help me. I read through all previous threads, but up to no avail. Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First, Welcome to AVRFreaks!

Did you change any of the fuses just before you broke the chip? 

Most likely the clock source has changed due to a fuse setting to an external clock source such as xtal or external clock.

Try injecting a 1MHz signal into the xtal1 pin and see if it now works, if so, reset fuses to default values to restore internal clock source.

See tutorial section for detailed instructions on how to do this and why it happened.

Jim

Edit: added welcome

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Tue. Aug 20, 2019 - 01:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

T20 has no clock/crystal input, as  far as I can see. 

 

BUT, ISP has to have a  clock rate that is slower than 1/4 of the  MCU clock. So, maybe ISP is running too fast after changing the clock frequency? Hmm, this uses TPI, not ISP. But, there is still a clock rate limit of some kind. Spec sheet also says that TPI only runs with Vcc = 5V.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Tue. Aug 20, 2019 - 02:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ka7ehk wrote:
TPI only runs with Vcc = 5V.

 

The brain-dead chips will run at low voltage happily.   But you must use 5V for programming.

 

Tiny20 and Tiny40 have got some reasonable peripherals.    Tiny5, Tiny10 are a waste of time.

 

If you intend to sell 1M products the per-unit chip cost is important.

But you could probably buy cheaper and better from Chinese manufacturers.

 

Small brain-dead chips with restricted pin count are not a good learning platform (or target).

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
T20 has no clock/crystal input, as  far as I can see. 

Your correct Jim, now looking at the DS, two other possibilities, RSTDISBL  or even BOD level set higher then current VCC level. 

If Reset has been disabled, I think you need HV (i.e. 12v) to restore programming, as David stated above, 5v VCC is required for NVM programming.

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

Most likely the clock source has changed due to a fuse setting to an external clock source such as xtal or external clock.

 

In the STK600 board, I have kept the clock toggle switch to internal position. Didn't change that. Is it possible for Atmel Studio software to override the hardware settings?

 

ki0bk wrote:

Did you change any of the fuses just before you broke the chip?

 

No. They are untouched.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

BUT, ISP has to have a  clock rate that is slower than 1/4 of the  MCU clock.

 

Also true for TPI. I had kept the clock rate < 1/4 of the MCU. The target voltage is also 5 V (measured by multi meter as well as green LED status).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely your STK600 came with an ATmega2560.

 

I would do the all your "learning" on the ATmega2560 first.

 

This means that you know the STK600 is in full working order.  e.g. all the boards are securely installed.   There are lots of example projects for m2560.  

 

When you are fully experienced with the m2560 you can experiment with changing boards,  brain-dead Tinys,  your own software, ...

 

Personally,   I would migrate to the newer XTiny chips.   But only after you gain experience with the Mega.    And possibly changing separate Mega boards.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

I would do the all your "learning" on the ATmega2560 first.

David.

 

+1 Fair point. My intention to choose Tiny20 was my project's requirement to scale down to an extremely miniature size as an end product (read -> WLCSP).

 

But I am still wondering about the sudden loss of device signature and inability to erase flash. I am not (yet) open to try out the HV programming. I changed the old chip with a new one. I was able to run the program once again, however I could not get the flash erased.

 

Also, in response to other queries - the rstdisbl was untouched.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens if you just try to load a new program? On most AVRs, I do not have to explicitly (e.g. separately) "erase" before reprogramming. Do not know what TPI requires.

 

Jim

 

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you mounted all the STK600 boards securely?

Are all the nylon tabs properly engaged?

 

I am sure that most (if not all) STK600 owners have had a loose tab.

They have probably had a poor clamshell contact too.

 

Or even mounted a chip the wrong way around.

 

Make a paper checklist.

Write down each step.

Number each step.

 

Then you can be methodical with any problem solving.

And you will impress the readers when you post your checklist.

 

This is what airline pilots do.    It is well proven.

It costs you a few minutes with your typing finger.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

What happens if you just try to load a new program? On most AVRs, I do not have to explicitly (e.g. separately) "erase" before reprogramming.

 

True. There's a checkbox where I selected erase flash by default before programming. The only reason why I manually do every time is because to be on the safer side (and also being a beginner). Speaking of loading a new program, I get an error message along the lines -  Target connector seems to be reversed, unable to enter programming mode or no device signature. 

 

david.prentice wrote:
Have you mounted all the STK600 boards securely?

Yes, all wires are firmly connected.

 

I might try with the ATMEGA2560 (the default) that came with the dev board and see if this problem continues. My only worry is that if there is some problem on the board side, then the Mega will also go kaput once again. I will update everyone after a couple of days what happens once I plug in MEGA 2560.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update: So it turns out my power supply from USB port of my laptop was inconsistent. I have moved on to another supply source and since then I have been able to do normal operations. Thank you everyone for their time and for now I have no other issues.