Re: I2C comunicaton
Posted: Thu Nov 30, 2017 4:42 pm
Ok I looked at the datasheet that you posted and it is an I2C chip.
First understand the I2C protocol a little will help even if your not going to use it this time as it will help you understand for the future.
The I2C is used to allow to hang multiple chips all on the 1 data line(much the same as USB). Each chip will have a 7 bit address(known as slave address) then the 8th bit is used to signal whether u want to write to the chip or read from the chip. Then the chip usually has memory addresses (register addresses) and you read or write to these register addresses.
So a write protocol will be send slave_address_byte/write_bit then the resister_address then the data that you want to write to the address
The read protocol will be slave_address_byte/read_bit then the resister_address then read the data from that register
This particular chip also uses a CRC check (rare to see on a IC2 com). It is a way og checking the received data hasn't been corrupted during coms, it is normally used for interent and RF tag and less reliable coms.
First understand the I2C protocol a little will help even if your not going to use it this time as it will help you understand for the future.
The I2C is used to allow to hang multiple chips all on the 1 data line(much the same as USB). Each chip will have a 7 bit address(known as slave address) then the 8th bit is used to signal whether u want to write to the chip or read from the chip. Then the chip usually has memory addresses (register addresses) and you read or write to these register addresses.
So a write protocol will be send slave_address_byte/write_bit then the resister_address then the data that you want to write to the address
The read protocol will be slave_address_byte/read_bit then the resister_address then read the data from that register
This particular chip also uses a CRC check (rare to see on a IC2 com). It is a way og checking the received data hasn't been corrupted during coms, it is normally used for interent and RF tag and less reliable coms.