AnsweredAssumed Answered

I2C Issue with MC9S08AC128

Question asked by Preetu Abraham on May 24, 2017
Latest reply on Jun 2, 2017 by Michael Fugere

Hi,

 

I ma facing issue for I2C interrupt not getting hit even after initializing the registers. Even the initialization to F0 does not get set initially.

Since I am transferring multiple data at a time later It gets set to FO

 

Snippet in main file:

 

I2C initialization

 

/* Initialize the I2C Module. */

_IIC1A.IIC1AData = 0x02; /* Set the master address to be 1 */

_IIC1F.IIC1FData = 0x06; for Bus frequency of 6.75MHZ

 

 

YYY[][] AND XXX[][] are initialized to set of values and then initialized as below

/* configure 1 */

for (i = 0; i < YY; i++)

{

SendI2CData(&YYY[i][0]);

 

 

 

for (j = 0; j < XX; j++)

{

SendI2CData(&XXX[j][0]);

 

 

 

/* Initialize ourselves as the master by setting IICEN, IICIE, MST and TX. **

/*within SendI2CData*/

_IIC1C1.IIC1CData = 0xf0;

 

Snippet for interrupt

 

__interrupt void __near _Iic_Isr(void) {

 

/* Declarations and Initializations. */

volatile Uint8 DummyRead;

 

/* Statements. */

/* Clear the Interrupt Pending flag. */

_IIC1S.Bit.iicif = true;

 

/* Check the mode of operation; are we master. */

if (_IIC1C1.Bit.mst) {

/* We in Transmit mode. */

if (_IIC1C1.Bit.tx) {

/* Have all the bytes

 

Outcomes