Flash Magic Forum

General => Off-Topic (Read Only) => Topic started by: tux on June 01, 2005, 08:47:30 AM

Title: P89C664 i2c driver
Post by: tux on June 01, 2005, 08:47:30 AM
hello,

where i can finde a runing i2c driver for the P89C664 MCU?

Have anyone a sample driver for me?

Thanks
Title: Re: P89C664 i2c driver
Post by: erikm on June 01, 2005, 10:52:00 AM
use CodeArchitect for LPC932, the difference is obvious and easy to handle.
Title: Re: P89C664 i2c driver
Post by: tuxi on June 01, 2005, 10:57:30 AM
it is posible that run on a P89C664 MCU wenn i generate with the codearchitect LPC932 a code?
Title: Re: P89C664 i2c driver
Post by: tuxi on June 01, 2005, 11:07:16 AM
ok wenn i generate the LPC932 i2c Driver from CodeArchitect, the I2DAT var's are not defined on the reg66x.h can i copy the defines from the reg932.h?

Thanks
Title: Re: P89C664 i2c driver
Post by: Andy Ayre on June 01, 2005, 11:15:34 AM
If they are not defined in reg66x.h then they don't exist in the 66x. You need to look at the datasheets for the LPC932 and the 664 and compare the differences between the two.

Title: Re: P89C664 i2c driver
Post by: tuxi on June 01, 2005, 11:34:08 AM
The 66x had a i2c device it stand in the Data Sheet but no description of the i2c include in the data sheet from the i2c as like the LPC935 MCU.
It engaged in the DataSheet under Features. (I
Title: Re: P89C664 i2c driver
Post by: Andy Ayre on June 01, 2005, 11:42:07 AM
I just checked, and the 66x datasheet available at www.philips.com/microcontrollers contains a complete description of I2C covering 20 pages. It has a very complete description.

Title: Re: P89C664 i2c driver
Post by: tuxi on June 01, 2005, 11:50:23 AM
ok i found the i2c description on 66x in the datasheet on site 12.
Title: Re: P89C664 i2c driver
Post by: Rons on June 01, 2005, 09:21:15 PM
Philips has released a i2c driver that you could adapt to your case.
I wrote my own driver for a P89C668 device.  You won't be able to
get above a rate of about 70k.
Title: Re: P89C664 i2c driver
Post by: tuxi on June 02, 2005, 01:19:01 AM
Where can i found the Philips i2c Driver - is it diferent from the CodeArchitect?

Rons can you send me the i2c driver that you had write?

My data rate is not important.
The codearchitect i2c driver don't please me. I have no so mutch time to write an own driver.

Thanks
Title: Re: P89C664 i2c driver
Post by: erikm on June 02, 2005, 06:10:11 AM
I have no so mutch time to write an own driver.

If you do not have the time to do the task, why did you accept it???

Erik
Title: Re: P89C664 i2c driver
Post by: tuxi on June 02, 2005, 07:27:48 AM
ok sorry i wirte it not so good.
i mean that i write total a new one for modyfile that time i must have.

Flo
Title: Re: P89C664 i2c driver
Post by: Rons on June 02, 2005, 01:14:21 PM
The Philips application note is AN95068
It is titled "C routines for the PCx8584"

You might also want application note AN96040 and
data sheet for the PCF8584 I2C bus controller.
Title: Re: P89C664 i2c driver
Post by: tuxi on June 02, 2005, 03:52:51 PM
oh thanks, that good, it help me very well!
Title: Re: P89C664 i2c driver
Post by: tux on June 06, 2005, 02:34:49 AM
thanks @all - now it works!

only i have a problem.
After i read from the i2c Bus 2 char's to a pointer (char *buffer). the buffer is empty and wenn i
printf( "buffer: %x\n", buffer[ 0 ] );
 printf( "buffer: %x\n", buffer[ 1 ] );
the buffer inherits the data from the i2c bus.

wenn i print that in one line it dosend work.
I use Keil.

what i make wrong?
Title: Re: P89C664 i2c driver
Post by: tuxi on June 06, 2005, 06:57:08 AM
ok i test it new it is enough if i tipp:
printf( "%x\n", buffer[ 0 ] );
or buffer[ 1 ] i musst printf exec bevor i use the buffer with other application.

My Keil is: