Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
Re: IIC Bus on MC9S12DP256 - sleidiman - Jun 15 4:14:00 2005
Hello!
Iīm only a beginner in programming ĩC but I try to help you.
I have a similar problem. I want to communicate with a temperature
sensor over I2C.
I show you my init-function: (but it isnīt in assembler)
void initI2C(void)
{
IBFD=0x1F; /*here you must define the frequency divider*/
/*Block Guide page.16-25*/
IBAD=0xA0; /*SlaveAdress of this Module*/
/*I donīt know, whether itīs necessary*/
IBCR=0x80; /*activate I2C-Modul, without INTERRUPT*/
}
To start Iīm using this command:
IBCR=0xB0; /*Start, BUS INTERRUPT DISABLE*/
/*IBEN & Master & Transmit = 1*/
Here is the command to stop the communication:
IBCR=0x90; /*Stop*/
/*IBEN & Transmit = 1*/
The addressing depends on the device (i.e. sensor), you want to use.
Take care, I donīt know whether it is right, what iīve posted here.
Perhaps it helps you. At present thatīs all I know.
Greetings!
> > IIC block. But I'm lost in the Motorola documents.
> > All I would like to have is an assembler example of starting,
> > addressing a device and stopping the Bus.
> > Have anybody already done that and possibly email me an example ?
> > That would be great.
> >
> > Thanks by advance
> >
> > Jean Claude

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )