MCP4725 Odd Behavior - does not update with number directly

I’m using the e/MCP4725 library, and it works fine in 2 scenarios, and doesn’t work in another (direct number wire). Basically, can work with deprecated triangle wave, but not the updated triangle wave. I couldn’t get it to update with any kind of number wired directly, even when changing the number to trigger the pulse-on-change inside the mcp4725 node.

  1. Works using the example node with the library, with the deprecated triangle-wave node, directly wired to the mcp4725

  2. Works using updated triangle-wave node only when going through a select node.

  3. Does not work when updated triangle wave is wired directly?

I can’t get the MCP4725 to output the number I want, for example, through map. The thing doesn’t update through MAP node, either.

Doesn’t not work through a buffer node, either.

Can anybody help understand this behavior? @evgenykochetkov
mcp4725.xodball (21.6 KB)

SOLVED: Have to slow down the other I2C devices…

But, really, the library should have pulled out the UPD node (send), instead of updating on change.
image

mcp4725.xodball (18.8 KB)

Seams like a potential safety issue with the i2c communication. The clocks can’t match, or one dominates the i2c bus. In my case, the ADS1115 appears to dominate. If you choose different clock speeds, then the speeds have to be out of phase… and never match on moment to UPD, I’m not sure the best way to get that…

One option is to use prime numbers, but I’m not sure if they could overlap ever…

A Flip-Flop could be used for just 2 i2c devices, assuming you want them sampling at the same rate

But, what happens if you have a lot of i2c devices? Then, you need a new node that XOD doesn’t have in the the CORE, the Select-Pulse Node (but doesn’t work for this)

But, that node method doesn’t work! Likely has something to do with the time to write and read-back from the I2C bus… I’m not sure, but not all methods work…

Now, if all the I2C devices want to be read as fast as possible, then you can make a daisy chain, but have to add the DONE pulse node out of the MCP4725, and place a defer. Using BUS instead of wires, naming convention can be “DEV#-out”, and the last I2C DEVICE wired back to the start.

I’m not sure if it would be possible for XOD to handle the I2C networking managing, automatically?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.