KL25的I2C模块调试的两个注意事项(Two tips in the debugging of KL25's I2C)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL25的I2C模块调试的两个注意事项(Two tips in the debugging of KL25's I2C)

KL25的I2C模块调试的两个注意事项(Two tips in the debugging of KL25's I2C)

中文版本:


    在KL25的官方Demo 源代码中只有I2C驱动的PE代码而没有I2C驱动的baremental代码,对于不习惯用PE生成代码的用户直接上手有难度,于是考虑将K60的 I2C baremental 驱动代码中移植到KL25上,以供大家参考。但在移植过程中遇到了两个比较典型的问题,所以这里分享出来,希望能帮助遇到同样问题的用户迅速定位并解决问题。

测试硬件:TWR-K60D100M开发板  K60+MMA8451(MMA8451为三轴加速传感器,与K60通过I2C总线连接。K60作为master,MMA8451作为slave)

                FRDM-KL25Z开发板       KL25+MMA8451

开发环境:IAR 6.6

1.问题描述: 配置I2Cx_F寄存器MULT位不为0时,Repeat start信号无法产生


问题提出:

K60示例代码(如附件1)中I2C demo的功能是通过I2C接口读取板载的加速度传感器MMA8451的数据,并且I2C数据控制采用查询ACK标志位的方式,在TWR-K60D100M开发板上运行该Demo一切正常。使用几乎相同的I2C驱动代码,在FRDM-KL25Z开发板上执行发现:程序总是停在如下Function 1的红色字体行i2c_wait(I2C0_B),进入这个函数内部,它实际上是停在while((p->S & I2C_S_IICIF_MASK)==0),一直等待传输完成的中断标志IICIF置位。

Function 1.

u8 hal_dev_mma8451_read_reg(u8 addr)

{

    u8 result;

    i2c_start(I2C0_B);

    i2c_write_byte(I2C0_B, I2C_ADDR_MMA8451 | I2C_WRITE);

    i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_write_byte(I2C0_B, addr);

    i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_repeated_start(I2C0_B);

    i2c_write_byte(I2C0_B, I2C_ADDR_MMA8451 | I2C_READ);

    i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_set_rx_mode(I2C0_B);

    i2c_give_nack(I2C0_B);

    result = i2c_read_byte(I2C0_B);

    i2c_wait(I2C0_B);

    i2c_stop(I2C0_B);

    result = i2c_read_byte(I2C0_B);

    pause();

    return result;

}

Function 2.

void i2c_wait(I2C_MemMapPtr p)

{

    while((p->S & I2C_S_IICIF_MASK)==0)  ; // wait flag

    p->S |= I2C_S_IICIF_MASK;    // clear flag

}

原因分析:

     初步判断可能是上一步数据的传输 i2c_write_byte()没有完成,导致IICIF未能被置位。于是通过示波器去捕捉这个过程,发现在执行 i2c_repeated_start(I2C0_B)时,KL25并没有产生一个 Repeat start信号。经过一番谷哥和度娘,终于在Kinetis L的Errata中找到了答案Repeat start cannot be generated if the I2Cx_F[MULT] field is set to a non-zero value. 这也就意味着,当 I2Cx_F[MULT]位被设置为非0值时,I2C Master不能产生一个Repeat start信号。而在应用程序的I2C初始化I2C_init()代码中, 我恰好设置I2Cx_F[MULT]=01,这正好是符合了Errata描述的错误产生的条件。

解决方案:

     I2C的C1寄存器中MULT位是I2C SCL时钟的倍乘因子,用于控制I2C的波特率。为解决上面的问题,FSL官方提供了两种workaround的办法:

1)如果repeat start必须产生时,配置 I2Cx_F[MULT]为0;

2)在置位 I2Cx_F register (I2Cx_C1[RSTA]=1)的Repeat START产生位之前临时设置 I2Cx_F [MULT],然后再在repeated start信号产生后恢复I2Cx_F [MULT]位的设置。

按照第一种方法,我修改程序中I2Cx_F[MULT]的设置从01到00,然后程序在FRDM-KL25Z 开发板上运行正常,能正常读取板载的加速度传感器MMA8451的数据。

2.问题描述: I2C单字节读取时序问题

问题提出:

在上面的Function 1中, KL25读取MMA8451的基本过程是:发送要访问的从机地址及对从机的写命令->发送要访问的从机的寄存器地址->发送Repeat Start信号到从机->发送要访问的从机地址及读命令->读取从机返回的数据,如下Figure1 MMA8451的单周期读时序图所示,其过程和上面代码的描述一致。但是有一点值得注意的是Figure 1中红色方框部分,按照Figure 1的表述,Master是在从Slave从机读取DATA[7:0]之后返回NAK信号的,用于指示本数据是Master要接收的最后一个DATA,最后发送stop signal终止数据的传送。按照这个思路得到的KL25的程序代码如下Section 2,它首先去读取从机返回的数据 i2c_read_byte(I2C0_B),然后发送NACK信号到从机i2c_give_nack(I2C0_B)。然而从KL25实际的物理时序的角度看,这个顺序是错误的,正确的应该是如下Section 1,应该在读取从机返回的数据 i2c_read_byte(I2C0_B)之前,首先发送NACK信号到从机i2c_give_nack(I2C0_B)。

Section 1.

  i2c_set_rx_mode(I2C0_B);

  i2c_give_nack(I2C0_B);----line1

  result = i2c_read_byte(I2C0_B);----line2

  i2c_wait(I2C0_B);----line3

  i2c_stop(I2C0_B);----line4

  result = i2c_read_byte(I2C0_B);----line5

Section 2.

  i2c_set_rx_mode(I2C0_B);

  result = i2c_read_byte(I2C0_B);-

  i2c_wait(I2C0_B);

  i2c_give_nack(I2C0_B);-

  i2c_stop(I2C0_B);

原因:

主机发送的NACK信号只有在下一个数据接收之后才会被push到总线上,KL25的RM手册中的描述为the No acknowledge signal is sent to the bus after the following receiving data byte (if FACK is cleared)。

具体分析:

按照两个时序分别做了一个测试,并用示波器捕捉了相应的波形:执行Section 1的代码得到的波形如下Figure 2所示,NACK(1)信号刚好在第9个pluse脉冲上升沿被push总线上,然后在Stop信号后总线处于idle状态(SCL和SDA均为高)。执行Section 2的代码得到的波形如下Figure 3所示,ACK(0)信号在第9个pluse脉冲上升沿被push总线上,说明后面还有数据要传输,一直处于等待MMA8451数据的再次传送中,这明显违背了读取单字节数据的原本意图。总之,KL的I2C应用中Section 1的代码操作顺序是正确的,实际的物理时序和 Figure 1的示意图时序是不一样的,这点需要特别注意。


Figure 1. MMA8451's 单周期读时序示意图

5712_5712.png8451.png

Figuire 2. Section 1 代码对应的时序

5714_5714.jpgIMG_20130816_140822.jpg

Figure 3. Section 2 代码对应的时序

5715_5715.jpgIMG_20130816_141117.jpg


为方便大家验证这些问题,我这里在附件中一并上传了K60的I2C的示例代码,KL25的示例代码,以及Kinetis L关于I2C的Errata。

——————————————————————————————————————————————————————————————————————

English Version:


     Recently, I migrate the K60’s I2C demo code to the KL25, but found it can't works when the same demo code runs on FRDM-KL25Z board while it runs well on the K60 board. After a painful struggling, I finally get the cause, so here I make a record, wish it could be helpful when other users happen to meet same problem.

  1. Repeat start can't be generated when configure I2Cx_F[MULT] to non-zero

     The K60’s demo( the attached 1) is to communicate with the onboard accelerometer MMA8451 by I2C, and in the demo it finish a data transmission by quering I2C’s flag bit. With almost same code, it always stops at below Function 1's red line i2c_wait(I2C0_B), also this function's defination is shown as below Function 2, it stops at while((p->S & I2C_S_IICIF_MASK)==0) to wait IICIF flag.


Function 1.

u8 hal_dev_mma8451_read_reg(u8 addr)

{

    u8 result;

    i2c_start(I2C0_B);

    i2c_write_byte(I2C0_B, I2C_ADDR_MMA8451 | I2C_WRITE);

    i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_write_byte(I2C0_B, addr);

   i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_repeated_start(I2C0_B);

    i2c_write_byte(I2C0_B, I2C_ADDR_MMA8451 | I2C_READ);

    i2c_wait(I2C0_B);

    i2c_get_ack(I2C0_B);

    i2c_set_rx_mode(I2C0_B);

    i2c_give_nack(I2C0_B);

    result = i2c_read_byte(I2C0_B);

    i2c_wait(I2C0_B);

    i2c_stop(I2C0_B);

    result = i2c_read_byte(I2C0_B);

    pause();

    return result;

}

Function 2.

void i2c_wait(I2C_MemMapPtr p)

{

    while((p->S & I2C_S_IICIF_MASK)==0)  ; // wait flag

    p->S |= I2C_S_IICIF_MASK;    // clear flag

}

     Then what's the matter? when I capture the I2C's wave form, found it didn't generate a Repeat start signal when excute i2c_repeated_start(I2C0_B);  After a struggle, In the Kinetis L's Errata do I find the answer: Repeat start cannot be generated if the I2Cx_F[MULT] field is set to a non-zero value. That means there is a bug in KL's design, if the I2Cx_F[MULT] field is set to a non-zero value, the I2C master can't generate a Repeat start signal. Coincidentally, in the I2C_init function I happen to set theI2Cx_F[MULT]=01, so it just meets the I2C's Errata.

     Considering the MULT bits define the multiplier factor mul. and  used along with the SCL divider to generate the I2C baud rate. In the Errata, FSL gives two possible workarounds:

1) Configure I2Cx_F[MULT] to zero if a repeat start has to be generated.

2) Temporarily set I2Cx_F [MULT] to zero immediately before setting the Repeat START bit in the I2C C1 register (I2Cx_C1[RSTA]=1) and restore the I2Cx_F [MULT] field to the original value after the repeated start has occurred.

To verify it easily, I revise the I2Cx_F[MULT] from 01 to 00. After that the same code runs well on FRDM-KL25Z board.


   2. The Timing Sequence Of I2C's single byte Reading


     In the above Function 1, there are a MMA8451 data read section like below after  Write Device Address->Write Register Address->Repeat Start->Write Device Address, and these steps is same as MMA8451's single byte read Timing Sequence requirment which is shown as below Figure 1. But referring to Figure 1, it looks like Section2 we should first excute below line2 to read the data, and then line1 give a nack  to suggest it's the last data, at last excute line4 to send a I2C stop signal. But unfortunately the idea is wrong, because in the phasical timing sequence the No acknowledge signal is sent to the bus after the following receiving data byte (if FACK is cleared) ,which means we need to give NACK signal before a read. And the captured wave form is like below Figure 2, you can find the NACK in the Ninth pluse, while the captured wave form is like below Figure 3 if excute Section 2 code instesd of Section 1 code, you can find the ACK in the Ninth pluse. it means the master will read another data, but the original intention is to read only one byte, so the I2C bus blocks. In a word, the section 1 code is right, the physical timing is different from the Figure 1's sketch map.

Section 1.

    i2c_set_rx_mode(I2C0_B);

    i2c_give_nack(I2C0_B);----line1

    result = i2c_read_byte(I2C0_B);----line2

    i2c_wait(I2C0_B);----line3

    i2c_stop(I2C0_B);----line4

    result = i2c_read_byte(I2C0_B);----line5

Section 2.

   i2c_set_rx_mode(I2C0_B);

   result = i2c_read_byte(I2C0_B);-

   i2c_wait(I2C0_B);

   i2c_give_nack(I2C0_B);-

   i2c_stop(I2C0_B);

Figure 1. MMA8451's single byte read Timing sketch map

5712_5712.png8451.png

Figuire 2. Section 1 code's Timing

5714_5714.jpgIMG_20130816_140822.jpg

Figure 3. Section 2 code's Timing

5715_5715.jpgIMG_20130816_141117.jpg

Labels (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1104860%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3EKL25%E7%9A%84I2C%E6%A8%A1%E5%9D%97%E8%B0%83%E8%AF%95%E7%9A%84%E4%B8%A4%E4%B8%AA%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%EF%BC%88Two%20tips%20in%20the%20debugging%20of%20KL25's%20I2C%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1104860%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Dutf-8%22%20%2F%26gt%3B%0A%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EChinese%20version%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EIn%20the%20official%20demo%20source%20code%20of%20KL25%2C%20there%20is%20only%20PE%20code%20of%20I2C%20driver%20but%20no%20baremental%20code%20of%20I2C%20driver.%20It%20is%20difficult%20for%20users%20who%20are%20not%20used%20to%20using%20PE%20to%20generate%20code%20to%20get%20started%20directly%2C%20so%20we%20considered%20porting%20the%20I2C%20baremental%20driver%20code%20of%20K60%20to%20KL25%20for%20your%20reference.%20However%2C%20we%20encountered%20two%20typical%20problems%20during%20the%20porting%20process%2C%20so%20we%20share%20them%20here%2C%20hoping%20to%20help%20users%20who%20encounter%20the%20same%20problem%20to%20quickly%20locate%20and%20solve%20the%20problem.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3ETest%20hardware%3A%20TWR-K60D100M%20development%20board%20K60%2BMMA8451%20(MMA8451%20is%20a%20three-axis%20acceleration%20sensor%2C%20connected%20to%20K60%20via%20I2C%20bus.%20K60%20acts%20as%20master%20and%20MMA8451%20acts%20as%20slave)%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20FRDM-KL25Z%E5%BC%80%E5%8F%91%E6%9D%BF%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20KL25%2BMMA8451%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EDevelopment%20environment%3A%20IAR%206.6%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3E1.%20Problem%20description%3A%20When%20the%20MULT%20bit%20of%20the%20I2Cx_F%20register%20is%20not%20set%20to%200%2C%20the%20Repeat%20start%20signal%20cannot%20be%20generated%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EThe%20function%20of%20the%20I2C%20demo%20in%20the%20K60%20sample%20code%20(see%20Appendix%201)%20is%20to%20read%20the%20data%20of%20the%20onboard%20acceleration%20sensor%20MMA8451%20through%20the%20I2C%20interface%2C%20and%20the%20I2C%20data%20control%20uses%20the%20method%20of%20querying%20the%20ACK%20flag.%20Running%20the%20demo%20on%20the%20TWR-K60D100M%20development%20board%20is%20normal.%20Using%20almost%20the%20same%20I2C%20driver%20code%2C%20it%20is%20found%20that%20the%20program%20always%20stops%20at%20the%20red%20font%20line%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ei2c_wait(I2C0_B)%3C%2FSPAN%3E%20of%20Function%201%20below.%20Entering%20this%20function%2C%20it%20actually%20stops%20at%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ewhile((p-%26gt%3BS%20%26amp%3B%20I2C_S_IICIF_MASK)%3D%3D0)%3C%2FSPAN%3E%20%2C%20waiting%20for%20the%20interrupt%20flag%20IICIF%20of%20the%20transmission%20completion%20to%20be%20set.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EFunction%201.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eu8%20hal_dev_mma8451_read_reg(u8%20addr)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20u8%20result%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_start(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20I2C_ADDR_MMA8451%20%7C%20I2C_WRITE)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20addr)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff00ff%3B%22%3Ei2c_repeated_start(I2C0_B)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20I2C_ADDR_MMA8451%20%7C%20I2C_READ)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ei2c_wait(I2C0_B)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3Ei2c_give_nack(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_stop(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pause()%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20return%20result%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7D%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%230000ff%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EFunction%202.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3Evoid%20i2c_wait(I2C_MemMapPtr%20p)%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3E%26nbsp%3B%20while((p-%26gt%3BS%20%26amp%3B%20I2C_S_IICIF_MASK)%3D%3D0)%26nbsp%3B%20%3B%20%2F%2F%20wait%20flag%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20p-%26gt%3BS%20%7C%3D%20I2C_S_IICIF_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20clear%20flag%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7D%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ECause%20Analysis%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EInitially%2C%20it%20was%20determined%20that%20the%20data%20transmission%20in%20the%20previous%20step%2C%20i2c_write_byte()%2C%20was%20not%20completed%2C%20resulting%20in%20IICIF%20not%20being%20set.%20So%20an%20oscilloscope%20was%20used%20to%20capture%20this%20process%20and%20it%20was%20found%20that%20when%20executing%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3EWhen%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff00ff%3B%22%3Ei2c_repeated_start(I2C0_B)%3C%2FSPAN%3E%20%2C%20KL25%20does%20not%20generate%20a%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3ERepeat%20start%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3Esignal.%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3EAfter%20searching%20Google%20and%20Baidu%2C%20I%20finally%20found%20the%20answer%20in%20Errata%20of%20Kinetis%20L%3C%2FSPAN%3E%20%3A%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2015px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3ERepeat%20start%20cannot%20be%20generated%20if%20the%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3EI2Cx_F%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%5BMULT%5D%20field%20is%20set%20to%20a%20non-zero%20value.%20This%20means%20that%20when%20the%20I2Cx_F%5BMULT%5D%20bit%20is%20set%20to%20a%20non-zero%20value%2C%20the%20I2C%20Master%20cannot%20generate%20a%20Repeat%20start%20signal.%20In%20the%20I2C%20initialization%20I2C_init()%20code%20of%20the%20application%2C%20I%20happened%20to%20set%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3EI2Cx_F%5BMULT%5D%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3D%2001%2C%20which%20just%20meets%20the%20error%20condition%20described%20by%20Errata.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESolution%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EThe%20MULT%20bit%20in%20the%20C1%20register%20of%20I2C%20is%20the%20multiplication%20factor%20of%20the%20I2C%20SCL%20clock%2C%20which%20is%20used%20to%20control%20the%20baud%20rate%20of%20I2C.%20To%20solve%20the%20above%20problem%2C%20FSL%20officially%20provides%20two%20workarounds%3A%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E1)%20If%20repeat%20start%20must%20be%20generated%2C%20configure%20I2Cx_F%5BMULT%5D%20to%200%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E2)%20Temporarily%20set%20I2Cx_F%20%5BMULT%5D%20before%20setting%20the%20Repeat%20START%20bit%20in%20the%20I2Cx_F%20register%20(I2Cx_C1%5BRSTA%5D%3D1)%2C%20and%20then%20restore%20the%20setting%20of%20the%20I2Cx_F%20%5BMULT%5D%20bit%20after%20the%20repeated%20start%20signal%20is%20generated.%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EAccording%20to%20the%20first%20method%2C%20I%20modified%20the%20setting%20of%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2015px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3EI2Cx_F%5BMULT%5D%3C%2FSPAN%3E%20in%20the%20program%20from%2001%20to%2000%2C%20and%20then%20the%20program%20ran%20normally%20on%20the%20FRDM-KL25Z%20development%20board%20and%20could%20read%20the%20data%20of%20the%20onboard%20accelerometer%20MMA8451%20normally.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3E2.%20Problem%20description%3A%20I2C%20single%20byte%20read%20timing%20problem%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EIn%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3EFunction%201%3C%2FSPAN%3E%20above%2C%20the%20basic%20process%20of%20KL25%20reading%20MMA8451%20is%3A%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Esend%20the%20slave%20address%20to%20be%20accessed%20and%20the%20write%20command%20to%20the%20slave%20-%26gt%3B%20send%20the%20register%20address%20of%20the%20slave%20to%20be%20accessed%20-%26gt%3B%20send%20the%20Repeat%20Start%20signal%20to%20the%20slave%20-%26gt%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3Esend%20the%20slave%20address%20to%20be%20accessed%20and%20the%20read%20command%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E-%26gt%3B%20read%20the%20data%20returned%20by%20the%20slave%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%20%2C%20as%20shown%20in%20Figure%201%2C%20the%20single-cycle%20read%20timing%20diagram%20of%20MMA8451.%20The%20process%20is%20consistent%20with%20the%20description%20of%20the%20above%20code.%20However%2C%20one%20thing%20worth%20noting%20is%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ethe%20red%20box%20part%3C%2FSPAN%3E%20in%20Figure%201.%20According%20to%20the%20description%20of%20Figure%201%2C%20the%20Master%20returns%20the%20NAK%20signal%20after%20reading%20DATA%5B7%3A0%5D%20from%20the%20Slave%20slave%2C%20which%20is%20used%20to%20indicate%20that%20this%20data%20is%20the%20last%20DATA%20to%20be%20received%20by%20the%20Master%2C%20and%20finally%20sends%20the%20stop%20signal%20to%20terminate%20the%20data%20transmission.%20The%20program%20code%20of%20KL25%20obtained%20according%20to%20this%20idea%20is%20as%20follows%20Section%202.%20It%20first%20reads%20the%20data%20returned%20by%20the%20slave%20i2c_read_byte(I2C0_B)%2C%20and%20then%20sends%20the%20NACK%20signal%20to%20the%20slave%20i2c_give_nack(I2C0_B).%20However%2C%20from%20the%20perspective%20of%20the%20actual%20physical%20timing%20of%20KL25%2C%20this%20order%20is%20wrong.%20The%20correct%20order%20should%20be%20as%20follows%20Section%201.%20Before%20reading%20the%20data%20returned%20by%20the%20slave%20i2c_read_byte(I2C0_B)%2C%20the%20NACK%20signal%20should%20be%20sent%20to%20the%20slave%20i2c_give_nack(I2C0_B)%20first.%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%230000ff%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESection%201.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_give_nack(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline1%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline2%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_wait(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline3%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_stop(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline4%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline5%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%230000ff%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESection%202.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B-%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3Ei2c_give_nack(I2C0_B)%3B-%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20i2c_stop(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3Ereason%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%E4%B8%BB%E6%9C%BA%E5%8F%91%E9%80%81%E7%9A%84NACK%E4%BF%A1%E5%8F%B7%E5%8F%AA%E6%9C%89%E5%9C%A8%E4%B8%8B%E4%B8%80%E4%B8%AA%E6%95%B0%E6%8D%AE%E6%8E%A5%E6%94%B6%E4%B9%8B%E5%90%8E%E6%89%8D%E4%BC%9A%E8%A2%ABpush%E5%88%B0%E6%80%BB%E7%BA%BF%E4%B8%8A%EF%BC%8CKL25%E7%9A%84RM%E6%89%8B%E5%86%8C%E4%B8%AD%E7%9A%84%E6%8F%8F%E8%BF%B0%E4%B8%BAthe%20No%20acknowledge%20signal%20is%20sent%20to%20the%20bus%20after%20the%20following%20receiving%20data%20byte%20(if%20FACK%20is%20cleared)%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESpecific%20analysis%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EA%20test%20was%20conducted%20according%20to%20the%20two%20timings%2C%20and%20the%20corresponding%20waveforms%20were%20captured%20with%20an%20oscilloscope%3A%20The%20waveform%20obtained%20by%20executing%20the%20code%20in%20Section%201%20is%20shown%20in%20Figure%202%20below.%20The%20NACK%20(1)%20signal%20is%20pushed%20on%20the%20bus%20at%20the%20rising%20edge%20of%20the%209th%20pluse%20pulse%2C%20and%20then%20the%20bus%20is%20in%20an%20idle%20state%20after%20the%20Stop%20signal%20(both%20SCL%20and%20SDA%20are%20high).%20The%20waveform%20obtained%20by%20executing%20the%20code%20in%20Section%202%20is%20shown%20in%20Figure%203%20below.%20The%20ACK%20(0)%20signal%20is%20pushed%20on%20the%20bus%20at%20the%20rising%20edge%20of%20the%209th%20pluse%20pulse%2C%20indicating%20that%20there%20is%20still%20data%20to%20be%20transmitted%2C%20and%20it%20is%20always%20waiting%20for%20the%20MMA8451%20data%20to%20be%20transmitted%20again%2C%20which%20obviously%20violates%20the%20original%20intention%20of%20reading%20single-byte%20data.%20In%20short%2C%20the%20code%20operation%20sequence%20of%20Section%201%20in%20KL's%20I2C%20application%20is%20correct%2C%20and%20the%20actual%20physical%20timing%20is%20different%20from%20the%20timing%20of%20the%20schematic%20diagram%20in%20Figure%201%2C%20which%20requires%20special%20attention.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFigure%201.%20MMA8451's%20single%20cycle%20read%20timing%20diagram%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225712_5712.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225712_5712.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117231i8F04214B716D172F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225712_5712.png%22%20alt%3D%225712_5712.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%228451.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%228451.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42917i4448A8FC875D8C9D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%228451.png%22%20alt%3D%228451.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFiguire%202.%20Timing%20of%20Section%201%20code%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225714_5714.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225714_5714.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117232iD079D569D1FC032C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225714_5714.jpg%22%20alt%3D%225714_5714.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_140822.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_140822.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42940iCD358CC469ED372F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IMG_20130816_140822.jpg%22%20alt%3D%22IMG_20130816_140822.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFigure%203.%20Timing%20of%20Section%202%20code%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225715_5715.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225715_5715.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117233iFE3D169CD7B83678%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225715_5715.jpg%22%20alt%3D%225715_5715.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_141117.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_141117.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42939i3C35A4D763864A12%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IMG_20130816_141117.jpg%22%20alt%3D%22IMG_20130816_141117.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3ETo%20help%20you%20verify%20these%20issues%2C%20I%20have%20uploaded%20the%20K60%20I2C%20sample%20code%2C%20the%20KL25%20sample%20code%2C%20and%20the%20Kinetis%20L%20I2C%20Errata%20in%20the%20attachment.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E2%80%94%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2015px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3EEnglish%20Version%EF%BC%9A%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Recently%2C%20I%20migrate%20the%20K60%E2%80%99s%20I2C%20demo%20code%20to%20the%20KL25%2C%20but%20found%20it%20can't%20works%20when%20the%20same%20demo%20code%20runs%20on%20FRDM-KL25Z%20board%20while%20it%20runs%20well%20on%20the%20K60%20board.%20After%20a%20painful%20struggling%2C%20I%20finally%20get%20the%20cause%2C%20so%20here%20I%20make%20a%20record%2C%20wish%20it%20could%20be%20helpful%20when%20other%20users%20happen%20to%20meet%20same%20problem.%3C%2FP%3E%3COL%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CLI%3ERepeat%20start%20can't%20be%20generated%20when%20configure%20I2Cx_F%5BMULT%5D%20to%20non-zero%3C%2FLI%3E%3C%2FOL%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20K60%E2%80%99s%20demo(%20the%20attached%201)%20is%20to%20communicate%20with%20the%20onboard%20accelerometer%20MMA8451%20by%20I2C%2C%20and%20in%20the%20demo%20it%20finish%20a%20data%20transmission%20by%20quering%20I2C%E2%80%99s%20flag%20bit.%20With%20almost%20same%20code%2C%20it%20always%20stops%20at%20below%20Function%201's%20red%20lin%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23575757%3B%22%3Ee%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23575757%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ei2c_wait(I2C0_B)%3C%2FSPAN%3E%2C%20also%20this%20function's%20defination%20is%20shown%20as%20below%20Function%202%2C%20it%20stops%20at%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3E%20while((p-%26gt%3BS%20%26amp%3B%20I2C_S_IICIF_MASK)%3D%3D0)%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eto%20wait%20IICIF%20flag.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3EFunction%201.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eu8%20hal_dev_mma8451_read_reg(u8%20addr)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20u8%20result%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_start(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20I2C_ADDR_MMA8451%20%7C%20I2C_WRITE)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20addr)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Ei2c_wait(I2C0_B)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff00ff%3B%22%3Ei2c_repeated_start(I2C0_B)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_write_byte(I2C0_B%2C%20I2C_ADDR_MMA8451%20%7C%20I2C_READ)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Ei2c_wait(I2C0_B)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_get_ack(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3Ei2c_give_nack(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_stop(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pause()%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20return%20result%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7D%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3EFunction%202.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Evoid%20i2c_wait(I2C_MemMapPtr%20p)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3E%26nbsp%3B%20while((p-%26gt%3BS%20%26amp%3B%20I2C_S_IICIF_MASK)%3D%3D0)%26nbsp%3B%20%3B%20%2F%2F%20wait%20flag%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20p-%26gt%3BS%20%7C%3D%20I2C_S_IICIF_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20clear%20flag%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%7D%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Then%20what's%20the%20matter%3F%20when%20I%20capture%20the%20I2C's%20wave%20form%2C%20found%20it%20didn't%20generate%20a%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3ERepeat%20start%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Esignal%20when%20excute%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff00ff%3B%22%3Ei2c_repeated_start(I2C0_B)%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%3B%26nbsp%3B%20After%20a%20struggle%2C%20In%20the%20Kinetis%20L's%20Errata%20do%20I%20find%20the%20answer%3A%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3ERepeat%20start%20cannot%20be%20generated%20if%20the%20I2Cx_F%5BMULT%5D%20field%20is%20set%20to%20a%20non-zero%20value%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E.%20That%20means%20there%20is%20a%20bug%20in%20KL's%20design%2C%20if%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%22%3Ethe%20I2Cx_F%5BMULT%5D%20field%20is%20set%20to%20a%20non-zero%20value%2C%20the%20I2C%20master%20can't%20generate%20a%20Repeat%20start%20signa%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23575757%3B%22%3El.%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23575757%3B%22%3ECoincidentally%2C%20in%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23575757%3B%22%3Ethe%20I2C_%3C%2FSPAN%3Einit%20function%20I%20happen%20to%20set%20the%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23ff0000%3B%22%3EI2Cx_F%5BMULT%5D%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%3D01%2C%20so%20it%20just%20meets%20the%20I2C's%20Errata.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Considering%20the%20MULT%20bits%20define%20the%20multiplier%20factor%20mul.%20and%26nbsp%3B%20used%20along%20with%20the%20SCL%20divider%20to%20generate%20the%20I2C%20baud%20rate.%20In%20the%20Errata%2C%20FSL%20gives%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Etwo%20possible%20workarounds%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E1)%20Configure%20I2Cx_F%5BMULT%5D%20to%20zero%20if%20a%20repeat%20start%20has%20to%20be%20generated.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E2)%20Temporarily%20set%20I2Cx_F%20%5BMULT%5D%20to%20zero%20immediately%20before%20setting%20the%20Repeat%20START%20bit%20in%20the%20I2C%20C1%20register%20(I2Cx_C1%5BRSTA%5D%3D1)%20and%20restore%20the%20I2Cx_F%20%5BMULT%5D%20field%20to%20the%20original%20value%20after%20the%20repeated%20start%20has%20occurred.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3ETo%20verify%20it%20easily%2C%20I%20revise%20the%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20color%3A%20%23ff0000%3B%22%3EI2Cx_F%5BMULT%5D%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3Efrom%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011pt%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E0%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E1%20to%2000.%20After%20that%20the%20same%20code%20runs%20well%20on%20FRDM-KL25Z%20board.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2014.545454025268555px%3B%20font-family%3A%20Calibri%2C%20sans-serif%3B%20color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%202.%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EThe%20Timing%20Sequence%20Of%20%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2014.545454025268555px%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EI2C's%20single%20byte%20Reading%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2014.545454025268555px%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20In%20the%20above%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%230000ff%3B%22%3EFunction%201%3C%2FSPAN%3E%2C%20there%20are%20a%20MMA8451%20data%20read%20section%20like%20below%20after%26nbsp%3B%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3EWrite%20Device%20Address-%26gt%3BWrite%20Register%20Address-%26gt%3BRepeat%20Start-%26gt%3BWrite%20Device%20Address%2C%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eand%20these%20steps%20is%20same%20as%20MMA8451's%20single%20byte%20read%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3ETiming%20Sequence%20requirment%20which%20is%20shown%20as%20below%20Figure%201.%20But%20referring%20to%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3EFigure%201%3C%2FSPAN%3E%2C%20it%20looks%20like%20Section2%20we%20should%20first%20excute%20below%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3E%20line2%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eto%20read%20the%20data%2C%20and%20then%3C%2FSPAN%3E%20line1%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Egive%20a%20nack%26nbsp%3B%20to%20suggest%20it's%20the%20last%20data%2C%20at%20last%20excute%20%3C%2FSPAN%3Eline4%20t%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Eo%20send%20a%20I2C%20stop%20signal%3C%2FSPAN%3E.%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3E%20But%20unfortunately%20the%20idea%20is%20wrong%2C%20because%20in%20the%20phasical%20timing%20sequence%20the%20No%20acknowledge%20signal%20is%20sent%20to%20the%20bus%20after%20the%20following%20receiving%20data%20byte%20(if%20FACK%20is%20cleared)%20%2Cwhich%20means%20we%20need%20to%20give%20NACK%20signal%20before%20a%20read.%20And%20the%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3Ecaptured%3C%2FSPAN%3E%20wave%20form%20is%20like%20below%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3EFigure%202%3C%2FSPAN%3E%2C%20you%20can%20find%20the%20NACK%20in%20the%20Ninth%20pluse%2C%20while%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3Ethe%20captured%20wave%20form%20is%20like%20below%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3EFigure%203%3C%2FSPAN%3E%20if%20excute%20Section%202%20code%20instesd%20of%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3ESection%201%20code%3C%2FSPAN%3E%2C%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3Eyou%20can%20find%20the%20ACK%20in%20the%20Ninth%20pluse.%20it%20means%20the%20master%20will%20read%20another%20data%2C%20but%20the%20original%20intention%20is%20to%20read%20only%20one%20byte%2C%20so%20the%20I2C%20bus%20blocks.%20In%20a%20word%2C%20the%20section%201%20code%20is%20right%2C%20the%20physical%20timing%20is%20different%20from%20the%20Figure%201's%20sketch%20map.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%230000ff%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESection%201.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_give_nack(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline1%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline2%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline3%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20i2c_stop(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline4%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B----%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23ff0000%3B%22%3Eline5%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%230000ff%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3ESection%202.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%20i2c_set_rx_mode(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%20result%20%3D%20i2c_read_byte(I2C0_B)%3B-%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%20i2c_wait(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3Ei2c_give_nack(I2C0_B)%3B-%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%20i2c_stop(I2C0_B)%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFigure%201.%20MMA8451's%20single%20byte%20read%20Timing%20%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%23000000%3B%22%3Esketch%20map%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225712_5712.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225712_5712.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117234iA7B0931EC340172C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225712_5712.png%22%20alt%3D%225712_5712.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%228451.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%228451.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42941i53D0F3E3C4768E02%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%228451.png%22%20alt%3D%228451.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFiguire%202.%20Section%201%20code's%20Timing%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225714_5714.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225714_5714.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117235i80FD6ABD1F7D50D7%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225714_5714.jpg%22%20alt%3D%225714_5714.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_140822.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_140822.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42940iCD358CC469ED372F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IMG_20130816_140822.jpg%22%20alt%3D%22IMG_20130816_140822.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EFigure%203.%20Section%202%20code's%20Timing%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225715_5715.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225715_5715.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117236iBAF38EF5EAE7C943%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225715_5715.jpg%22%20alt%3D%225715_5715.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_141117.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_20130816_141117.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42939i3C35A4D763864A12%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IMG_20130816_141117.jpg%22%20alt%3D%22IMG_20130816_141117.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1104860%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EKinetis%20K%20Series%20MCUs%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎03-02-2014 06:52 PM
Updated by: