Pic32 I2c Collision

Status
Not open for further replies.

Makaram

Member
Hey,
I'm getting a Master bus collision occurring AFTER I send my first byte, so

Code:
    if(I2CSendByte(EEPROM_I2C_BUS, data) == I2C_MASTER_BUS_COLLISION)
    {
        write("Error: I2C Master Bus Collision\n");
        return FALSE;
    }
else
********* CODE reaches else statement **********************

the 'if' statement returns false meaning no bus collision occurs here, its slightly after.
I'm assuming that this is occuring during the ACK from the slave. If so, what is possibly causing this and how do I get around it?
This is my first time with I2C, so I'm oblivious to its intricacies.

This is the flag I2C3STATbits.BCL
Thanks
 
Have you got the pullup resistors in place? It seems wierd that the collision is on the first byte..

What are you writing to? Remember that the Eeproms need a 5mS working space..
 
Hi thanks for replying.
I've got 1k ohm pull ups to 2.8v to cmos camera, found at sparkfun.
I did it particularly strange that the whole first byte sends without error.
Just to make sure, I want my pins set as inputs right?
 
Yes! I need to look at that cmos camera.... I have the RS232 version... I haven't employed I2C on the Pic32 yet.
 
For any poor unfortunate soul who happens to discover this poorly documented camera in the future. Please Note, RESET is active LOW.
 
For any poor unfortunate soul who happens to discover this poorly documented camera in the future. Please Note, RESET is active LOW.

Good point for beginners. Reset is almost always active low in every device or chip that has reset.
 
While I knew that, I seem to remember coming across something that led me to believe it to be active high, in the data sheet
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…