PDA

View Full Version : Highspeed-I2C ?



BigWumpus
- 17th August 2005, 19:00
I'm using an 24FC512 as an external memory with an PIC18F252 @ 8MHz.
This device is able to work at a speed of max. 1MHz.

Is it possible to use an I2C-speed of 400kHz or 1MHz with I2CWRITE/I2CREAD ?

Melanie, what's possible ? ;-)

ErnieM
- 17th August 2005, 19:30
Sorry I'm not Melanie but...

The speed of the I2C interface is determined by the master device, that being the PIC side. The memory is *capable* of I2C-speeds of 400kHz or 1MHz does not mean it MUST be run at those speeds, slower is OK. I2C is defined to go down to way slow (almost DC) speeds.

The Pic Basic manual states the I2C bus will run at or below 100KHz speeds up to your 8MHz clock, and at or below 400kHz up to a 20MHz clock.

Should you mean "how to run a PIC I2C at 400kHz or 1MHz," thats more involved. Pic Basic leaves the hardware elements alone as much as possible, meaning it used straight pin bit banging methods to do I2C. You would need to use the hardware I2C to get the 1MHz limit. There's some code posted or linked here to do just that, and while written in Pic Basic it is not just a simple command, it is several largish routines.