Требуется программист в Зеленограде
- обработка данных с датчиков; ColdFire; 40 тыс. e-mail:jobsmp@pochta.ru |
/*****************************************************
This program was produced by the
CodeWizardAVR V1.25.3 Professional
Automatic Program Generator
й Copyright 1998-2007 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.comProject : EasyInt0
Version : 1.0
Date : 19.06.2007
Author : YellowTiger
Company : na
Comments:
Chip type : ATtiny45
Clock frequency : 1,000000 MHz
Memory model : Tiny
External SRAM size : 0
Data Stack size : 64
*****************************************************/#include
// External Interrupt 0 service routine
interrupt [EXT_INT0] void ext_int0_isr(void)
{
//PINB.4 = 1;
}// Timer 0 overflow interrupt service routine
interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
volatile static unsigned char cCounter;//if ( cCounter++ == 1 ) PINB.5 = 1; // toggle 5th pin out once per MAXINT
//PORTB.5 = ( (cCounter++) & 0x01 );
//PORTB = ( (cCounter++) & 0x80 )? 0x3F:0;
PORTB = cCounter++;
}// Declare your global variables here
void main(void)
{
// Declare your local variables here// Crystal Oscillator division factor: 4
#pragma optsize-
CLKPR=0x80;
CLKPR=0x02;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif// Input/Output Ports initialization
// Port B initialization
// Func5=Out Func4=In Func3=In Func2=In Func1=In Func0=In
// State5=0 State4=T State3=T State2=T State1=T State0=T
PORTB=0xFF;
DDRB=0x3F; //0x20;// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 System clock
// Mode: Normal top=FFh
// OC0A output: Disconnected
// OC0B output: Disconnected
TCCR0A=0x00;
TCCR0B=0x01;
TCNT0=0x00;
OCR0A=0x00;
OCR0B=0x00;// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFh
// OC1A output: Disconnected
// OC1B output: Disconnected
// Timer 1 Overflow Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
PLLCSR=0x00;
TCCR1=0x00;
GTCCR=0x00;
TCNT1=0x00;
OCR1A=0x00;
OCR1B=0x00;
OCR1C=0x00;// External Interrupt(s) initialization
// INT0: On
// INT0 Mode: Any change
// Interrupt on any change on pins PCINT0-5: Off
GIMSK=0x40;
MCUCR=0x01;
GIFR=0x40;// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x02;// Universal Serial Interface initialization
// Mode: Disabled
// Clock source: Register & Counter=no clk.
// USI Counter Overflow Interrupt: Off
USICR=0x00;// Analog Comparator initialization
// Analog Comparator: Off
ACSR=0x80;
ADCSRB=0x00;// Global enable interrupts
#asm("sei")while (1)
{
// Place your code here
};
}
а по ссылке - картинка на первом выходе (potb.0)... На остальных чистый меандр, 5В, как и было заказано...