Is it possible to remove excessive gaps/delays in i2c waveform on NodeMCU/Lua?

时间:2016-04-04 17:53:05

标签: lua i2c nodemcu

Calling the following function gives me the waveform on the first snapshot:

function writeDac(addr, value)
  value2 = BitAND(value, 255)
  value1 = rshift(value, 8)

  i2c.start(bus)
  i2c.address(bus, addr, i2c.TRANSMITTER)
  i2c.write(bus, value1)
  i2c.write(bus, value2)
  i2c.stop(bus)

end

enter image description here

Joining two writes in one removes one of the gaps on the waveform:

i2c.write(bus, value1, value2)

instead of

i2c.write(bus, value1)
i2c.write(bus, value2)

enter image description here

So I wonder, is there a way to remove the excessive gaps between "start", "address" and "stop"?

0 个答案:

没有答案