Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .device ATtiny2313A
- .nolist
- .include "tn2313adef.inc"
- .list
- .def temp = R16
- .def temp2 = R17
- .def temp3 = R18
- ; ***************
- rjmp Init
- ; ***************
- Init:
- ser temp
- out DDRB, temp
- out PortB, temp
- out PortD, temp
- clr temp
- out DDRD, temp
- ; ***************
- main:
- sbic PinB, 0
- rjmp turnON
- sbis PinB, 0
- rjmp turnOFF
- ; ***************
- turnON:
- sbic PinB, 0
- cbi PortB, 0
- rjmp setVar
- ; ***************
- turnOFF:
- sbis PinB, 0
- sbi PortB, 0
- rjmp setVar
- ; ***************
- setVar:
- ldi temp, 0x64
- ldi temp2, 0x64
- ldi temp3, 0x0C
- loop:
- dec temp
- brne loop
- loop2:
- dec temp2
- brne loop
- loop3:
- dec temp3
- brne loop
- rjmp main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement