This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTC BQ32000 .. not able to write data into the register

Other Parts Discussed in Thread: BQ32000

Hi

I am using RTC BQ32000 IC and interfacing it with stm32f030 microcontroller using I2C2 

My questions:

[1]

Time (Hr:Min:Sec) , i am able to read it but MSB of Min is always high. I think , it should be low. isn't it ? As per my logic, this MSB flag indicates Oscilator flag, and will be set only when there is  oscillator fail. If i am wrong , please correct me.

[2]

I couldn't able to write data into register. Below is my part of code that is for the purpose  for writing some values into the register. 

struct rtc                                    //Struct that store the time data that is being read/write from the RTC BQ32000
{
uint8_t sec,min,hour,day,date,month,year;
}time;

void RTC_Write(uint8_t addr, unit8_t data)

{

I2C_TransferHandling(I2C2, SLAVE_ADDR, 1, I2C_SoftEnd_Mode, I2C_Generate_Start_Write);
while(I2C_GetFlagStatus(I2C2, I2C_ISR_TXIS) == RESET);
I2C_SendData(I2C2,addr);
while(I2C_GetFlagStatus(I2C2, I2C_ISR_TC) == RESET);
I2C_SendData(I2C2,data);
while(I2C_GetFlagStatus(I2C2, I2C_ISR_TC) == RESET);
I2C_GenerateSTOP(I2C2,ENABLE);
}

void main()

{

/*

 * Below four lines of statement is also written for other registers like hours,minute,second...etc

 */ 

time.day=0x06;                                            
RTC_Write(DAY_REG,time.day);
temp=RTC_Gettime(DAY_REG);
printf("DAY : %X\r\n",temp);

}

After writing day register value 0x06, it is not updating...the day register. 

Please suggest some helpful ideas, so that i can write into the registers.

Regards,

Kapil.

  • Hello Kapil,

    You've posted your question in the TM4C E2E forum. Your would be better served to ask the question in the specific forum supporting the BQ device. I will move this thread to that forum for you, but please note the Clock And Timing forum is to be used for questions on the BQ device.