I thought AVR factory fuses were set to int oscillator ?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

I thought AVR factory fuses were set to int oscillator ?

Postby madworm_de » Tue Mar 31, 2009 8:21 pm

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 ?
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby sigflup » Wed Apr 01, 2009 12:10 am

May this be a lesson not to trust the initial state of your chips. I've encountered this too.
User avatar
sigflup
 
Posts: 46
Joined: Tue Mar 31, 2009 7:50 pm

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

Postby adafruit » Wed Apr 01, 2009 9:14 am

i dont think ive encountered a chip that didnt have the internal oscillator. what chip was this?
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

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

Postby madworm_de » Wed Aug 26, 2009 5:10 pm

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.
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby adafruit » Wed Aug 26, 2009 5:56 pm

the clock pin -isnt- on the ISP header
this is basically the cool thing about PICs is that they're clocked when programmed
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

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

Postby madworm_de » Wed Aug 26, 2009 6:06 pm

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
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby adafruit » Wed Aug 26, 2009 8:37 pm

it would be an easy hack - use a PWM out pin - but there is not much firmware space left in the attiny :)
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

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

Postby madworm_de » Wed Aug 26, 2009 9:08 pm

Code: Select all
PORTB ^= _BV(PORTB2);


This will not take much space.
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby adafruit » Thu Aug 27, 2009 10:11 am

actually, last i checked the firmware was up to 2046 bytes so
it wont fit :(
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

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

Postby madworm_de » Thu Aug 27, 2009 12:01 pm

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.
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby adafruit » Thu Aug 27, 2009 9:01 pm

the next version will have a completely different chip
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

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

Postby madworm_de » Sat Aug 29, 2009 9:12 pm

hmm. one of those new xmos chips would be 'completely different'. or something like the benito's usb enabled atmel chip... or a pic.
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am

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

Postby madworm_de » Sun Aug 30, 2009 11:06 pm

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 ;-)
NO LARDO CHIPS
User avatar
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 5:56 am


Return to Microcontrollers

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [107]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]