Applications Information
MOTOROLA
MC68307 USER’S MANUAL
10-17
10.3.7.1 SOFTWARE LISTING 1—M-BUS MASTER SOFTWARE
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
*
MOTOROLA 68307 IMBP TEST BOARD - M-bus
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
*
MODULE:
MBM_INT.SRC
DATE:
8/4/94
*
Developed by :
Motorola
*
HI-END Applications
*
East Kilbride.
*
NOTES:
*
Master M-bus Routine using interrupts for a Master/Slave Test
*
The number of bytes transmitted and received is completely
*
controlled by the master. (i.e. When the slave is receiving data,
*
it acknowledges all the time, and the master dictates the number of
*
bytes to transfer. When the slave is transmitting, the master
*
receiver acknowledges dictate whether the slave is to send further
*
bytes or not.
*
The Master:
*
1) Writes out the slave chip address, and 2 slave data bytes.
*
2) Writes out the slave chip address, and reads 2 slave data bytes
*
3) Verifies the data read back against that originally sent.
*
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
*
External Reference Declarations
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
XREF
SCR
; System Control Reg
XREF
PBCNT
; Port B Control Reg
XREF
PIVR
; Peripheral Interrupt Vector Reg
XREF
PICR
; Peripheral Interrupt Control Reg
XREF
MADR
; M-bus Address Reg
XREF
MFDR
; M-bus Freq Divider Reg
XREF
MBCR
; M-bus Control Reg
XREF
MBSR
; M-bus Status Reg
XREF
MBDR
; M-bus Data Reg
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
*
Constants
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
UVECBASE
EQU
$100
; User Vector Base
MBUSVEC
EQU
UVECBASE+($D*4)
; M-bus vector location
MBUSHAN
EQU
$15000
; M-bus Interrupt Handler location
S307_AD
EQU
$66
; Slave 68307 M-bus Address
DRXCNT
EQU
$3
; Data RECEIVE COUNT (2 + 1 Dummy)
ATXCNT
EQU
$1
; Address TRANSMIT COUNT
DTXCNT
EQU
$2
; Data TRANSMIT COUNT
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
*
Main Program
*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––