From: "PicDude" > Well, I got my code working properly now. Your NACK routine helped me figure > it out. Thanks again. I wrote page-write code for specific Mchip and Atmel Is there much of difference between them? I haven't played with this stuff since early this spring so I'm a bit rusty on the details. > Serial EEPROM's which both work properly with 4.7k pullups (@ ~100khz), What clock speed are you using for the PIC? > though I expect in an actual project, I'll use some smaller values. > > Absolutely agree about the logic analyzer -- I would've given yet another arm > and leg for one while debugging, but I ended up using a very very primitive > logic analyzer -- I changed the oscillator to external RC osc and slowed it > down to about 20 hz (yep -- Hz, not khz). Add a couple buffered LED's to the > SDA and SCL lines, a pencil and paper in hand, and I got a true logic > analyzer plot! :-) Yep, the no minimum clock speed thingy is nice sometimes. When I was a lad, I clocked my COSMAC ELF (1802 processor) with a 555 timer circuit. With an LED to "see" the clock signal, I verified that a machine cycle really did take exactly 8 clock cycles. And it did every time, exactly! ;-) > BTW, I found out that MPLAB SIM has a logic analyzer plot, but it's not very > effective when trying to measure what's happening on a line that gets > pulled-up/down by various external components, and temporarily changing the > code to high or low outputs can only indicate so much without changing the > timing. I have to admit that I really don't use the simulator. It's just another big bunch of quirks to keep track of, so I don't bother. There's a simulator for Linux and I hear it's pretty good, but I don't personally know. I typically use an LCD display on my projects for debugging. Serial comms is also handy, but the most useful debugging aid is probably an LED. Well, after the scope anyway. > Rather than getting a large desktop analyzer off ebay or so, I came up with an > idea to build a simple logic analyzer, but haven't had the time to implement > it yet -- that'll be another discussion later. Need to spend some time > implementing the Serial EE code into an application first. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist