Спойлер
Спойлер
Код: Выделить всё
/*****************************************************
This program was produced by the
CodeWizardAVR V1.24.8d Professional
Automatic Program Generator
© Copyright 1998-2006 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date : 15.01.2014
Author : F4CG
Company : F4CG
Comments:
Chip type : ATtiny13
Clock frequency : 4,000000 MHz
Memory model : Tiny
External SRAM size : 0
Data Stack size : 16
*****************************************************/
#include <tiny13.h>
#include <delay.h>
// Declare your global variables here
void main(void)
{
// Declare your local variables here
// Crystal Oscillator division factor: 1
#pragma optsize-
CLKPR=0x80;
CLKPR=0x00;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif
// Input/Output Ports initialization
// Port B initialization
// Func5=In Func4=In Func3=In Func2=In Func1=Out Func0=Out
// State5=T State4=T State3=T State2=T State1=0 State0=0
PORTB=0x00;
DDRB=0x03;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Fast PWM top=OCR0A
// OC0A output: Non-Inverted PWM
// OC0B output: Non-Inverted PWM
TCCR0A=0xA3;
TCCR0B=0x08;
TCNT0=0x00;
OCR0A=0x00;
OCR0B=0x00;
// External Interrupt(s) initialization
// INT0: Off
// Interrupt on any change on pins PCINT0-5: Off
GIMSK=0x00;
MCUCR=0x00;
// Timer/Counter 0 Interrupt(s) initialization
TIMSK0=0x00;
// Analog Comparator initialization
// Analog Comparator: Off
ACSR=0x80;
ADCSRB=0x00;
while (1)
{
// Place your code here
while(OCR0B<0xff)
{
OCR0B=OCR0B+0x01;
delay_ms(5);
}
while(OCR0A<0xff)
{
OCR0A=OCR0A+0x01;
delay_ms(5);
}
while(OCR0A>0x00)
{
OCR0A=OCR0A-0x01;
delay_ms(5);
}
while(OCR0B>0x00)
{
OCR0B=OCR0B-0x01;
delay_ms(5);
}
};
}
Подал питание диоды вообще не загорелись. Подскажите пожалуйста в чем ошибка.


