• @Robin the reference manual for I2C Class says:

    This class allows use of the built-in I2C ports. Currently it allows I2C Master mode only.

    That sounds like I can't connect one Pico to a second (or third/fourth/etc) Pico and have them communicate via I2C, because I can't put any device into Slave mode. Am I misinterpreting the docs?

    Edit: and the doc says the same thing about SPI.

  • 'Am I misinterpreting the docs?'

    Probably not.

    I mentioned my attempts with SPI,

    http://forum.espruino.com/conversations/­336061/#comment14819061

    and @allObjects pointed out there, some issues/solutions in #6 and @Gordon points out only master in #2. I have been successful at connecting two uP masters and a slave sensor, then ping pong between the two as the supreme master, but got side tracked on a more perplexing issue. Just haven't gotten back at this, and I2C was in the plan to attempt the same.

    I placed a logic analyzer on the bus to see what is going on. Added a protocol decoder for byte verification. Eventually will get back to writing more code. I don't see why it wouldn't be possible to use digitalRead() on a pin, after detecting a CS, but not using the SPI js module. The master would send the SPI request, the slave will just use plain reads not using SPI.

    Note that Chip Select is on D1 and this is a snap shot of a read request. Binary is amazing. Seeing a visual representation of what was typed in code is just plain cool. As Spock said in a 70's episode to an inbound distress call, 'Captain, a simple binary code.'

    Several images of USART bus in action, just as cool:

    at #3 http://forum.espruino.com/conversations/­332295/

About

Avatar for Robin @Robin started