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.

TM4C1294NCPDT INTERFACING WITH DS1307

Other Parts Discussed in Thread: TM4C123GH6PM, TM4C1294NCPDT

I have written the program given below which is working perfectly with TM4C123gh6pm but the program get stuck in "while(I2CMasterBusy(I2C0_BASE))" when running in TM4C1294NCPDT.

Can anyone help???

void RTC_WRITE()
{
while(run_once)
{
I2CMasterSlaveAddrSet(I2C0_BASE, 0x68, false); // The address of the Slave is 0x68

I2CMasterDataPut(I2C0_BASE, RTCRegister); // Addr 0x00

I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(!(I2CMasterBusy(I2C0_BASE)));
while(I2CMasterBusy(I2C0_BASE)); // SysCtlDelay(3000); for (i=0;i<7;i++) { I2CMasterDataPut(I2C0_BASE, RTCSetup[i]); I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_CONT); while(!(I2CMasterBusy(I2C0_BASE))); while(I2CMasterBusy(I2C0_BASE)); } I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH ); while(!(I2CMasterBusy(I2C0_BASE))); while(I2CMasterBusy(I2C0_BASE)); run_once = false; } SysCtlDelay(550000); // writing time } int main(void) { uint32_t FREQ=0; FREQ=SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |SYSCTL_CFG_VCO_480), 120000000); SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);//LCD SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);//LCD GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2); // I2CSCL GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3); GPIOPinConfigure(GPIO_PB2_I2C0SCL); GPIOPinConfigure(GPIO_PB3_I2C0SDA); I2CMasterInitExpClk(I2C0_BASE, FREQ, false); GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7); GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_0|GPIO_PIN_1); SysCtlDelay(2000000); LCD_INT(); RTC_WRITE(); while(1) { RTC_READ(); } }