40 likes | 187 Views
Electronic key. By : Soleymani M. Evtushenko V . Supervised by : Borovitskyi V . M . Kondratenko D . U. Device developed on the basis of microcontroller ATMEL –Tiny 26. Circuit diagram. Software. .include "tn26def.inc" .equ Relay = PortB6 .org 0 rjmp Init Init: ; Port Settings
E N D
Electronic key By: SoleymaniM. EvtushenkoV. Supervised by: BorovitskyiV.M. KondratenkoD.U.
Device developed on the basis of microcontrollerATMEL –Tiny 26
Software • .include "tn26def.inc" • .equ Relay = PortB6 • .org 0 • rjmp Init • Init: • ; Port Settings • ldi R20, 0b00000000 • out DDRA, R20 • ; • ldi R20, 0b11110011 • out PORTA, R20 • ; • ldi R20, 0b01000000 • out DDRB, R20 • ; • ldi R20, 0b01000000 • out PORTB, R20 • ; • Main: • in R20, PINA • andi R20, 0b11110011 • cpi R20, 0b10010010 • breq TurnOn • sbi PortB, Relay • rjmp Main • TurnOn: • cbi PortB, Relay • rjmp Main