;******************************************************** ldi temp,0b00000000 ;настройка порта B 1-выход 0-вход out DDRB,temp ; ldi temp,0b11111111 ; out PORTB,temp ; ;******************************************************** ldi temp,0b00000000 ;настройка порта D 1-выход 0-вход out DDRD,temp ; ldi temp,0b11111111 ; out PORTD,temp ; ;******************************************************** ldi temp,0b11111111 ;настройка порта A 1-выход 0-вход out DDRA,temp ; ldi temp,0b00000000 ; out PORTA,temp ; ;******************************************************** ldi temp,0b00000000 ;настройка порта C 1-выход 0-вход out DDRC,temp ; ldi temp,0b11111111 ; out PORTC,temp ; ;********************************************************
ldi temp,0x04 ;*************************** out sph,temp ;**** Настройка стека ***** ldi temp,0x5f ;**** на верхний адрес ***** out spl,temp ;**** памяти SRAM ***** ;***************************
main:
ldi temp,0b00000001 out PORTA,temp call time_100_ms
ldi temp,0b00000010 out PORTA,temp call time_100_ms
ldi temp,0b00000100 out PORTA,temp call time_100_ms
ldi temp,0b00001000 out PORTA,temp call time_100_ms
ldi temp,0b00010000 out PORTA,temp call time_100_ms
ldi temp,0b00100000 out PORTA,temp call time_100_ms
ldi temp,0b01000000 out PORTA,temp call time_100_ms
ldi temp,0b10000000 out PORTA,temp call time_100_ms
time_100_ms_1: ;**************************************** dec temp ;**** внутреннее тело цикла 5кц ********* tst temp ;**************************************** breq time_100_ms_2 ;**************************************** rjmp time_100_ms_1 ;****************************************
time_100_ms_2: dec temp1 tst temp1 breq time_100_ms_3 rjmp time_100_ms_01
time_100_ms_3: dec temp2 tst temp2 breq time_100_ms_end rjmp time_100_ms_001
time_100_ms_end:
pop temp2 pop temp1 pop temp ret ;************************************************************* ;*** Окончание подпрограммы отсчета времени 100 мс на 8МГц *** ;*************************************************************