AnsweredAssumed Answered

i2c primer

Question asked by Ronald Patton on Aug 24, 2015
Latest reply on Aug 25, 2015 by David Diaz Marin

Hi,

 

I am brand new to the Freescale product suite and Code Warrior.  I have inherited a project and the associated device which is a amateur radio device.  The device has several components, 1) MC9S08QG8CPBE, 2) A MCP3422 ADC and a KTM-s1201.  At any rate, the MCU communicates with the ADC via I2C.

 

If someone would be so kind as to point me in the right direction to Freescale I2c primer, I would be most appreciative.

 

The I2C source code included with the project is dated 8/2008.  This is pretty much a "down on the metal" type program.  Does Freescale have an I2C library I may link to?

 

//===================================================================
// MC9RS08KA8 IIC Subroutines  8/24/2008
// Written by John H. Fisher - K5JHF
//===================================================================

#include "derivative.h"
#include "iic.h"

//===================================================================

void i2c_send ( char send ) {

  IICD  = send; // master transmit;

  while (!IICS_IICIF);   // wait until IBIF;

  IICS_IICIF = 1; // clear the interrupt event flag;

}

//===================================================================

 

Thanks,

73,

Ron / W4MMP

Outcomes