English
Language : 

MC68HC05E5 Datasheet, PDF (87/140 Pages) Freescale Semiconductor, Inc – General Release Specification
Freescale Semiconductor, Inc.
Motorola Bus (M Bus) Interface
Programming Considerations
11.8.2 Generation of a Start Signal and the First Byte of Data Transfer
After completion of the initialization procedure, serial data can be
transmitted by selecting the master transmitter mode. If the device is
connected to a multimaster bus system, the state of the M-bus busy bit
(MBB) must be tested to check whether the serial bus is free. If the bus
is free (MBB = 0), the start condition and the first byte (the slave address)
can be sent.
An example of a program which generates the start signal and transmits
the first byte of data (slave address) is shown here. (The MMUX bit must
be set to allow control of PB7 and PB6 pins.)
SEI
CHFALG BRSET
TXSTART BSET
BSET
LDA
STA
CLI
; DISABLE INTERRUPT
5,MSR,CHFLAG; CHECK THE MBB BIT OF THE
; STATUS REGISTER. IF IT IS
; SET, WAIT UNTIL IT IS CLEAR
4,MCR
; SET TRANSMIT MODE
5,MCR
; SET MASTER MODE
; i.e., GENERATE START CONDITION
#CALLING ; GET THE CALLING ADDRESS
MDR
; TRANSMIT THE CALLING
; ADDRESS
; ENABLE INTERRUPT
MC68HC05E5 — Rev. 1.0
General Release Specification
Motorola Bus (M Bus) Interface
For More Information On This Product,
Go to: www.freescale.com