I2C-Interface Philips Semiconductors / NXP Semiconductors, I2C-Interface Datasheet - Page 10

no-image

I2C-Interface

Manufacturer Part Number
I2C-Interface
Description
Programming the 12C Interface
Manufacturer
Philips Semiconductors / NXP Semiconductors
Datasheet
Philips Semiconductors
secutlvely. Each gves the source of a bit
to be transmitted and a flag to indicate
whether the pointer should be increased
to point to a new bit. The transmission is
terminated by having a structure that
refers to an *idle” bit and does not in-
crease the pointer. Transmission is initi-
The structures are referenced con-
i*C Specific information
are not distinguished
The bit update prtion
constant-time,
can be easily padded if necessary to
achieve this part of the goal.
ated by changing the pointer to point to
the first structure. Start and stop bits
Franklin’s C5l compiler was used
and the pointer update
from data bits.
of the code is
7a
Refarray:
code struct BR BitRef[41] =
wherethedetails
data struct
tokens are interpreted as follows. In the
struct BR declaration. the token code as-
signs the BitRef array to program mem-
ory (which is then accessed with themovc
instruction).Inthe
the
cluslvelya pointertotheprogramspace.
so~trequiresonlytwo
pletely defined.
the compder to store the pointer value m
does not support external RAM. so the
small model is used. (If the transmit
data resided in external RAM. the algo-
expected to take a little longer to
execute.)
THE DECLARATIONS
// tranat
struct
No memory is allocated by this defini-
tion-it
tual allocation and initialization
provided by the definition (in a header
file, send _ seq.h, in this case) of the
ment. The pointer is defined as:
I/
for the work described here. The 8x75 1
rithm could be applied, but would be
T
pointer to BitRef structure array
In Franklin’s C5 I, the declaration
token
Bit-Banging
BR
unsigned char mask
unsigned char bump
unsigned char Index
vidual bit definitions is:
he structure that provides indi-
is essentially
codeimpliesthatBR_ptrisex-
;
bit-reference
BR code *BR_ptr
The token data causes
will
*BR_ptrdeciaratIon,
a typedef.
be
bytes to becom-
structure
given
:
:
:
Serial Ports
in a mo-
The ac-
1 ;
Bit-
are

Related parts for I2C-Interface