欢迎访问ic37.com |
会员登录 免费注册
发布采购

68HC912DG128PV8 参数 Datasheet PDF下载

68HC912DG128PV8图片预览
型号: 68HC912DG128PV8
PDF下载: 下载PDF文件 查看货源
内容描述: M68HC12微控制器 [M68HC12 Microcontrollers]
分类和应用: 微控制器外围集成电路时钟
文件页数/大小: 452 页 / 3509 K
品牌: FREESCALE [ Freescale ]
 浏览型号68HC912DG128PV8的Datasheet PDF文件第287页浏览型号68HC912DG128PV8的Datasheet PDF文件第288页浏览型号68HC912DG128PV8的Datasheet PDF文件第289页浏览型号68HC912DG128PV8的Datasheet PDF文件第290页浏览型号68HC912DG128PV8的Datasheet PDF文件第292页浏览型号68HC912DG128PV8的Datasheet PDF文件第293页浏览型号68HC912DG128PV8的Datasheet PDF文件第294页浏览型号68HC912DG128PV8的Datasheet PDF文件第295页  
Freescale Semiconductor, Inc.  
Inter-IC Bus  
IIC Programming Examples  
An example of a program which generates the START signal and  
transmits the first byte of data (slave address) is shown below:  
CHFLAG  
BRSET  
BSET  
IBSR,#$20,*  
IBCR,#$30  
;WAIT FOR IBB FLAG TO CLEAR  
;SET TRANSMIT AND MASTER MODE  
;i.e. GENERATE START CONDITION  
;TRANSMIT THE CALLING  
TXSTART  
MOVB  
CALLING,IBDR  
IBSR,#$20,*  
;ADDRESS, D0=R/W  
IBFREE  
BRCLR  
;WAIT FOR IBB FLAG TO SET  
15.7.3 Post-Transfer Software Response  
Transmission or reception of a byte will set the data transferring bit (TCF)  
to 1, which indicates one byte communication is finished. The IIC Bus  
interrupt bit (IBIF) is set also; an interrupt will be generated if the interrupt  
function is enabled during initialization by setting the IBIE bit. Software  
must clear the IBIF bit in the interrupt routine first. The TCF bit will be  
cleared by reading from the IIC Bus Data I/O Register (IBDR) in receive  
mode or writing to IBDR in transmit mode.  
Software may service the IIC I/O in the main program by monitoring the  
IBIF bit if the interrupt function is disabled. Note that polling should  
monitor the IBIF bit rather than the TCF bit since their operation is  
different when arbitration is lost.  
Note that when an interrupt occurs at the end of the address cycle the  
master will always be in transmit mode, i.e. the address is transmitted. If  
master receive mode is required, indicated by R/W bit in IBDR, then the  
Tx/Rx bit should be toggled at this stage.  
During slave mode address cycles (IAAS=1) the SRW bit in the status  
register is read to determine the direction of the subsequent transfer and  
the Tx/Rx bit is programmed accordingly. For slave mode data cycles  
(IAAS=0) the SRW bit is not valid, the Tx/Rx bit in the control register  
should be read to determine the direction of the current transfer.  
MC68HC912DG128 — Rev 3.0  
Technical Data  
Inter-IC Bus  
For More Information On This Product,  
Go to: www.freescale.com  
 复制成功!