Witam.
Napisałem programik sterujący led, w założeniu miało to powodować efekt "pulsującego" światła. Program się skompilował z trzema ostrzeżeniami i nie wiem czy to będzie działać czy nie (na razie nie mam jeszcze układu i programatora). Proszę o sprawdzenie czy to ma szansę działać.
AVR-GCC + AVR Studio 4.15
log kompilatora:
Napisałem programik sterujący led, w założeniu miało to powodować efekt "pulsującego" światła. Program się skompilował z trzema ostrzeżeniami i nie wiem czy to będzie działać czy nie (na razie nie mam jeszcze układu i programatora). Proszę o sprawdzenie czy to ma szansę działać.
AVR-GCC + AVR Studio 4.15
#include <avr/io.h>
#include <util/delay.h>
#define F_CPU 8000000
#define PWMout OCR1A
unsigned short int pwmVal;
int main(void)
{ while(1)
{
TCCR1A=0xA3;
TCCR1B=0x09;
TCNT1=0x000;
for(pwmVal=0; pwmVal<1023; pwmVal++);
{
_delay_ms(2);
}
for(pwmVal=1023; pwmVal>0; pwmVal--);
{
_delay_ms(2);
}
PWMout=pwmVal;
}
}
log kompilatora:
Build started 29.4.2009 at 19:46:32
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT PWMLED.o -MF dep/PWMLED.o.d -c ../PWMLED.c
In file included from ../PWMLED.c:2:
d:/programs/wnavr/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
../PWMLED.c:3:1: warning: "F_CPU" redefined
d:/programs/wnavr/lib/gcc/../../avr/include/util/delay.h:86:1: warning: this is the location of the previous definition
avr-gcc -mmcu=atmega8 -Wl,-Map=PWMLED.map PWMLED.o -o PWMLED.elf
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature PWMLED.elf PWMLED.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex PWMLED.elf PWMLED.eep || exit 0
avr-objdump -h -S PWMLED.elf > PWMLED.lss
AVR Memory Usage
----------------
Device: atmega8
Program: 132 bytes (1.6% Full)
(.text + .data + .bootloader)
Data: 2 bytes (0.2% Full)
(.data + .bss + .noinit)
Build succeeded with 3 Warnings...
