beautypg.com

C interface, 2 clock source, 3 setting up a frequency sweep – Digilent 410-246 User Manual

Page 2

background image

PmodIA™ Reference Manual

Copyright Digilent, Inc. All rights reserved.

Other product and company names mentioned may be trademarks of their respective owners.

Page 2 of 4

1.1 I

2

C Interface

The PmodIA acts as a slave device using I

2

C communication protocol. The I

2

C interface standard uses two signal

lines. These are I

2

C data and I

2

C clock. These signals map to the serial data (SDA) and serial clock (SCL) respectively

on the PmodIA. (See Table 1.) The following instructions explain how to read and write to the device.

You must consider two protocols when writing to the PmodIA: the write byte/command byte and the block write.
Writing a single byte from the master to the slave requires the master to initiate a start condition and send the 7-
bit slave address. You must hold the read/write bit low to write to the slave device successfully. The PmodIA
should set the slave address as 0001101 (0x0D) upon startup. After the slave acknowledges its address, the master
must send the address of the register it wants to write to. Once the slave acknowledges receipt of this address, the
master will send a single data byte that the slave should acknowledge with a return bit. The master should then
issue a stop condition.

You can also use this protocol to set a pointer for a register address. After the master sends the slave address and
write bit, and the slave responds with an acknowledge bit, the master sends a pointer command byte (10110000,
or, 0xB0). The slave will assert an acknowledge bit and then the master will send the address of the register to
point to in memory. The next time the device reads from or writes data to a register, it will occur at this address.

Note:
The pointer must be set prior to using block write or block read protocols.

You can perform a block write protocol in a similar fashion to setting a pointer. Send the block write command
(10100000, or, 0xA0) in place of the pointer command, and the number of bytes being sent (represented as a byte)
will take the place of the register address with subsequent data bytes being zero indexed. Use the same two
protocols when reading data from the PmodIA: receive byte and block read.

Connector J1 – I

2

C Communications

Pin

Signal

Description

1, 2

SCL

I

2

C clock

3, 4

SDA

I

2

C data

5, 6

GND

Power supply Ground

7, 8

VCC

Power supply (3.3V/5V)

Table 1. Interface Connector Signal Description

1.2 Clock Source

The PmodIA has an internal oscillator that generates a 16.776 MHz clock to run the device. You can use an external
clock by loading IC4 on the PmodIA and setting bit 3 in the control register (register address 0x80 and 0x81).

The PmodIA schematic provides a list of recommended oscillators. The schematic is available from the PmodIA
product page at

www.digilentinc.com

.

1.3 Setting up a Frequency Sweep

The electrical impedance, of a circuit can vary over a range of frequencies. The PmodIA allows you to easily set
up a frequency sweep to find the impedance characteristics of a circuit.