I'm trying to control a PCF8591 (NXP) - its an 8bit D/A.
Here's a link to the sheet. (but not really necessary for this issue I think)
The issue I'm having (I think) is the addressing. The sheet says it requires the MSB of the address byte to be a 1 (so 100000000) and then you mask in bits specific to the hardware address and whether you want to read or write. In my case the address would be B10010011 (the last bit is the read/write bit and its set to write here).
So far so good.
If I hook up two arduinos and have them talk across the SDA and SCL lines (in my simple tests with two UNO R3's using Pins 4 and 5), all reads and writes work correctly and I can even choose an address for the slave of say 128 (binary 10000000 - the filled MSB is key here) and I can read the data byte in the serial monitor (and its right) on the slave.
But when I put the Master TX to a scope, I can't see the MSB showing up in the address. Because of this I don't think the 8591 is seeing the full address either.
So how is the slave arduino able to sync addresses when there is no MSB being broadcast in the address?, and in the case of an address of 128, or B10000000, that's pretty much everything! Or does the slave see that as address 0 (with no MSB) and the Master also considers it a 0 as well? So that's why it works? (I think this is probably the case since I remember now that there is a limit to 128 slaves)
More importantly, is this missing MSB an artifact of the scope? (I can see everything else as I should: address followed by databyte and clock on a second channel perfectly (the scope is triggering off the clock, and I'm not bothering to decode). All addresses that are less than 128 show up perfectly. There is a logic low where the MSB should be for 128 and above so it's not like it's off the screen on the scope (I can also see the start of the clock back before the SDA starts dancing)
Or is this an artifact of the UNO or arduinos in general?
One other oddity: If I send a databyte that is 128 or larger, in other words populating the MSB in the databyte, I get an extra little hiccup in the SDA trace one clock cycle after the end of that entire databyte, where none exists, or should exist normally if I use a value of less than 128. Its not a full value spike; about 70% of all the other logic "1"s in the byte, but clear as day and not a reflection.
Given that I have the address right and the data byte right as per the sheet to affect the 8591, I'm thinking this is where the problem lies since I can't affect the output of the 8591.
Assuming this is a limit of the arduino not being able to broadcast the first bit of the address byte, and without adding circuitry to mask in a 1 in the MSB position, is there another way?