Attiny13a unable to reprogram it after rstdisbl fuse change

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

As title says... I decided to make a small project to get used to attin13a everything worked fine until i wanted to change the code. Before i changed the RSTDISBL fuse i could reprogram the chip but now i can not and sadly i did this to all my excess attiny13a to see if it the chip i was using is dead or not. Now i can not continue on project. I have searched the forums and saw few others had the same problem but discussions were more then 4 years old so started a new topic.

I did not read whole datasheet just the register parts so i have no information about revision parts, updates.

i did not change anything but the RSTDISBL fuse in fuse settings.
I am using USPISP programmer. It still works fine with other chips.
Chip is still working fine but can not be reprogrammed.

So problem is definitely about attiny13a!!!!

there is nothing wrong with code but i cannot continue working on it ... i am bit manipulating temperature to a shift register then to a 2 seven segment display to show room temperature between 0 and 50C.

/*
 * attiny13 analog termometre.c
 *
 * Created: 02.07.2017 22:09:22
 * Author : yorem
 */ 
#define F_CPU 9600000
#include <util/delay.h>
#include <avr/io.h>

void adc_yukle()
{
	
	ADMUX |=_BV(REFS0); //1.1V internal referance voltage
	
	ADCSRA|=_BV(ADEN);
	ADCSRA|=_BV(ADPS2);
	ADCSRA|=_BV(ADPS1);
	ADCSRA&=~_BV(ADPS0);
	
}

unsigned int adc_oku()
{
	ADMUX |=_BV(MUX1);
	ADMUX &=~_BV(MUX0);    //PB4 secildi
	
	
	ADCSRA|=_BV(ADSC);
	
	while(ADCSRA&(1<<ADSC));
	
	return (ADC);
	
}

int main(void)
{
	DDRB|=_BV(5);
	DDRB|=_BV(2);  //clock
	DDRB|=_BV(1);  //display
	PORTB&=~_BV(2);
	PORTB&=~_BV(1);
	PORTB&=~_BV(5);
	int sicaklik=0;
	int adc_veri;
	adc_yukle();
	
	
    /* Replace with your application code */
    while (1) 
    {
		adc_veri=adc_oku();
		if(adc_veri>=0 && adc_veri<9)  //sicaklik 0
		{
			sicaklik=0b00000000;
		}
		if(adc_veri>=9 && adc_veri<19) //sicaklik 1
		{
			sicaklik=0b00000001;
		}
		if(adc_veri>=19 && adc_veri<28) //sicaklik 2
		{
			sicaklik=0b00000010;
		}
		if(adc_veri>=28 && adc_veri<37) //sicaklik 3
		{
			sicaklik=0b00000011;
		}
		if(adc_veri>=37 && adc_veri<47) //sicaklik 4
		{
			sicaklik=0b00000100;
		}
		if(adc_veri>=47 && adc_veri<56) //sicaklik 5
		{
			sicaklik=0b00000101;
		}
		if(adc_veri>=56 && adc_veri<65) //sicaklik 6
		{
			sicaklik=0b00000110;
		}
		if(adc_veri>=65 && adc_veri<75) //sicaklik 7
		{
			sicaklik=0b00000111;
		}
		if(adc_veri>=75 && adc_veri<84) //sicaklik 8
		{
			sicaklik=0b00001000;
		}
		if(adc_veri>=84 && adc_veri<93) //sicaklik 9
		{
			sicaklik=0b00001001;
		}
		if(adc_veri>=93 && adc_veri<103) //sicaklik 10
		{
			sicaklik=0b00010000;
		}
		if(adc_veri>=103 && adc_veri<112) //sicaklik 11
		{
			sicaklik=0b00010001;
		}
		if(adc_veri>=112 && adc_veri<121) //sicaklik 12
		{
			sicaklik=0b00010010;
		}
		if(adc_veri>=121 && adc_veri<131) //sicaklik 13
		{
			sicaklik=0b00010011;
		}
		if(adc_veri>=131 && adc_veri<140) //sicaklik 14
		{
			sicaklik=0b00010100;
		}
		if(adc_veri>=140 && adc_veri<150) //sicaklik 15
		{
			sicaklik=0b00010101;
		}
		if(adc_veri>=150 && adc_veri<159) //sicaklik 16
		{
			sicaklik=0b00010110;
		}
		if(adc_veri>=159 && adc_veri<168) //sicaklik 17
		{
			sicaklik=0b00010111;
		}
		if(adc_veri>=168 && adc_veri<178) //sicaklik 18
		{
			sicaklik=0b00011000;
		}
		if(adc_veri>=178 && adc_veri<187) //sicaklik 19
		{
			sicaklik=0b00011001;
		}
		if(adc_veri>=187 && adc_veri<196) //sicaklik 20
		{
			sicaklik=0b00100000;
		}
		if(adc_veri>=196 && adc_veri<206) //sicaklik 21
		{
			sicaklik=0b00100001;
		}
		if(adc_veri>=206 && adc_veri<215) //sicaklik 22
		{
			sicaklik=0b00100010;
		}
		if(adc_veri>=215 && adc_veri<224) //sicaklik 23
		{
			sicaklik=0b00100011;
		}
		if(adc_veri>=225 && adc_veri<234) //sicaklik 24
		{
			sicaklik=0b00100100;
		}
		if(adc_veri>=234 && adc_veri<243) //sicaklik 25
		{
			sicaklik=0b00100101;
		}
		if(adc_veri>=243 && adc_veri<252) //sicaklik 26
		{
			sicaklik=0b00100110;
		}
		if(adc_veri>=252 && adc_veri<262) //sicaklik 27
		{
			sicaklik=0b00100111;
		}
		if(adc_veri>=262 && adc_veri<271) //sicaklik 28
		{
			sicaklik=0b00101000;
		}
		if(adc_veri>=271 && adc_veri<280) //sicaklik 29
		{
			sicaklik=0b00101001;
		}
		if(adc_veri>=280 && adc_veri<290) //sicaklik 30
		{
			sicaklik=0b00110000;
		}
		if(adc_veri>=290 && adc_veri<299) //sicaklik 31
		{
			sicaklik=0b00110001;
		}
		if(adc_veri>=299 && adc_veri<308) //sicaklik 32
		{
			sicaklik=0b00110010;
		}
		if(adc_veri>=308 && adc_veri<318) //sicaklik 33
		{
			sicaklik=0b00110011;
		}
		if(adc_veri>=318 && adc_veri<327) //sicaklik 34
		{
			sicaklik=0b00110100;
		}
		if(adc_veri>=327 && adc_veri<336) //sicaklik 35
		{
			sicaklik=0b00110101;
		}
		if(adc_veri>=336 && adc_veri<346) //sicaklik 36
		{
			sicaklik=0b00110110;
		}
		if(adc_veri>=346 && adc_veri<355) //sicaklik 37
		{
			sicaklik=0b00110111;
		}
		if(adc_veri>=355 && adc_veri<364) //sicaklik 38
		{
			sicaklik=0b00111000;
		}
		if(adc_veri>=364 && adc_veri<374) //sicaklik 39
		{
			sicaklik=0b00111001;
		}
		if(adc_veri>=374 && adc_veri<383) //sicaklik 40
		{
			sicaklik=0b01000000;
		}
		if(adc_veri>=383 && adc_veri<393) //sicaklik 41
		{
			sicaklik=0b01000001;
		}
		if(adc_veri>=393 && adc_veri<402) //sicaklik 42
		{
			sicaklik=0b01000010;
		}
		if(adc_veri>=402 && adc_veri<411) //sicaklik 43
		{
			sicaklik=0b01000011;
		}
		if(adc_veri>=411 && adc_veri<421) //sicaklik 44
		{
			sicaklik=0b01000100;
		}
		if(adc_veri>=421 && adc_veri<430) //sicaklik 45
		{
			sicaklik=0b01000101;
		}
		if(adc_veri>=430 && adc_veri<439) //sicaklik 46
		{
			sicaklik=0b01000110;
		}
		if(adc_veri>=439 && adc_veri<449) //sicaklik 47
		{
			sicaklik=0b01000111;
		}
		if(adc_veri>=449 && adc_veri<458) //sicaklik 48
		{
			sicaklik=0b01001000;
		}
		if(adc_veri>=458 && adc_veri<467) //sicaklik 49
		{
			sicaklik=0b01001001;
		}
		if(adc_veri>=467 && adc_veri<477) //sicaklik 50
		{
			sicaklik=0b01010000;
		}

		
		
		for(int i=0;i<8;i++)
		{
			
			
			if((sicaklik & 0x01))
			PORTB|=_BV(5);
			else
			PORTB&=~_BV(5);
			
			sicaklik/=2;
			
			PORTB|=_BV(2);  //clock ver
			_delay_ms(5);
			PORTB&=~_BV(2);
			
		}
		PORTB|=_BV(1);    //data goruntule
		_delay_ms(2);
		PORTB&=~_BV(1);
		
		
		
		
		
		
		
		
    }
}




 

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

Throwing the title you gave your thread, at Google, gave this helpful link as the second hit. I bet you could have saved yourself a little typing.

 

- John

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

i came across this on forums yeah but how do i perform high voltage programming or other methods given, lowering the frequency etc... with USPASP :) that is the case :)

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

Kind of interesting -- what made you decide to change RSTDISBL?  On a whime?  Trying all values of all fuses as a learning exercise?

 

I'd think there would have been a reason, and that you would have read up on the fuse ...

 

4. See “Alternate Functions of Port B” on page 55for description of RSTDISBL and DWEN fuses.
When programming the RSTDISBL fuse, High-voltage Serial programming has to be used to
change fuses to perform further programming.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Yes it was all about learning exercise :) these kind of mistakes may become good lessons for future.

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

You can not perform high-voltage programming with an USBASP.

 

Put your ATTinys in a bag marked "RSTDISBL". Put that bag in a drawer. If the day comes when you buy a programmer capable of high-voltage programming then you can resurrect them. For now they are not usable to you.

 

Then buy a couple of new AVRs. And don't touch the fuses until you understand what you're doing.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

GG :D thx. I did this to 3 of my attiny13a.

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

Say which country you live in.

 

You could mail all your dead PDIP Tiny13 chips in a jiffy bag with a return stamp to a neighbour with a STK500.

 

If you are in the UK,   I would do it for you.

 

Quite honestly,   it is not worth the cost of components to make your own HVPP programmer.

And it is never wise to use RSTDISBL unless you never want to use that chip again.   

 

David.

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

david.prentice wrote:
unless you never want to use that chip again.
Or rather, never want to program it again...

David (aka frog_jr)

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

yorem_kastor wrote:
Yes it was all about learning exercise :)
Then I guess what you have learned then is "don't touch RSTDISBL". If you do it will cost you a couple of $ to buy a new tiny13A ;-)

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

You need a specific piece of information that is implied but not stated, above.

 

The RST pin is used as a critical input for almost all programming and debugging. For some devices, it is actually used, I believe, as a sort of "one-wire" data pin. To function in this way, the RESET capability MUST be present. RSTDBL disables the RESET capability. As a result, once this fuse is set, you can no longer program the chip with "plain" serial programming. 

 

Once the RSTDBL fuse is set, you have to supply high voltage pulses to the RST pin in order to do any programming. This generally means that you cannot do this on an application or development board - or at least a board that has something connected to RSTDSBL.  And, it takes a "special" programmer to do this.

 

Jim

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

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

yorem_kastor wrote:
Yes it was all about learning exercise :)

So you learned that, when the datasheet says,

When programming the RSTDISBL fuse, High-voltage Serial programming has to be used to

change fuses to perform further programming.

It means it!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...