I2C Address Problem with Micromite
Author
Message
TassyJim
Guru
Joined: 07/08/2011
Location: AustraliaPosts: 6269
Posted: 09:42pm 14 Jan 2022
phil99 said
At which end is the extra "0" meant to go? MSB or LSB?
> ? hex$(&B01111000)
78
> ? hex$(&B11110000)
F0
>
From the MMBasic manuals:
Quote
7-Bit Addressing
The standard addresses used in these commands are 7-bit addresses (without the read/write bit). MMBasic will
add the read/write bit and manipulate it accordingly during transfers.
Some vendors provide 8-bit addresses which include the read/write bit. You can determine if this is the case
because they will provide one address for writing to the slave device and another for reading from the slave. In
these situations you should only use the top seven bits of the address. For example: If the read address is 9B
(hex) and the write address is 9A (hex) then using only the top seven bits will give you an address of 4D (hex).
Another indicator that a vendor is using 8-bit addresses instead of 7-bit addresses is to check the address range.
All 7-bit addresses should be in the range of 08 to 77 (hex). If your slave address is greater than this range then
probably your vendor has provided an 8-bit address.
The MMBasic manuals don't describe the "reserved" range which this device seems to use.
Jim