Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216704

Forum Post: TM4C1231H6PGE: how to enable interrupt of NVIC of i2c 2 bus

$
0
0
Part Number: TM4C1231H6PGE Hi , I am trying to enable the interrupt of the NVIC for the i2c 2 bus . when i do that , the bus is getting hanged not sure why . below is the code to intialise the i2c2 help me out if am missing something ---------------------------------------------------------------------------------------------code------------------------------------------ SysCtlPeripheralDisable(SYSCTL_PERIPH_I2C2); SysCtlPeripheralReset(SYSCTL_PERIPH_I2C2); SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2); // Enable and initialize the I2C master module Using the system clock. // The I2C transfer rate will always be 100kHz. // MAP_I2CMasterInitExpClk(I2C2_MASTER_BASE, SysCtlClockGet(), false); // MAP_I2CMasterGlitchFilterConfigSet(I2C2_MASTER_BASE, I2C_MASTER_GLITCH_FILTER_32); HWREG(I2C2_MASTER_BASE + I2C_O_MCR2) |= (6<<4); // Set to 16 clock glitch filter HWREG(I2C2_MASTER_BASE + I2C_O_MCR ) |= (1<<6); // and enable now // // Configure bus timeout to 25ms. 12-bit value for 25ms is 0x9C4 (2500 // clocks), so round upper 8 bits to 0x9C. Each clock is 10us since // 100kHz I2C is required for CiscoI2C. // MAP_I2CMasterTimeoutSet(I2C2_MASTER_BASE, 0x9C); MAP_I2CMasterIntEnableEx(I2C2_MASTER_BASE, I2C_MASTER_INT_DATA | I2C_MASTER_INT_TIMEOUT); ROM_IntEnable(INT_I2C2); ----------------------------------------------------------------------------------------------------------------------- this particular function in the code is causing the issue. ROM_IntEnable(INT_I2C2); Thanks, Rohith

Viewing all articles
Browse latest Browse all 216704

Trending Articles



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