EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #293 background imageLoading...
Page #293 background image
293
USCI I2C Interfacing BH1750 Ambient Light Sensor
Using USCI in I2C mode is a bit difficult compared to using USCI in SPI mode. This is because of the
many iterations and function calls in I2C mode. Again, here I tried to keep things simple and kept things
in a fashion we would normally expect. USCI-based I2C can be realized with a state-of-machine too
but that way is not easy for beginners.
Code Example
HW_I2C.h
#include <msp430.h>
void I2C_USCI_init(unsigned char address);
void I2C_USCI_set_address(unsigned char address);
unsigned char I2C_USCI_read_byte(unsigned char address);
unsigned char I2C_USCI_read_word(unsigned char address,unsigned char *value,
unsigned char length);
unsigned char I2C_USCI_write_byte(unsigned char address, unsigned char value);

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals