I am trying to use I2C module in PIC 18F4520 but I got some troubles. I can not produce a 100kHz pulse on SCL pin of the PIC. I use MPLAB C18 and its standard library to program.
This is the function from i2c.h: OpenI2C(MASTER,SLEW_OFF); (Config I2C Mode Master, Clock 100Khz). However, when I use osciloscope to measure the frequency of the pulse on SCL, it generates a nearly 500kHz on this pin.
Can anyone help me? Thanks
Thank you for your help but I have tried that way and it still did not work. When I demo the circuit by Proteus, it only runs in write process but can not receive data from ds1307. Here is a part of my code for this, can you read and comment?