Left for archival purposes.

User avatar
By GeoReb
#25596 Hi,

I am trying to use NodeMCU (0.9.6 20150704) to control an i2c device with address 0xC4 (196 dec).
I am getting the following response...

Code: Select alli2c.start(0)
i2c.address(0,196,i2c.TRANSMITTER)
stdin:1: wrong arg range
i2c.write(0,"HelloWorld")
i2c.stop(0)

This is apparently due to a limit of address values of upto 127.
Please can this limit be lifted so that the full scope of addresses (0-255) can be used??

George
User avatar
By kolban
#25607 Howdy George,
Check out the following page:

http://www.i2c-bus.org/addressing/

If I hadn't checked before posting, I would have sworn that the I2C spec only allowed 7 bit addressing (0-127) and even some of those are reserved. However it does appear that there is such as thing as 10 bit addressing.

Can you describe in more detail the device to which you wish to communicate? I'd like to validate that it does have an address of 196 which we should be able to find in the device's data sheet. Again, I'm not saying you are wrong ... this is just the first time ive actually/personally come up against an I2C device with such a high address.

Neil
User avatar
By lethe
#25613 I haven't encountered 10bit i2c addressing either, but if you have a look at the specs, you will notice, that it will work without any changes: http://www.i2c-bus.org/addressing/10-bit-addressing/
Since the address is actually send in 2 8bit transfers, you just need to use 0xF0 as device address and send 0xC4 as the first byte.
User avatar
By GeoReb
#25647 Hi Neil,

Thank you for your enthusiastic response :) Much appreciated!

The device I'm using is an old school text to speech synthesiser, datasheet below...
http://www.robotstorehk.com/SP03Tech.pdf

It states in the datasheet that the following sequence should be sent to the unit...

    Start Bit I2C Start Sequence
    0xC4 SP03 I2C Address
    0x00 SP03 Command Register
    0x00 SP03 NOP Command
    0x00 Volume (Max.)
    0x05 Speech Speed
    0x03 Speech Pitch
    'H' (0x48) Text
    'e' (0x65) Text
    'l' (0x6C) Text
    'l' (0x6C) Text
    'o' (0x6F) Text
    0x00 NULL
    Stop Bit I2C Stop Sequence
Since the address is actually send in 2 8bit transfers, you just need to use 0xF0 as device address and send 0xC4 as the first byte.

I'm not entirely sure I understand this :shock:

Many-thanks,
George