PDA

View Full Version : I2CWrite issue



robertmark68
- 19th September 2006, 18:49
Please forgive me if this query is in the wrong section....

I have a 16F877A setup to talk via I2C to THREE AD5282 Digital Potentiometers.

These devices have 2 Address lines AD0,AD1 that i have set to unique values.

My SDA & SCL lines are pulled-up through 4.7K resistors.

Here is my issue.

I have my code setup to write a value to one of my digipots...which it does successfully!

However when I try to write to another the value CHANGES on the digipot i just wrote too!!!

This what i have observed....

When I power up the PCB the SDA and SCL lines are pulled high...naturally.

When I write to one of my digipots via I2C the SDA and the SCL lines transition as you would expect....

But after the write....the SCL remains LOW!!!!

This can't be good...shouldn't go back HIGH after a successful write?

I have gone through the forum and I have made sure I havent done anything stupid....

ie...I am not using constants in my I2CWRITE lines...but even if i were it shouldn't matter as the devices only use BYTES

Can anyone shine a little light on me?

Robert in Massachusetts

robertmark68
- 19th September 2006, 19:46
12 hours!!!!

12 @#$%^& HOURS!!!!!

I wasted 12 hours on this problem and all I needed was BRACKETS around my data?!?!!?!?!?


I really REALLY REALLY need a DRINK!!!!!

Robert

ErnieM
- 19th September 2006, 21:59
At first I was thrilled to read your post, as I'd asked the same several months back and got no (usefull) replies, just the standard RTFM stuff. Wow, I can help this guy I think.

Then I saw your reply to yourself.

JUST 12 hours? I spent about 3 days looking for those brackets.



My only question is why this doesn't generate a compiler error?

Why just make bad code?

Payatronico
- 20th September 2006, 01:30
I have the same problem with the "·$%&/) RTC, why don't use BRACKETS in the examples?

You take 3 days, the other one take 3 days, I spend one week... so I am the best stupid? I win I win I win yeaaaa