Quería probar un simple guión parpadeante en mi ATMEGA328p. La configuración del tablero de pruebas (probado y funciona bien). Pero el LED no parpadea. Probé los voltajes a través del tablero y están apareciendo con 5V como se esperaba. La respuesta avrdude también se espera. Sólo el LED no parpadea. Cambié el chip también, pero esto no tiene ningún efecto. ¿Tienes alguna idea?
También medí el pin LED, pero hay 0V en el pin y espero que cambie a 5V con el código provisto.
code.c
#ifndefF_CPU#defineF_CPU1000000UL#endif#include<avr/io.h>#include<util/delay.h>intmain(void){DDRB=0b00000001;while(1){PORTB=0b00000001;_delay_ms(1000);PORTB=0b00000000;_delay_ms(1000);}return0;}
Hecreadounscriptdecompilación:
compilar
#!/bin/bashavr-gcc-g-Os-mmcu=atmega328p-ccode.cavr-gcc-g-mmcu=atmega328p-ocode.elfcode.oavr-objcopy-j.text-j.data-Oihexcode.elfcode.hexavr-size--format=avr--mcu=atmega328pcode.elf
yelarchivoflasheadoaATMEGA
avrdude-cusbtiny-pm328p-Uflash:w:code.hex
lasalidaAVRDUDE:
avrdude:Version6.3,compiledonSep212018at19:15:33Copyright(c)2000-2005BrianDean,http://www.bdmicro.com/Copyright(c)2007-2014JoergWunschSystemwideconfigurationfileis"/usr/local/Cellar/avrdude/6.3_1/etc/avrdude.conf"
User configuration file is "/Users/sebastianscharf/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 020:012
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
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
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: programmer operation not supported
avrdude: Using SCK period of 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FF
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: Using SCK period of 10 usec
avrdude: reading input file "code.hex"
avrdude: input file code.hex auto detected as Intel Hex
avrdude: writing flash (178 bytes):
Writing | ################################################## | 100% 0.29s
avrdude: 178 bytes of flash written
avrdude: verifying flash memory against code.hex:
avrdude: load data flash data from input file code.hex:
avrdude: input file code.hex auto detected as Intel Hex
avrdude: input file code.hex contains 178 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.21s
avrdude: verifying ...
avrdude: 178 bytes of flash verified
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D9, L:62)
avrdude done. Thank you.