Код на C:
Спойлер
Код: Выделить всё
#define F_CPU 8000000
#include <avr/io.h>
#include <util/delay.h>
void init(void)
{
DDRB = 0b00000001;
PORTB = 0x00;
}
int main(void)
{
init();
/* Replace with your application code */
while (1)
{
PORTB = 0b00000001;
_delay_ms(1000);
PORTB = 0x00;
_delay_ms(1000);
}
}Результат работы avrdude. Шью через китайский EvUSBasp, который с переключателем 3.3 - 5v. Долго не мог его завести. Но в итоге вроде работает, поэтому не думаю что проблема в нем. Или такое возможно?
Прикладываю вывод avrdude и файлы на всякий пожарный. Они небольшие, может кто чего подскажет.
Вывод avrdude:
Спойлер
Код: Выделить всё
C:\Users\Forastero\Desktop>avrdude -c usbasp -p m8 -F -U flash:w:led.hex
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9307 (probably m8)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be perform
ed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: reading input file "led.hex"
avrdude: input file led.hex auto detected as Intel Hex
avrdude: writing flash (114 bytes):
Writing | ################################################## | 100% 0.10s
avrdude: 114 bytes of flash written
avrdude: verifying flash memory against led.hex:
avrdude: load data flash data from input file led.hex:
avrdude: input file led.hex auto detected as Intel Hex
avrdude: input file led.hex contains 114 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.06s
avrdude: verifying ...
avrdude: 114 bytes of flash verified
avrdude: safemode: Fuses OK (E:FF, H:D9, L:E1)
avrdude done. Thank you.Проблема была, скорее всего, в некачественных контактах платы. Пересобрал, воткнул ардуиновкий БП с другой стороны платы, и схема хаработала.
И, да, забыл прошить фьзы, из-за чего светодиод мигал медленно.