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

multi slave in I2C bus

Please help me at C code for reading time from DS1407 on I2C bus.I am able to R/W data to an EEPROM on the same bus.But when i read the time i get 0xffff for hrs,mins and secs even after initializing the RTC chip.

Parents
  • "... i bring the clock rate from 400 kHz to 100 kHz by setting the appropriate value in SSPADDR register ..."

    Your code is for a Microchip PIC. Since Keil does not provide PIC development tools, this forum is not the place to be posting. You need to take this discussion to the Microchip forum or your compiler vendor's forum. And when you do take it there, please add what oscillator frequency you are running the PIC at (from SSPADD=0x28, I assume it's 16MHz) and you need to show the code for start(), write(), restart(), check_idle(), and stop().

Reply
  • "... i bring the clock rate from 400 kHz to 100 kHz by setting the appropriate value in SSPADDR register ..."

    Your code is for a Microchip PIC. Since Keil does not provide PIC development tools, this forum is not the place to be posting. You need to take this discussion to the Microchip forum or your compiler vendor's forum. And when you do take it there, please add what oscillator frequency you are running the PIC at (from SSPADD=0x28, I assume it's 16MHz) and you need to show the code for start(), write(), restart(), check_idle(), and stop().

Children
  • Your code is for a Microchip PIC

    Thank you so much Mr Henry

    A lot of thanks for your co-operation. Indeed i knew that. But i was so ponder with the mistake and i wanted some body to analise. Some of your questionnaire led me to review the hardware and i took the RTC segment to a separate board other than my working mother board which comprise of few more devices like EEPROM and shift registers. Now i con able to communicate with DS1307 and can reed the subsequent registers as well. But as you know still there is more to do. I will let you know the further growth definitely.

    Thanks again.

  • Thanks Mr Henry

    Now its working fine. I hope I'll always find you there in my trouble.

    Thank you again