This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interfacing code for 89C51 to PCF 8574 to interface LCD in 4bit

hey,
can some1 help me to interface PCF 8574 with 89c51 using I2C bus for interfacing LCD in four but mode please..
its for my final year project it will help me alot if
any1 can help me out for the code..
coz im not able 2 get it done.. i dont understand
it actually..

Parents
  • Sir im using I2C expander pcf 8574
    so im connecting it to the sda and scl
    line to my uC.
    then im confused abt should i send
    the data during the sda line is high right???
    in the routine i messaged in my earlier post??
    tats the problem im not able 2 get..
    my tutor is of no help he just wants to see
    the progress in my work..
    Everything has 2 be done by us he will just
    see weekly updates tat how we are doing n all
    tats abt it..

Reply
  • Sir im using I2C expander pcf 8574
    so im connecting it to the sda and scl
    line to my uC.
    then im confused abt should i send
    the data during the sda line is high right???
    in the routine i messaged in my earlier post??
    tats the problem im not able 2 get..
    my tutor is of no help he just wants to see
    the progress in my work..
    Everything has 2 be done by us he will just
    see weekly updates tat how we are doing n all
    tats abt it..

Children
  • "the data during the sda line is high right???"

    Obviously, to send data you have to select if the sda line is high or low. If you always keep sda high, you will obviously only send high data.

    It is the clock line that represents time, so you have to think about the state of the clock signal when you send your data.

    But the above should be absolutely clear if you did search for the excellent descriptions of I2C that are available on the NXP web site. Your confusion only indicates that you have not spent time reading up on I2C. Your tutor wants weakly progress reports. But that indicates that weeks are passing by. Think about how much time you have to read about I2C in one week...

    You see, we can't help you with the I2C unless you read yourself. Whatever we write here will not be able to match the documentation NXP already have available. They have spent weeks or months on writing high-quality documentation, so if we spend hours trying to describe (summarize) the I2C functionality, we would end up with a way worse description. And without all the nice illustrations showing the timing relationship between the data and the clock signals, and describing the different states that makes it possible to not just send data to the chip (as in a shift register with clock + data) but how you synchronizes with the chip (as in getting the two lines to also represent a reset/clear signal).

    You have to realize something: Your tutor might actually be very helpful. But only if you can focus enough to ask him/her specific questions about problems that you have pinpointed and where you can show that you have really cornedred the problem - spent enough time hunting for solutions on your own but found multiple possible interpretations where you fail to figure out which interpretation that is correct.

    Your tutor is not interested in you asking wild-card questions: How do I get I2C to work? Why? Because that quastion was one of the main tasks for you to find out about yourself. Answering that question would be the same as handing over an already working solution to you and then ask you to directly hand it back in as your work. Aswering the wild-card questions you are asking on this forum would be the same as letting you skip your assignment. Letting students skip their assignments would be cause for firing the tutor.

  • "But the above should be absolutely clear if you did search for the excellent descriptions of I2C that are available on the NXP web site"

    Not least of which is the PCF8574 Datasheet itself!

    This provides a very clear description of how to drive the I2C interface to this device - complete with timing diagrams to illustrate it.

    In fact, this is probably one of the best documents to start with for an introduction to I2C - without all the complications of the full specification (which is available for free download from the NXP site)

    The PCF8574 is a very well-established, popular device - there must be plenty of examples available for you to look at!