TI-H: TI Send Routine
[Prev][Next][Index][Thread]
TI-H: TI Send Routine
Listen to 2pac...
write_ti:
ldi etemp, 8 ;Send 8 bits
te: sbrs temp, 0 ;Is bit 0 high?
rjmp tc ;nope
cbi DDRB, Datab ;Clear Data1
Sending a 1
ta: sbic PINB, Dataa ;Wait for Data0 to go low
rjmp ta
sbi DDRB, Datab ;Pull Data1 high
tb: sbis PINB, Dataa ;Wait for Data0 to go high
rjmp tf ;Done with bit
tc: cbi DDRB, Dataa ;Clear Data0
Sending a 0
td: sbic PINB, Datab ;Wait for Data1 to go low
rjmp td
sbi DDRB, Dataa ;Pull Data0 high
sbis PINB, Datab ;Wait for Data1 to go high
tf: dec etemp ;We've done that bit. Tell
avr that.
breq tg ;If zero, we're done!
lsr temp ;Not done. :( Shift right
to next bit...
rjmp te ;Start over again...
tg: ret ;done!