Appendix B - Programming Example - Motorola MC68360 User Manual

Asynchronous hdlc, async hdlc protocol microcode
Hide thumbs Also See for MC68360:
Table of Contents

Advertisement

Appendix B - Programming Example

The following list is a suggested initialization sequence when using ASYNC-HDLC. This as-
sumes that you have already followed the initialization procedure in Section 3.1.
1. Initialize the SDCR register.
2. Configure Port A and Port C pints to enable RXD, TXD, CTS, CD, and CTS. (This as-
sumes you are using NMSI mode. If not, appropriately configure the time slot assigner
and TSA pins)
3. Configure a BRG to generate appropriate channel clocking frequency.
4. Program the SICR to route the BRG clocking to the SCC running ASYNC-HDLC.
5. Select whether the channel is using the Time Slot Assigner or the NMSI pins in the
SICR.
6. Write RBASE and TBASE in the SCC's parameter RAM to point to the first RxBD and
the first TxBD. (note that they cannot reside in the locked areas described in Section 3)
7. Issue the INIT RX & TX PARAMETERS command for that SCC.
8. Program RFCR and TFCR.
9. Write MRBLR with the maximum receive buffer size.
10. Write C_MASK and C_PRES with the standard values.
11. Write the "zero" register to 0x0000.
12. Program the RFTHR register to the number of frames that should be received before
an interrupt is generated.
13. Program the TX and RX Control Character Tables.
14. Initialize all RxBDs.
15. Initialize all TxBDs.
16. Clear the SCCE register by writing $FFFF to it.
17. Program the SCCM register with the proper mask to allow all desired interrupts.
18. Program the GSMR_H. (see Section 4.2.1)
19. Program the GSMR_L register to ASYNC HDLC mode, but do not turn on the trans-
mitter or receiver.
20. Set the PSMR register appropriately. (see Section 6.2)
21. Turn on the transmitter and receiver in the GSMR_L register.
MOTOROLA
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Asynchronous HDLC
23

Advertisement

Table of Contents
loading

Table of Contents