Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP430G2553 I2C Hold Master SI7020

$
0
0
Now is full work! Thank You. I put one line in the I2C read rutine- while(UCB0STAT &= ~UCSCLLOW); Please check me code is it without bug. Thank You. void I2C_Read(unsigned char byteCount, unsigned char *field) { while(UCB0STAT &= ~UCSCLLOW); //Only Hold Master-for SI7020 TI_receive_field = field; if (byteCount == 1) { byteCtr = 0; __disable_interrupt(); UCB0CTL1 |= UCTXSTT; // I2C start condition while (UCB0CTL1 & UCTXSTT); // Start condition sent? UCB0CTL1 |= UCTXSTP; // I2C stop condition __enable_interrupt(); } else if (byteCount > 1) { byteCtr = (byteCount - 2); UCB0CTL1 |= UCTXSTT; // I2C start condition } else while (1); // illegal parameter }

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>