AVR fuses

Martin Hanek martin.hanek@centrum.cz
Čtvrtek Květen 29 14:18:25 CEST 2008


Mam v poznamkach priklad:

Nastaveni AVRDUDE (programovani):
---------------------------------
flash:
------
avrdude -p m8 -c sp12 -U flash:w:wiikey19.hex -U lfuse:w:0xE4:m -U 
hfuse:w:0xD8:m -U lock:w:0xCF:m

-p m8					ATMega8
-C sp12					Steve Bolt's Programmer
-U flash:w:wiikey19.hex			memory flash, write file wiikey19.hex
-U lfuse:w:0xE4:m			low fuse byte, 	write immediate mode: 11100100
-U hfuse:w:0xD8:m			high fuse byte, write immediate mode: 11011000
-U lock:w:0xCF:m			lock byte,	write immediate mode: 11001111

eeprom:
-------
avrdude -p m8 -c sp12 -U eeprom:w:PAL.eep

-p m8					ATMega8
-C sp12					Steve Bolt's Programmer
-U eeprom:w:PAL.eep			eeprom, write file PAL.eep


Napriklad toto je pro ATmega8. Pojistky jsou popsany na strane 222 a 
dale v datasheetu. Mejte na pameti ze 0 znamena naprogramovany bit a 1 
nenaprogramovany.

Martin Hanek


DavPra napsal(a):
> Dobry den,
> zacinam zkouset programovat AVR-ka v C-ku. Jdu na to pod linuxem (Xubuntu 8.04). Jako prekladac pouzivam avr-gcc a programator pouzivam avrdude. Zkusil sem si napsat maly programek na blikani LEDky. Jenze sem narazil na problem s fuses. Do datasheetu koukam uz skoro dve hodky a sem z toho stale zmaten. Mohl by mi nekdo prosim poradit jak nastavit fuses.
> Program:
> 
> #include <avr/io.h>
> #include <avr/iotn2313.h>
> #include <avr/sleep.h>
> 
> #define F_CPU 10.0592E6
> 
> #include <util/delay.h>
> 
> 
> int main (void)
> {
> 
> DDRD |=  (1<<PD6);     // nastaven jako vystup
> PORTD |= (1<<PORTD6);    // nastavi 1 na vystup
> _delay_ms(10000);
> PORTD &= ~(0<<PORTD6);  // nastavi 0 na vystup
> _delay_ms(10000);
> 
> return(0);   
> }
> 
> Kompilace probehne vpohode, ale nemuzu ten program nahrat do AVRka.
> Prikaz pro avrdude pouzivam:
> 
> avrdude -p t2313 -c stk200 -U flash:w:$<
> 
> boldak@boldak-desktop:~/programovani/avr/projekty/pokus$ sudo make load
> [sudo] password for boldak:
> avrdude -p t2313 -c stk200 -U flash:w:pokus.hex
> 
> avrdude: AVR device initialized and ready to accept instructions
> 
> Reading | ################################################## | 100% 0.00s
> 
> avrdude: Device signature = 0x001e0a
> avrdude: Expected signature for ATtiny2313 is 1E 91 0A
>          Double check chip, or use -F to override this check.
> 
> avrdude done.  Thank you.
> 
> make: *** [load] Error 1
> 
> Pokud dam do prikazu parametr -F tak mi to vyhodi zase tutu hlasku:
> 
> boldak@boldak-desktop:~/programovani/avr/projekty/pokus$ sudo make load
> avrdude -p t2313 -c stk200 -U -F flash:w:pokus.hex
> 
> avrdude: AVR device initialized and ready to accept instructions
> 
> Reading | ################################################## | 100% 0.00s
> 
> avrdude: Device signature = 0x1e910a
> avrdude: safemode: Verify error - unable to read hfuse properly. Programmer may not be reliable.
> avrdude: safemode: To protect your AVR the programming will be aborted
> 
> avrdude done.  Thank you.
> 
> make: *** [load] Error 1
> 
> Nevite nekdo jak mam nastavit fuses..?
> 
> Predem dekuji za odpoved(i)
> 
> Boldak
> 
> PS: programator pouzivam STK200 http://hw.cz/Teorie-a-praxe/Konstrukce/ART376-LPT-ISP-Prog.html
> 
>  
> 
> 
> _______________________________________________
> HW-list mailing list  -  sponsored by www.HW.cz
> Hw-list@list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list
> 
> 



Další informace o konferenci Hw-list