Выставил TCCR0=0b01101001; и завёлся. Только вот теперь новая проблема.
Код: Выделить всё
\
// ADC interrupt service routine
interrupt [ADC_INT] void adc_isr(void)
{
// Read the AD conversion result
adc_data=ADCH;
// Place your code here
if (adc_data != adc_dataold) {
if (adc_data > 200) {OCR0 = 255;}
if (adc_data < 100) {OCR0 = 0;}
if ((adc_data >= 100) && (adc_data <= 200)) {OCR0 = adc_data;}
adc_dataold = adc_data;
delay_us(1);
}
}
void main(void)
{
PORTA=0b00010000;
DDRA=0b01101111;
PORTB=0b00000000;
DDRB=0b11111111;
PORTD=0b00000000;
DDRD=0b11111111;
PORTC=0b10000000;
DDRC=0b01111111;
TCCR0=0b01100001;
TCNT0=0x00;
OCR0=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0b01000100;
ACSR=0x80;
SFIOR=0x00;
ADMUX=0b01110111;
ADCSRA=0b11101111;
SFIOR&=0x00;
// Global enable interrupts
#asm("sei")
while (1)
{
delay_us(5);
PORTA = ((PORTA & 0b11110000) | mpxbutt);
delay_us(5);
mpxbutt = mpxbutt + 1;
if (mpxbutt == 16) {mpxbutt = 0;};




