PDA

View Full Version : Pic as an i2c slave



Robert Soubie
- 18th January 2004, 13:28
With help of some people on the Piclist and also on Crownhill's PicBasic Pro list, I have been able to implement i2c slave logics into a PIC using the hardware MSSP and fast interrupts, as proposed by Timothy Box for the 16F series and Darell Taylor for the 18F.

The problem I had to solve was missing instructions in the -very misleading- Microchip application note AN734 that describes how to do it in assembler.

I have made available the PBP routines I use, separating as far as possible what is reusable by someone else from the actual processing relevant to my application.

The corresponding files are available for download at the following URL:

http://www.astrosurf.com/soubie/microcontroleurs.htm

Also available on this page are routines to detect and read from a DS1820 temperature sensor and store the date using positive integer arithmetic (even for negative values), along with routines to display temperature in degrees Celsius and Farenheit or on the Kelvin and Rankine scales.

These last routines demonstrate how PBP allows handling physical parameters using offesting and scaling techniques.

All this software maybe reused even in a commercial context. Credits to the author will be appreciated.

dolphin42
- 25th January 2007, 22:11
those I2C routines were just the thing I was looking for.
tempis fugit