I2C Eeprom free clocking

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C Eeprom free clocking

2,546 次查看
MdeJong
Contributor I
Hello all,
 
After getting the second I2C bus working on the MCF5251 (the port configuration was wrong).
I have a new problem:
 
For error handling with EEPROMs the appliction note says, to generate 9 start sequences followed by one stop sequence.
 
To generate this sequence I have tried following code:
 
Code:
        MBAR2_MBCR = MBCR_MTX | MBCR_IEN;            MBAR2_MBCR |=  MBCR_MSTA;                /* generate start */        for (loop = 0; loop < 8; loop++)        {            MBAR2_MBCR |=  MBCR_RSTA;            /* generate restart */        }                MBAR2_MBCR &= ~MBCR_MSTA;                /* generate stop */        MBAR2_MBCR = 0;        MBAR2_MBCR = MBAR2_MBCR | MBCR_IEN;

 
It works when I single step through it, but not when running real-time, what am I doing wrong.
 
 
Regands Mark,
标签 (1)
0 项奖励
回复
1 回复

1,769 次查看
admin
Specialist II
Generating a START condition takes time. You cannot reasonably expect to set the RSTA bit 9 times in a row in a quick succession and have 9 START conditions on the bus with proper timing. You must have some sort of delay between the consecutive START conditions.
0 项奖励
回复