Цитата
Зачем delay_loop вызываете, вместо нормальной _delay_ms(x)?
ну проверил просто. Заработал и с delay_loop.
Сейчас хочу Шпаковскую прогу добить:
Код
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <avr/wdt.h>
#define Freq 4000000
ISR(TIMER1_OVF_vect)
{
TCNT1 = 0x10000 - (Freq / 1024);
PORTB ^= 0x01;
}
int main (void)
{
DDRB = 0x01;
wdt_disable();
TCCR1A = 0;
TCCR1B = 5;
TCNT1 = 0x10000 - (Freq / 1024);
TIFR = 0x00;
TIMSK = 0x80;
// GICR = 0x00;
sei();
while(1){};
}
лог такой:
Цитата
> "make.exe" all
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright © 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: test1.c
avr-gcc -c -mmcu=atmega16a -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./test1.lst -std=gnu99 -MMD -MP -MF .dep/test1.o.d test1.c -o test1.o
In file included from test1.c:3:
c:/winavr/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
Linking: test1.elf
avr-gcc -mmcu=atmega16a -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test1.o -std=gnu99 -MMD -MP -MF .dep/test1.elf.d test1.o --output test1.elf -Wl,-Map=test1.map,--cref -lm
Creating load file for Flash: test1.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock test1.elf test1.hex
Creating load file for EEPROM: test1.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex test1.elf test1.eep || exit 0
Creating Extended Listing: test1.lss
avr-objdump -h -S -z test1.elf > test1.lss
Creating Symbol Table: test1.sym
avr-nm -n test1.elf > test1.sym
Size after:
AVR Memory Usage
----------------
Device: atmega16a
Program: 196 bytes (1.2% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
-------- end --------
> Process Exit Code: 0
> Time Taken: 00:01
должен мигать(светодиод заведен ) PB0(1 ножка МК). Ноль реакции.
Какие ещё предложения?