I have a circuit on a PCB where I am using PIC microcontroller to connect with DS1307 via I2C. I am having trouble while programming it so I am planning to purchase a logic analyzer so that I can see what is the actual data sent or received in I2C lines. But the problem is as I am newbie to logic analyzer, I really don't have any idea about how to use them. I know i'll have to connect the wires to the line but as I have a PCB so I don't know where should I connect those wires. Can anyone here please help me out.Thanks
As far as locating where to connect the logic analyzer it is between you and the PCB. Without you posting schematics and board files.
To analyze I2C there are 3 connections that need made. The data line, the clock line and ground. In the logic analyzer software you will designate where the clock and data lines are hooked up. Finally using the software record a window of data. Once the recording is complete the software will display you what was captured. The software will decode the data if any is available and display it as either hexadecimal or decimal.
For I2C I wouldn't bother with a logic analyzer, there are only 2 signals to worry about, so if a scope is familiar to you, just use a scope.
If it's a digital scope you can capture a transaction and examine it - some may even have software to decode I2C but the protocol is simple enough you can do it by eye. But use a logic analyzer if you prefer.
As for where to connect the signals, I tend to solder little wire hooks or loops to the PCB - perhaps the I2C termination resistors are more accessible than IC pins.
This makes clipping scope or analyzer probes to the signals MUCH easier and safer than trying to hold them on by hand while adjusting scope knobs and writing notes with the other. You can get at least four wire hooks from a through-hole resistor, so the cost is irrelevant...