Setup Example - Panasonic MN101L Series User Manual

Lsi
Table of Contents

Advertisement

Chapter 13
Serial Interface
13.5.4

Setup Example

Setting Example of Master Communication
Set a slave address and R/W bit toTXBUFn
Master communication completion
SCnIICSTR.IIC3DATA_ERR=0?
YES(*2)
Communication completion interrupt generation
SCnIICSTR.IIC3ABT_LST=0?
YES(*2)
Continue communication ?
YES(*2)
Transmission/reception mode selection
Transmission data buffer writing
XIII - 68
IIC Communication
Serial reset
SCnMD2.IIC3RSTN=0
Iniial setting (*1)
End of serial reset
SCnMD2:IIC3RSTN=1
Initializing monitor flag
SCnIICSTR.IIC3ABT_LST=0
Start master communication
YES
ACK bit detection ?
SCnMD3.SCnACKO=1?
YES
Arbitration lost detected ?
NO
YES
Restart condition detected ?
SCnIICSTR.IIC3STRT=1?
NO
SCnMD3.IIC3REX
Set data to TXBUFn
Figure:13.5.13 Master communication Setting Flow Diagram
(*1) As initial setting, register changed at the time of serial reset is shown below.
Please change it if needed, such as interrupt setting or port setting.
Master setting at slave address transmission
SCnMD0
SCnCE1
SCnCTM
IIC3DEM
SCnMD1
SCnIOM
SCnMST
SCnSBTS
SCnSBIS
SCnSBOS
SCnIFS
SCnCKPH
SCnMD2
SCnSBCSEN
SCnSBCSLV
SCnMD3
IIC3STPC
IIC3REX
SCnCMD
IIC3ACKS
Other, SCnMD0, SCnMD3, SCnAD register
SCnMD0
SCnDIR
IIC3STE
SCnMD3
IIC3TMD
SCnAD
IIC3AD7-0
Serial transfer clock is needed to be set with BRTM_S_EN, BRTM_S_MD
and so forth.
(*2) To avoid communication error, confirm that IIC serial communication
is not executed with IIC3BUSBSY before starting next communication.
NO
NO
Stop condition generation
SCnMD3.IIC3STPC =1
IIC communication completion
Termination processing of IIC communication
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "1".
Be sure to set it to "1".
Be sure to set it to "1".
Be sure to set it to "1".
Be sure to set it to "1".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "0".
Be sure to set it to "1".
Be sure to set it to "1".
Select MSB-first or LSB-first
Start condition setting
Communication mode selectioon
Slave address setting

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn101lr05dMn101lr04dMn101lr03dMn101lr02d

Table of Contents