Hey Darryle, thanks for the response.
Well ..... One of two things, I either don't completely understand your answer or I don't think that's what I'm seeing. Let me walk through it.
>The I2C Control, is what the MAX calls Address
Looked at that in more detail, Okay, I agree.
If the I2C Value, is what Max calls Data then I agree by default that:
>The I2C Address, is what the MAX calls Command
So according to the PBP statement:
I2Cwrite DataPin, ClockPin, Control, Address, Value
The equivalent Max(imized) statement should be:
I2Cwrite DataPin, ClockPin, Address, Command, Data
Which is what you entered when you wrote:
>Here's what it should look like without changing the variable names.
And when I put it in that way ....... it ... ahhh .... works! ..... jeez.
Okay, thanks, I had to walk myself through that. Also, it solved another problem I was seeing but won’t get into here.
If I might add something else I'm seeing. If I write:
I2cwrite PortA.6, PortA.2, Address, Command_NVreg, Data_M
pauseus 100
I2cwrite PortA.6, PortA.2, Address, Command_NVreg, Data_M
pauseus 100
I2cwrite PortA.6, PortA.2, Address, Command_NVreg, Data_M
For simplicity write 80h to NVreg 21h on slave 29h three times.
What I see is that the first write statement executed fine:
However the second write was incorrect:
And the third was correct:
This continues on and on and on ....
What apparently is happening is that the master isn't initiating a Stop sequence and the SCL line stays low .... apparently looking for the next Data Byte (?) ........ which it gets at the start of the next write, but we're trying to write the same thing again.
Anyway, then a proper Stop sequence is initiated and we're back to normal for the next Write.
Right around 1.2 mS where the Stop sequence should be SCL goes low before SDA goes high to initiate the Stop sequence.
Best regards,
Mark
Bookmarks