Author Topic: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?  (Read 8711 times)

0 Members and 1 Guest are viewing this topic.

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18131
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« on: April 20, 2014, 04:57:59 pm »
Well most of it is in the title. I wrote a program for an ATTiny25 AVR running off a 32.768 KHz clock crystal. I set the clock / 8 fuse and then I could no longer "talk" to it. I am guessing this was because the SPI clk needs to be system clk/4 and the lowest is just over 2 KHz but my system clock became 4 KHz
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6314
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #1 on: April 20, 2014, 05:00:33 pm »
Can you connect a faster crystal to unbrick it?

Edit: or a signal generator, connected to the oscillator's input, with a series resistor.
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18131
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #2 on: April 20, 2014, 05:02:25 pm »
Well assuming that is what I have done I probably could, there are specific register settings for low speed crystals but i suppose that would include anything up to 128 KHz
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 953
  • Country: pt
    • My AVR tutorials
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #3 on: April 20, 2014, 05:03:08 pm »
using a usbAsp or similar I think you can run the programming clock lower than 2khz.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #4 on: April 20, 2014, 05:17:45 pm »
avrdude has the -B option that will let you set the bit clock period to any arbitrary value, in microseconds.  I don't know if that option will work with your particular programmer, however.
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18131
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #5 on: April 20, 2014, 05:31:34 pm »
I'm using the AVRISP2 programmer. I'm not hugely fussed just wanted to confirm that was my mistake.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #6 on: April 20, 2014, 05:34:16 pm »
You might also try Atmel's atprogram from the command line.  It has a -cl option that should let you use an arbitrary programming frequency.
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18131
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #7 on: April 20, 2014, 05:45:10 pm »
is this something I already have with AS6 ?
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #8 on: April 20, 2014, 06:01:00 pm »
is this something I already have with AS6 ?

I think it is new with version 6.1.  It's installed at:

    C:\Program Files (x86)\Atmel\Atmel Studio 6.0\avrdbg

on my system.
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18131
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #9 on: April 20, 2014, 06:02:37 pm »
so what do I do with it ? does the command line prompt me along ?
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #10 on: April 20, 2014, 06:18:41 pm »
I haven't used it myself but it looks like you might try something like the following, just to see if it can read the fuses:

   atprogram -t avrispmk2 -d attiny25 -cl 1000 read -fs -s 2

Hopefully, that will get you both the high and low fuse values.  I'm not sure what order they will be in.  If that works then you will have to figure out what the fuse values need to be and then use the write command to update them.

You might be able to find a GUI front-end for the utility.  Too bad Atmel Studio only lets you go to a minimum of 2kHz.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #11 on: April 20, 2014, 09:46:47 pm »
before i learned that high clock speed with sleep actually draws less power than slow speed i accumulated a big box of bricked t85. i never found a way to revive them, even with 100hz programming settings, so would love to hear of an actual  method that works. a tested procedure, not something somebody thinks or feels "might" work.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #12 on: April 21, 2014, 01:26:18 am »
Quote
i never found a way to revive them

google high voltage serial programming. Or look at the datasheet.

I wrote a piece of code on PIC16F684 / 1936 to do that.
================================
https://dannyelectronics.wordpress.com/
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8534
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #13 on: April 21, 2014, 11:58:46 am »
Don't forget to reset the fuse settings to defaults after doing a chip erase - and the default fuse settings are not all FF on the '85. In particular, the SPI programming enable bit needs to be 0 (enabled).
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10408
  • Country: nz
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #14 on: April 21, 2014, 12:06:00 pm »
You might be able to talk to it using AVRdude with a direct Printer Port connection.
You can slow down avrdude printer port coms with -i <number>

Something like...

avrdude -i 100 -c bsd -p t25 -E noreset -P lpt1 -e -U hfuse:w:0xXX:m
avrdude -i 100 -c bsd -p t25 -E noreset -P lpt1 -e -U lfuse:w:0xXX:m
avrdude -i 100 -c bsd -p t25 -E noreset -P lpt1 -e -U efuse:w:0xXX:m

Where XX is the fuse byte hex value to write
If using linux change -P lpt1  to -P /dev/parport0
(I dont think any 64bit windows will work because it doesnt provide avrdude with hardware access to the printer port, 32bit XP and older should work fine and that is likely what will be on any PC old enough to have a printer port.)

The DB25 connections for BSD printer port programmer are
  reset = 7
  sck   = 8
  mosi  = 9
  miso  = 10

You have to supply your own 5V/GND source which is ground common with the PC
« Last Edit: April 21, 2014, 12:19:37 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #15 on: April 21, 2014, 12:15:17 pm »
google high voltage serial programming. Or look at the datasheet.

lpt wires are my #1 method of isp but nowhere near as powerful as 12v programmers. even my dragon and stk failed here.

in my case clkpr was changed in CODE (temporary) so it wasnt a fuse issue. the chips died a mysterious death. sorta like killing them by overclocking with osccal as ive done a few times. it would be nice to hear from somebody who had the same problem and succeeded in bringing them back.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8534
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #16 on: April 21, 2014, 12:55:48 pm »
google high voltage serial programming. Or look at the datasheet.

lpt wires are my #1 method of isp but nowhere near as powerful as 12v programmers. even my dragon and stk failed here.
You can do HVSP with a direct parallel port connection, you just need to put +12V on the reset pin (the PC's own PSU can supply 12V, preferably through a current-limiting resistor - it needs <1mA) and drive the pins using slightly different commands.
in my case clkpr was changed in CODE (temporary) so it wasnt a fuse issue. the chips died a mysterious death. sorta like killing them by overclocking with osccal as ive done a few times. it would be nice to hear from somebody who had the same problem and succeeded in bringing them back.
If it's actually physically damaged hardware then no programmer will be able to fix that.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #17 on: April 21, 2014, 01:01:40 pm »
yes, thats what i meant by "easier than 12v parallel". and true that if chips are really dead nothing will help. but are they? the real question is what killed them. i understand overclocking doing damage because of violation of minumum flash time but too slow dont make a lot of sense to me.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8534
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #18 on: April 22, 2014, 08:59:13 pm »
It could be ESD, if you weren't careful.

If you really want to try reviving them and have no software then follow datasheet and hook it up for HVSP with pushbuttons and LEDs on the clock/data lines, input basic commands like "read signature byte" manually and see if it responds.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #19 on: April 23, 2014, 12:17:36 am »
esd is an urban myth. and as mentioned isp, hvsp, and hvpp do not work. for me its not so much restoring as figuring out why they failed in the first place. i suspect it has something to do with the fact that reset does not change clock during flashing even though it was done in code and not via fuses.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #20 on: April 23, 2014, 12:34:28 am »
Quote
esd is an urban myth.

I have been handling MOS devices since the 1980s and have had countless (thousands?) such devices through my bare hands. I have yet to see one of them get damaged from ESD.
================================
https://dannyelectronics.wordpress.com/
 

Tac Eht Xilef

  • Guest
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #21 on: April 23, 2014, 12:54:10 am »
Quote
esd is an urban myth.

I have been handling MOS devices since the 1980s and have had countless (thousands?) such devices through my bare hands. I have yet to see one of them get damaged from ESD.

Maybe not straight away. If you do a real failure analysis over time, you'll see it's real enough.

In one case we tracked a series of short-life failures (i.e. failures within 6 months) down to one guy not following proper (or, indeed, any!) anti-static procedures when replacing cards. Stood out like dog's proverbials when you analysed the data...
 

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: au
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #22 on: April 23, 2014, 12:57:32 am »
I worked for a manufacturer of niche communication products that were supplied with extended warranties. After they put a total ESD system in place, mats floor coverings ankle grounding straps etc etc, they found that fault returns of equipment in the first 12 months dropped by approx 40%. You may not have noticed it but a small zap can and does lead to component failure not necessarily instantly but definitely in time.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Attiny on 32KHz clock did I brick it with CLK/8 fuse ?
« Reply #23 on: April 23, 2014, 11:23:14 pm »
without specifying actual device and process its hard to make any sense of these anecdotes, pro or con. so what i should have said was "regarding common modern digital ics". logic and mcu devices virtually w/o exception have both parasitic and designed in clamping  diodes which will sustain enormous abuse. im particularly fond of a demo carried on some years back involving atmel chips, van degraff generator (BIG one), and 8" sparks.

that said i do have some general instrument p-mos devices circa 1978 that have been shown on curve tracer to be void of protection zeners. needless to say i do not even think of removing any of these valuable antiques from their conductive foam.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf