Phạm Thành Danh
Thành Viên PIF
	Tình hình là em không hiểu sao phần code i2c của em nó cứ rơi vào cái vòng lặp này rồi không thoát ra được, em dùng code mẫu của clb nhưng vẫn lỗi .
		Code:
	
	#include <msp430.h>
#include "basic_config.h"
#include "LCD.h"
#include "I2C.h"
int sec, min, hour, day , date , month, year;
char  dayc,Sun,Mon,Tues,Wed,Thurs,Fri,Sat;
unsigned char datawr[]={0x00,0x20,0x10,0x01,0x15,0x07,0x13};
  // khai báo data write
  unsigned char datarev[8];
void main()
{
 
  Config_stop_WDT(); // stop WDT, see description in Basic_config.c
  Config_Clocks();
  P2SEL &=  ~BIT6 + ~BIT7; // 2.6,2.7 are GPIO
  P2SEL2 &=  ~BIT6 + ~BIT7;
 
  lcd_init(1);
  lcd_backlight(1); // turn on LCD backlight
  i2c_init(0x68);
  i2c_write(0x00,7, datawr); //write multi – byte
 
  while(1)
  {
  i2c_read(0x00,7,datarev);
  sec  =((datarev[0]&0xf0)>>4)*10 + (datarev[0]&0x0f);
  min  =((datarev[1]&0xf0)>>4)*10 + (datarev[1]&0x0f);
  hour =((datarev[2]&0xf0)>>4)*10 + (datarev[2]&0x0f);
  day  =((datarev[3]&0xf0)>>4)*10 + (datarev[3]&0x0f);
  date =((datarev[4]&0xf0)>>4)*10 + (datarev[4]&0x0f);
  month=((datarev[5]&0xf0)>>4)*10 + (datarev[5]&0x0f);
  year =((datarev[6]&0xf0)>>4)*10 + (datarev[6]&0x0f);
}
	
nó bị lỗi ngày dòng i2c_write của file i2c.c

				
 Chả biết sao sửa