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 #283 background imageLoading...
Page #283 background image
283
// pull down SDA to create START condition
FORCING_SDA_LOW();
}
// function to generate I2C REPEATED START condition
void i2c_usi_mst_gen_repeated_start(void)
{
USICTL0 |= USIOE;
USISRL = 0xFF;
USICNT = 1;
// wait for USIIFG is set
i2c_usi_mst_wait_usi_cnt_flag();
// small delay
_delay_cycles(100);
// pull down SDA to create START condition
FORCING_SDA_LOW();
// small delay
_delay_cycles(100);
}
// function to generate I2C STOP condition
void i2c_usi_mst_gen_stop(void)
{
USICTL0 |= USIOE;
USISRL = 0x00;
USICNT = 1;
// wait for USIIFG is set
i2c_usi_mst_wait_usi_cnt_flag();
FORCING_SDA_HIGH();
}
// function to wait for I2C counter flag condition
void i2c_usi_mst_wait_usi_cnt_flag(void)
{
while(usi_cnt_flag == FALSE)
{
//__bis_SR_register(LPM0_bits);
}
// reset flag
usi_cnt_flag = FALSE;
}
// function to send a byte
unsigned char i2c_usi_mst_send_byte(unsigned char data_byte)
{
// send address and R/W bit
SET_SDA_AS_OUTPUT();

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