SDA and SCL pin must be pull-up with resistors... as in the manual.
The code example in the manual should work AS-IS
SDA and SCL pin must be pull-up with resistors... as in the manual.
The code example in the manual should work AS-IS
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I think I tried that last night - but could have done wrong.
But when I had placed a 24C on my breadboard - it worked.
But when I got 3 connectors to the circuit board with 24C on it, it did not work. However, I shall try that tonight once my classes are over.
But I may sound stupid - till now I do not understand what pull-up means. I shall attach the 4.7k resistors (or other value ?). Only know that resistors are needed to pull-up(?) to program i2c.
Shall post my result of this.
Thanks
Aftab.
Pull up....
On signal lines that can be connected to more than one device (in this case I2C's SCK and SDA), the signals aren't powered directly by any of the chips, but by power and the pullup resistors. The various devices can only apply a ground to the signal line. If no devices on the bus are applying a ground, the line stays high (logic 1, at near power supply voltage). If there are multiple devices on the bus, and any one of them applies a ground, the entire signal line drops to ground (logic 0).
If you had each chip holding the signal lines high, and one of them tried to make the signal line a low (logic 0), the other chips would either overpower it, or you'd end up with a lot of smoke in the room
Same thing goes for a pull down, but the other way in reverse.
Most of the time, the terms 'pullup' and 'pulldown' aren't so complicated. A pullup just means a high-ish value (4.7K, 10K, etc) resistor between Pin X (or whatever) and the positive supply rail. Conversely for the pull down, a resistor between Pin X and the ground rail.
Jeeze...finally. I've been a bit off on explanations/corrections/help/etc for a few weeks now. It's about time I got something right. (my 'lab' is under reconstruction due to exterior water intrusion, read that as flooded out...I haven't programmed a PIC in over 2 months!!!). I think I'm suffering from withdrawl...
Anyways...get those resistors fitted and let us know what happens...
Hi,
It worked with the resistors connected. I tried different combination of resistors 1.5,2.2 .. 15k. You guys are correct.
However, the separate circuit board -- the one that I connect with 3 wires when I program it using Olimex JDM board & ponyprog on PC- does not work with the stand alone 16f84. Ponyprog uses i2c commands like start,..write...stop. The source code for ponyprog 1 is available, but not for version 2. And interestingly ICprog does not work with 24CX but it can program the 16f84a.
---|............................|------
PC.|--------JDM------->|24CXX
.....|--------board----->|on a circuit
---|--------ICSP------->|board
I shall try to get an idea by connecting a dataq data logger and see what happens to voltages across the three wires.
If you have a look at the olimex JDM board, there is a led onboard that lits up while reading/writing. While writing to 24CX with ponyprog the led is brighter than when I tried to prgram with ICprog. It means ponyprog can drive the voltage higher - perhaps by repeated/delayed pulse sending to the JDM board; and ICprog cannot do that(chaning the delay in ICprog did not help).
I shall post my results of datag logging - provided I can do that.
Is there a way to attach picture with messages ?
cheers.
Aftab.
Yes just click on 'manage attachment' and upload your files.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks