beautypg.com

Zilog Z16C35 User Manual

Page 291

background image

14-11

1

0000027c d3e8

660

out

(scc_cont),a

0000027e 3e6b

661

ld

a,01101011b

;sdlc crc,

662 ;txcrc

enable,

663 ;reset

rts

00000280 d3e8

664

out

(scc_cont),a

665
666

;

667

;**start counting out 2 flag character times **

668

;

669

;count 16 bit times

670

;from the rs-422 enable

671

;for 2 flags.

672 ;btdelay=subr

delay+ctc1int+polling=8bits

673

;16 bit times-btdelay=16-8=08h

674 ;

00000282 0e08

675

ld

c,08h

00000284 cdWwww

676

call

bittime

;bittime delay

677

;is stored in reg.c

678

;and bit1 of timflg

679 ;will

indicate

680 ;count

termination.

681

00000287682 l6:

;timer flag

00000287 3aWwww

683

ld

a,(timflg)

;

0000028a cb4f

684

bit

1,a

;if bit1=1 then

685 ;count

terminated

0000028c 28f9

686

jr

z,l6

;

0000028e cb8f

687

res

1,a

;reset timflg bit1

00000290 32Wwww

688

ld

(timflg),a

;update timflg

689

;

00000293 3e03

690

ld

a,03h

;

00000295 d3e5

691

out

(ctc1_cont),a

;disable int,

692 ;software

reset

693

;to kill the counter1

00000297 0602

694

ld

b,02h

;2+1 bytes to transmitted

00000299 21Wwww

695

ld

hl,txlapenq

;point to txlapenq buffer

696

;send 1st byte

0000029c 7e

697

ld

a,(hl)

;

0000029d d3e9

698

out

(scc_data),a

;and send it

0000029f 23

699

inc

hl

;point to the next byte

700

;

000002a0 3ec0

701

ld

a,0c0h

;reset eom latch command

000002a2 d3e8

702

out

(scc_cont),a

703 ;

000002a4 f3

704

di

;disable all int

000002a5 3e0a

705

ld

a,0ah

;select WR10

000002a7 d3e8

706

out

(scc_cont),a

707

;idle with 1’s

708

;at the end of the frame

000002a9 3ee8

709

ld

a,11101000b

000002ab d3e8

710

out

(scc_cont),a

711 ;

000002ad 3e00

712 txq2:

ld

a,00h

000002af d3e8

713

out

(scc_cont),a

;rr0

000002b1 dbe8

714

in

a,(scc_cont)

;read rr0

000002b3 cb57

715

bit

2,a

;read tx buffer empty

000002b5 28f6

716

jr

z,txq2

;loop if zero

000002b7717 txq1:
000002b7 7e

718

ld

a,(hl)

;

000002b8 d3e9

719

out

(scc_data),a

;and send it

000002ba 23

720

inc

hl

;point to the next byte

721

Application Note

Technical Considerations When Implementing LocalTalk Link Access Protocol

Page 285 of 316

UM011002-0808