Intenté construir un circuito de prueba basado en el libro "Programación AVR". Es muy simple y se muestra aquí:
Elcircuitoensíestáfuncionandoylacargademicódigotambién:
#include<avr/io.h>/*Definespins,ports,etc*/#defineF_CPU1000000UL#include<util/delay.h>/*Functionstowastetime*/intmain(void){DDRB|=0b00000001;while(1){PORTB=0b00000001;_delay_ms(1000);PORTB=0b00000000;_delay_ms(1000);}return0;}
peroelLEDnoparpadea.ElLEDenlaparteinferiorderechaestáencendido,porloqueelcircuitopareceestarbien.NohaymensajesdeerrorenATMELStudioylaconfiguracióndelcircuitomeparecebien.Elarchivohexadecimalparpadeacorrectamenteenelchip.InclusocambiéelLEDyelchipATMELaunonuevoyaúnasíelmismoresultado.Meestoyquedandosinideasdedepuración.
Laconfiguracióndelosfusiblesylasalidadeavrdude:
avrdude.exe:Version6.3,compiledonFeb172016at09:25:53Copyright(c)2000-2005BrianDean,http://www.bdmicro.com/Copyright(c)2007-2014JoergWunschSystemwideconfigurationfileis"C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : usb
Using Programmer : usbtiny
avrdude.exe: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : USBtiny
Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude.exe: programmer operation not supported
avrdude.exe: Using SCK period of 10 usec
CMD: [ac 53 00 00] [ac 52 53 00]
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | CMD: [30 00 00 00] [00 30 00 1e]
CMD: [30 00 01 00] [00 30 00 95]
################CMD: [30 00 02 00] [00 30 00 0f]
################################## | 100% 0.01s
avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe done. Thank you.
La línea de comando AVRDUDE que estoy usando:
avrdude -c usbtiny -p m328p -v -v -v -u flash:w:Test.hex:i