Daniel Bruggmann Gisler

IIC HELP!!!

Discussion created by Daniel Bruggmann Gisler on Dec 12, 2010
Latest reply on Dec 18, 2010 by kef

Hi,
I have a problem whith my IIC routine, I checked the routine about 10
times, let it check by friend and nobody figures out where the problem
is.

I will call form the main code the Init_I2C, and then I will call
IIC_write, this code should place on the bus the device address, the
memory address and the data, the I2C_read should place on the bus the
device address the memory address, restart and read the data.

Whats happening is that when i try to write, the bus is doing a logic
change, it goes from hi to low and stays there until reset.
no clk is generated, some times it gets stocked on the flag checking.
When I read, when its not get stocked it returns a value that is
completly wrong.

Please help me whit this situation.

I attach the iic c file


thanks very much, Daniel

Outcomes