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

MC81F4216D 参数 Datasheet PDF下载

MC81F4216D图片预览
型号: MC81F4216D
PDF下载: 下载PDF文件 查看货源
内容描述: ABOV半导体的8位单芯片微控制器产品 [ABOV SEMICONDUCTOR 8-BIT SINGLE-CHIP MICROCONTROLLERS]
分类和应用: 半导体微控制器
文件页数/大小: 200 页 / 4220 K
品牌: FINECHIPS [ FINECHIPS ]
 浏览型号MC81F4216D的Datasheet PDF文件第163页浏览型号MC81F4216D的Datasheet PDF文件第164页浏览型号MC81F4216D的Datasheet PDF文件第165页浏览型号MC81F4216D的Datasheet PDF文件第166页浏览型号MC81F4216D的Datasheet PDF文件第168页浏览型号MC81F4216D的Datasheet PDF文件第169页浏览型号MC81F4216D的Datasheet PDF文件第170页浏览型号MC81F4216D的Datasheet PDF文件第171页  
MC81F4x16  
25.4 Procedure  
Initialization  
Following steps initialize the IIC slave.  
1. Set SCL and SDA pins as an alternative mode.  
Set the R1CONH[7~4] bits by 1010b.  
2. Set the slave address by setting the IICAR register.  
3. Enable IIC module and the interrupt :  
Set the ACKE bit by 1‟  
Set the IICEN bit by 1‟  
Set the IICIFEN bit by 1. ( If it is cleared by 0, IIC interrupt is not occurred )  
-> Or you can simply set the IICSCR register by E0h.  
After finish above steps, IIC interrupt is enabled. So The IIC interrupt will be generated after receive  
or transmit one byte.  
Interrupt Routine Procedure  
Simply say, when you write a byte to the IICSCR, it is transmitted and when a byte is received, you  
can read it from the IICDSR register.  
But, the master has a right to decide the read/write mode. And the master sends 1-bit R/W mode flag  
after 7-bit slave address. And it is stored in the IICTR(IICSCR.3) bit when it is received.  
So you can recognize current Rx/Tx mode. And you have to react based on the IICTR(IICSCR.3) bit.  
The IICTR(IICSCR.3) bit equals 1means that the master want to read from the slave. So, In this  
case, Slave-IICs mode is changed into transmit modeautomatically. So, in this case you have to  
write a data to the IICDSR register as you want.  
The IICTR(IICSCR.3) bit equals 0means that the master want to write to the slave. So, In this case,  
Slave-IICs mode is changed into receive modeautomatically. So, in this case you have to read a  
data from the IICDSR register.  
Before finish the IIC interrupt routine, you have to clear the IICIF bit. When the IICIF bit is cleared, the  
SCL line is released. If it is not cleared, the SCL line is holding down to low status. While in this  
condition, master cant continue the IIC communication.  
In order to recognize current received bytes position in the message, you have to count the IIC  
interrupts. Based on the position information  
October 19, 2009 Ver.1.35  
167