Мои записульки исследования линка ZT.
#D6 = Loop far D5
#D5 = Challenge/Control
8us - acknowledge
[SHORT]
Master = 36 transactions / 9 words (1+7+1)
Change Direction = 2 transactions
Slave = 12 transactions / 3 words (1+1+1)
Change Direction = 2 transactions
Master = 6 transactions / 1,5 word
Total Transactions = 58
Total Time = 1,56 ms
Required speed ~ 297435 bit/s (1 byte = 1 transaction)
[LONG]
Master = 36 transactions / 9 words (1+7+1)
Change Direction = 2 transactions
Slave = 40 transactions / 10 words (1+8+1)
Change Direction = 2 transactions
Master = 6 transactions / 1,5 word
Total Transactions = 86
Total Time = 2,33 ms
Required speed ~ 295278 bit/s (1 byte = 1 transaction)
TimeOut Loop:
M:
ROM:0001BE4C 53 45 subq.w #1,d5 4+0
ROM:0001BE4E 67 0C beq.s loc_1BE5C 12+0
ROM:0001BE50 08 13 00 06 btst #6,(a3) 4+8
ROM:0001BE54 66 F6 bne.s loc_1BE4C 10+0
Total: 38 clocks
$2000 times = 311296 clocks (for all)
@7,6MHz =
#D3..D0 - Data
$20 => A1000B (D6=In, D5=Out, D4=In, D3=In, D2=In, D1=In, D0=In)
a2 = A1000B (IRQ/DIR, 1 - OUT)
a3 = A10005 (DATA)
$0F => d2
$F0 => d3
A10005 (D5=0) => (D6=x, D5=0, D4=x, D3=x, D2=x, D1=x, D0=x) Challenge!
$00 => d1
READ_WORD() => READ_PACKET_SIZE => d7
if d7>0 = Cycle READ_WORD
READ_WORD() => SUMM!
(D5=0)
while D6=0 do loop, TimeOut=>Exit, (D5=1)
(D5=0)
while D6=1 do loop, TimeOut=>Exit, $2F => A1000B (D6=In, D5=Out, D4=In, D3=Out, D2=Out, D1=Out, D0=Out)
WRITE_WORD() => WRITE_PACKET_SIZE
if WRITE_PACKET_SIZE>0 = Cycle WRITE_WORD
WRITE_WORD() = SUMM!
$20 => A1000B (D6=In, D5=Out, D4=In, D3=In, D2=In, D1=In, D0=In)
(D5=1) while D6=0 do loop, TimeOut=>Exit
(D5=0)
READ_WORD()
while D6=0 do loop, TimeOut
(D5=1)
while D6=0 do loop, TimeOut
Return
Send_Packet:
#
READ_WORD: (d5=0)
L1: TimeOut? => Exit
PORT_D6=0? => L1
PORD_D=>d7
d7=>SP
A10005 (D5=1) => (D6=x, D5=1, D4=x, D3=x, D2=x, D1=x, D0=x) Challenge!
L2: TimeOut? => Exit
PORT_D6=1? => L2
PORD_D=>d7
d7=d7<<8
A10005 (D5=0) => (D6=x, D5=0, D4=x, D3=x, D2=x, D1=x, D0=x) Challenge!
L3: TimeOut? => Exit
PORT_D6=0? => L3
PORD_D=>d7
d7=d7<<8
A10005 (D5=1) => (D6=x, D5=1, D4=x, D3=x, D2=x, D1=x, D0=x) Challenge!
L2: TimeOut? => Exit
PORT_D6=1? => L2
PORD_D=>d7
d7=d7<<8
A10005 (D5=0) => (D6=x, D5=0, D4=x, D3=x, D2=x, D1=x, D0=x) Challenge!
d7=d16(d23..d8)
Exit
#WRITE_WORD:
D5>1>0>1>0
Думаешь, ты осилишь это?