I thought AVR factory fuses were set to int oscillator ?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

Hi,

I've read on ladyada's avr fuse tutorial that AVRs fresh from the factory are supposed to run on the internal oscillator. The same can be found in the datasheet Of course I tried to flash the bootloader with the USBtiny and it didn't work :-)

So I added the quartz and tada guess what, it flashed just fine!

Has there been a change in atmel's ways ?

sigflup
 
Posts: 44
Joined: Tue Mar 31, 2009 8:50 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by sigflup »

May this be a lesson not to trust the initial state of your chips. I've encountered this too.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by adafruit »

i dont think ive encountered a chip that didnt have the internal oscillator. what chip was this?

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

Just to solve this:

the arduino bootloader makefile sets the fuse bits before it actually writes the bootloader. The setting of the fuse bits works, so the chip was set to use the internal oscillator. After the arduino typical fuse bits have been set, the chip expects an external clock source and therefore further attempts to talk to the chip fail.

An updated version of the USBtinyISP would profit from a built in clock source to drive an AVR's clock pin.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by adafruit »

the clock pin -isnt- on the ISP header
this is basically the cool thing about PICs is that they're clocked when programmed

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

Yes, that is true.

Still it shouldn't be a problem to have another wire come out of the usbtiny's black plastic box. I haven't looked at the schematic, but maybe the attiny even has a free pin that could be persuaded to do a little dance for that purpose. And as dangling wires suck, just use a 2nd jumper so it can be removed if not needed.

Edit:

it seems several of the pins in V2.0 are not used at all, so this could also be hacked and made work by a firmware upgrade.
Just toggling one of the free pins with direct port manipulation somewhere in the code might not mess up the usb timing.

A more colorful logo would be nice too. There's too much gray in this world already.

Image

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by adafruit »

it would be an easy hack - use a PWM out pin - but there is not much firmware space left in the attiny :)

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

Code: Select all

PORTB ^= _BV(PORTB2);
This will not take much space.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by adafruit »

actually, last i checked the firmware was up to 2046 bytes so
it wont fit :(

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

48 bytes too large.... the buffer chip is also only a 4x one... hmpf. otherwise I may have used one buffer and connected that to the quartz.

I hope the next revision will have an mcu with some more storage. Maybe I'd have succeed with an ancient version of winavr, but I don't want to deal with winblows using a dos commant prompt. that gives me the creeps.

is it c:\winavr\bin or c\:\\winavr\\bin or even c\:\/winavr\/bin ? (don't answer that, I don't want to know)

whoever thought using a "\" instead of "/" was\\\/is a good idea should get spanked.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I thought AVR factory fuses were set to int oscillator ?

Post by adafruit »

the next version will have a completely different chip

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

hmm. one of those new xmos chips would be 'completely different'. or something like the benito's usb enabled atmel chip... or a pic.

madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: I thought AVR factory fuses were set to int oscillator ?

Post by madworm_de »

It can be done after all !

http://www.xs4all.nl/~dicks/avr/usbtiny/index.html

pointed me to the fact that some data stored in progmem seems to be optional ( = luxury at only 2k free flash ), so I removed it. BINGO. now there are some bytes left and inserting PORT ^= (1 << pin) is possible ;-)

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”