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 ?
I thought AVR factory fuses were set to int oscillator ?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
-
- Posts: 44
- Joined: Tue Mar 31, 2009 8:50 pm
Re: I thought AVR factory fuses were set to int oscillator ?
May this be a lesson not to trust the initial state of your chips. I've encountered this too.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: I thought AVR factory fuses were set to int oscillator ?
i dont think ive encountered a chip that didnt have the internal oscillator. what chip was this?
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
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.
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.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: I thought AVR factory fuses were set to int oscillator ?
the clock pin -isnt- on the ISP header
this is basically the cool thing about PICs is that they're clocked when programmed
this is basically the cool thing about PICs is that they're clocked when programmed
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
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.
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.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: I thought AVR factory fuses were set to int oscillator ?
it would be an easy hack - use a PWM out pin - but there is not much firmware space left in the attiny
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
Code: Select all
PORTB ^= _BV(PORTB2);
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: I thought AVR factory fuses were set to int oscillator ?
actually, last i checked the firmware was up to 2046 bytes so
it wont fit
it wont fit
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
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.
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.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: I thought AVR factory fuses were set to int oscillator ?
the next version will have a completely different chip
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
hmm. one of those new xmos chips would be 'completely different'. or something like the benito's usb enabled atmel chip... or a pic.
-
- Posts: 99
- Joined: Mon Jun 09, 2008 6:56 am
Re: I thought AVR factory fuses were set to int oscillator ?
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
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
Please be positive and constructive with your questions and comments.