Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MACRO mac1
- ldi r22,$99
- .ENDMACRO
- .MACRO mac2
- mac1
- ldi r22,$92
- mac1
- .ENDMACRO
- .EQU delay17 = 0
- .EQU delay18 = 0
- .EQU delay19 = 3 ;delay constants that can change serial rate etc. 0,0,9 gives about 1second at 1.6MHz
- ;-----------
- .MACRO delay ;basic 1 period delay. Start slow then speed up
- ldi r17,@0
- ldi r18,@1
- ldi r19,@2
- up:
- dec r17
- brne up
- dec r18
- brne up
- dec r19
- brne up
- .ENDMACRO
- ;-----------
- .MACRO delay1 ;shortest delay used. Others are multiples of this.
- delay delay17,delay18,delay19
- .ENDMACRO
- ;----------------
- .MACRO pinUp ;make output pin go high
- sbi PORTB,4 ;outPin PB4, currently, goes high
- sbi PORTB,3 ;make Led pin follow so I can see it
- .ENDMACRO
- ;------------------
- .MACRO pinDown ;make output pin go low
- cbi PORTB,4 ;outPin PB4, currently, goes low
- cbi PORTB,3 ;make Led pin follow so I can see it
- .ENDMACRO
- ;------------------
- .MACRO longIntro ;the long tone before byte, about 4 seconds
- delay 0,0,$20
- .ENDMACRO
- ;----------------
- .MACRO wait3 ;the long wait at the first start bit. 3 * unit wait = "delay1"
- delay1
- delay1
- delay1
- .ENDMACRO
- ;---------------
- .MACRO getEepromByte ;use like getEepromByte r1,r0 to put into r0 eeprom byte adr in r1
- out EEAR,@0 ; usually r1 contains the adr
- sbi EECR,EERE ;or sbi $1c,0. The read strobe.
- in @1,EEDR ;eeprom byte now in EEDR. Send usually to r0
- .ENDMACRO
- ;----------defs------------
- .DEF eepromLimit = r4
Advertisement
Add Comment
Please, Sign In to add comment