M-Bus Interface Module
7-10
MC68307 USER’S MANUAL
MOTOROLA
SRW—Slave Read/Write
When MAAS is set this bit indicates the value of the R/W command bit of the calling ad-
dress sent from master. This bit is only valid when a complete transfer has occurred and
no other transfers have been initiated. Checking this bit, the CPU can select slave trans-
mit/receive mode according to the command of master.
1 = Slave transmit, master reading from slave.
0 = Slave receive, master writing to slave.
MIF—M-Bus Interrupt
The MIF bit is set when an interrupt is pending, which causes a processor interrupt re-
quest provided MIEN is set. MIF is set when one of the following events occurs:
1.Complete one byte transfer (set at the falling edge of the 9th clock).
2.Receive a calling address that matches its own specific address in slave receive
mode.
3.Arbitration lost.
This bit must be cleared by software, writing a low to it, in the interrupt routine.
RXAK—Received Acknowledge
The value of SDA during the acknowledge bit of a bus cycle. If the RXAK is low, it indicates
an acknowledge signal has been received after the completion of 8 bits data transmission
on the bus. If RXAK is high, it means no acknowledge signal is detected at the 9th clock.
1 = No acknowledge received
0 = Acknowledge received
7.3.5 M-Bus Data I/O Register (MBDR)
In master transmit mode, data written into the MBDR is sent to the bus automatically. The
most significant bit is sent first. In master receive mode, reading this register initiates next
byte data receiving. In slave mode, the same function is available after it is addressed.
7.4 M-BUS PROGRAMMING EXAMPLES
The following paragraphs provide programming examples for the M-bus module.
7.4.1 Initialization Sequence
Reset puts the M-bus control register to its default status. Before the interface can be used
to transfer serial data, an initialization procedure must be carried out:
1. Update MFDR, select division ratio required to obtain SCL frequency from system
clock.
MBDR
MBASE+$149
7
0
D7
D6
D5
D4
D3
D2
D1
D0
RESET:
0
Read/Write
Supervisor or User