Basic commands are implemented using the low level read and write functions.
The initialization sequence is implemented according to the implemented commands.
Other functions include
o Write to LCD screen.
o Access the CGRAM and DDRAM memories.
9 I
2
C Interface
The inter-integrated circuit (I
2
C) interface provides a medium speed (100K or 400Kbps) synchronous serial
communications bus. The I
2
C interface allows master and slave operation using either 7-bit or 10-bit device
addressing. Each device is given a unique address, and the protocol can address packets to a specific device or to
broadcast packets to all devices on the bus. Refer to the Microchip PIC32MX3XX/4XX Family Datasheet and the
PIC32 Family Reference Manual for detailed information on configuring and using the I
2
C interface.
The PIC32MX370F512L microcontroller provides two independent I
2
C interfaces. The Basys MX3 is designed to
offer dedicated access to one of these interfaces, I
2
C1 (pins SCL1 and SDA1), using the I
2
C daisy chain connector
labeled I
2
C situated under the LCD. The other I
2
C interface, I
2
C2, is not available on the Basys MX3 board, since its
pins (SCL2 and SDA2) are not wired to external connectors.
As mentioned in Section 1.4 Remappable pins, I
2
C interfaces are not involved in pin remapping. The SCL1 and SDA1
don’t need to be configured or managed, they are properly accessed through the I
2
C1 interface.
The I
2
C daisy chain connector provides two positions each for connecting to the I
2
C signals, power and ground. By
using two-wire or four-wire MTE cables (available separately from Digilent) a daisy chain of multiple I
2
C-capable
devices can be created.
One onboard I
2
C device is connected on the I
2
C1 interface: the accelerometer. See the Accelerometer section for
more information on its use.
The I
2
C bus is an open-collector bus. Devices on the bus actively drive the signals low. The high state of the I
2
C
signals is achieved by pull-up resistors when no device is driving the lines low. One device on the I
2
C bus must
provide the pull-up resistors. On the Basys MX3, I
2
C1 has pull-up resistors attached to it. Generally, only one device
on the bus will need to have the pull-ups enabled.
Detailed information about the operation of the I
2
C peripherals can be found in the PIC32 Family Reference
Manual, Section 24, Inter-Integrated Circuit.
The following table details the content of the I
2
C connector (the col1 and col2 columns correspond to the two
parallel rows of pins):