I²C-Routines for the 8051µC and compatibles
These routines are tested with a I/O-chip(PCF 8574) but should work with
every chip which uses the I²C protocol.
The routines are tested with a 8032@12MHz (NOP = 1µs, used for
delay!) On faster Hardware you have to watch the I²C-Specs.
The software was written for the Keil-Software(Assembler,Linker)
Click
here
for the
I²C-Bus-Timing
Known bugs:
-
They are not complete because of a bug at the resend of a byte after a
NACK from the slave was received (no STOP and START-Signal is generated
before the byte is sent again) but this will be corrected in the next release.
-
No speed opmtimization
The next releases will contain some new features and error corrections:
-
The NACK problem will be corrected
-
Performance optimization
-
A routine for simpler handling of the I²C-Access (only the start-adress
of the data and the length of the array are required)
-
A Slave-Mode will be included (switch between Slave/Master-Mode; Slave
Mode: define a buffer for the I²C-Bus for read/write-access in the
memory of the 8051)
-
I²C-Routines V0.9 (tested):
i2c0-9.zip
-
I²C-Routines V1.0 (tested):
i2c1-0.zip
The NACK-bug was solved.
-
I²C-Routines V1.1 (not tested):
i2c1-1.zip
Performance optimized
|