yviswanathbe
Full Member level 4
Hi,
I want to interface PCF8574 I2C GPIO Expander with 89C52 micro controller.
My application is to interface 20x4 Character LCD and 4x4 Matrix Keypad with the 89C52 micro controller using I2C.
Before connecting LCD and KEYPAD, i am just trying to toggle LED.
I have connected the PCF8574 to the 89C52 with two GPIO's and LED is connected to the PCF8574.
I am using Bit banging as the 89C52 doesn't supports I2C.
But i am not able to communicate with the PCF8574.
I am simulating in Proteus. I have attached the Source code and Proteus File.
Can somebody please suggest me what is the mistake i am doing.
Thanks and Regards,
Viswanath
- - - Updated - - -
Hi,
I got solved my problem.
The bug is in I2C Functions send_byte and Receive_byte, i have declared a variable with XDATA.
I have removed this and my code is working fine.
Can somebody tell me the reason why when a variable declared with XDATA did not work.
Now i will try connecting the KEYPAD and LCD.
Thanks and Regards,
Viswanath.
I want to interface PCF8574 I2C GPIO Expander with 89C52 micro controller.
My application is to interface 20x4 Character LCD and 4x4 Matrix Keypad with the 89C52 micro controller using I2C.
Before connecting LCD and KEYPAD, i am just trying to toggle LED.
I have connected the PCF8574 to the 89C52 with two GPIO's and LED is connected to the PCF8574.
I am using Bit banging as the 89C52 doesn't supports I2C.
But i am not able to communicate with the PCF8574.
I am simulating in Proteus. I have attached the Source code and Proteus File.
Can somebody please suggest me what is the mistake i am doing.
Thanks and Regards,
Viswanath
- - - Updated - - -
Hi,
I got solved my problem.
The bug is in I2C Functions send_byte and Receive_byte, i have declared a variable with XDATA.
I have removed this and my code is working fine.
Can somebody tell me the reason why when a variable declared with XDATA did not work.
Now i will try connecting the KEYPAD and LCD.
Thanks and Regards,
Viswanath.