User Tools

Site Tools


theory:background:digilent_pmodia

This is an old revision of the document!


Digilent PmodIA Impedance Analyzer

The Digilent PmodIA1) (Revision A) is an impedance analyzer built around the Analog Devices AD5933 12-bit Impedance Converter2). There is also an evaluation kit from Analog Devices3), but there is no experience with that.

Board and chip

  • Digilent PmodIA reference website4)
  • PmodIA Reference Manual5)
  • PmodIA schematics6)
  • Analog Devices AD5933 datasheet 7)
  • Analog Devices Application note AN-12528)

Fig. 1: Digilent PmodIA Impedance Analyzer board is based on the Analog Devices AD5933 chip

Connecting to a computer

The board is connected to a computer using a Bus Pirate v3.5c9). The wiring is as follows:

Bus Pirate PmodIA Function
GND GND Ground
+3V3 VCC 3.3V power supply
VPU VCC Pull-up resistors for I2C
CLK SCL I2C SCL
MOSI SDA I2C SDA
Tab. 1: Connecting the Bus Pirate v3.5c to the PmodIA

Fig. 2: Connecting the boards

To communicate from a Mac to the Bus Pirate, the ZTerm application is used10), but any serial communication tool is an option (like the serial monitor from Arduino). The settings are:

  • Baud rate: 115200
  • Data bits: 8
  • Stop bits: 1
  • Parity: none
  • Flow control: Xon/Xoff

After opening the terminal, the connection is tested with a “?” command, and the Bus Pirate responds correctly with its help menu. The next test is to searach for I2C devices by the following commend sequence:

HiZ>m 4 3    -- to set the Bus Pirate to the I2C mode using a speed of 100kHz
I2C>W P v    -- to switch on the power and the pull-up resistors, and measure the voltages subsequently
I2C>(1)      -- to run the macro that identifies all I2C devices on the bus
I2C>p w m 1  -- to switch off the supplies and switch back to HiZ mode

After the second line of switching on the powers and measuring the voltages, the VPU pin should read something like $3.3V$. After line 3, the PmodIA board should respond with:

Searching I2C address space. Found devices at:
0x1A(0x0D W) 0x1B(0x0D R)

which means the AD5933 chip is found correctly at I2C hexadecimal address 0x0D, which becomes 0x1A for write and 0x1B for read (according to the I2C protocol.

Now read the control register of the AD5933:

HiZ>m 4 3             -- switch to I2C mode
I2C>W P               -- to switch on the power and the pull-up resistors 
I2C>[0x1A 0xB0 0x80]  -- address chip 0x0D for write, and set a pointer to address 0x80, the control register. 0xB0 is the command code for setting a pointer
I2C>[0x1B r]          -- address chip 0x0D for read, which gives the content of the register at the pointer (control register)
I2C>p w m 1           -- to switch off the supplies and switch back to HiZ mode

The resulting byte is 0xA0 which is indeed the default value of the control register according to the data sheet. It means the chip is in power down mode.

Now read the temperature of the AD5933:

HiZ>m 4 3                     -- switch to I2C mode
I2C>W P                       -- to switch on the power and the pull-up resistors 
I2C>[0x1A 0xB0 0x8F] [0x1B r] -- Read status register 0x8F
I2C>[0x1A 0x80 0x90]          -- Write 0x90 to the control register upper byte to start a temperature measurement
I2C>[0x1A 0xB0 0x8F] [0x1B r] -- Read status register 0x8F to check if the measurement is finished
I2C>[0x1A 0xB0 0x92] [0x1B r] -- Read temperature upper byte
I2C>[0x1A 0xB0 0x93] [0x1B r] -- Read temperature lower byte
I2C>[0x1A 0x80 0xA0]          -- Write 0xA0 to the control register upper byte to enter power down mode
I2C>p w m 1                   -- to switch off the supplies and switch back to HiZ mode

The resulting bytes are 0x02 and 0xF9 which is $761$ and corresponds to $761/32 = 23.8^{\circ} C$.

Block read and write

Some examples of writing registers and blocks from the Bus Pirate:

I2C>[0x1A 0x82 0xAA] -- Write to start frequency byte 1
I2C>[0x1A 0x83 0x77] -- Write to start frequency byte 2
I2C>[0x1A 0x84 0x33] -- Write to start frequency byte 3

I2C>[0x1A 0xB0 0x82] [0x1B r] -- Read start frequency byte 1
I2C>[0x1A 0xB0 0x83] [0x1B r] -- Read start frequency byte 2
I2C>[0x1A 0xB0 0x84] [0x1B r] -- Read start frequency byte 3

I2C>[0x1A 0xB0 0x82] [0x1A 0xA0 0x03 0x00 0xF3 0xC5] -- Block write start frequency bytes 1 through 3

I2C>[0x1A 0xB0 0x82] [0x1A 0xA1 0x03 [0x1B r:3] -- Block read start frequency bytes 1 through 3

Calibration

According to the PmodIA Reference Manual11), the gain factor has to be determined first. This is done using the programming sequence as explained in AN-125212).

HiZ>m 4 3             -- Switch to I2C mode
I2C>W P               -- to switch on the power and the pull-up resistors 
I2C>[0x1A 0x80 0xB1]  -- Write 0xB0 to the control register upper byte to enter standby mode (0xB0) and set gain to 1x with an excitation voltage of 2Vpp (0x01)
I2C>[0x1A 0x81 0x10]  -- Write 0x10 to the control register lower byte for reset and internal system clock
I2C>[0x1A 0xB0 0x82] [0x1A 0xA0 0x03 0x00 0xF3 0xC5] -- Write start frequency 0x00F3C5 = 1950Hz at MCLK=16.776MHz to registers 0x82 0x83 0x84 
I2C>[0x1A 0xB0 0x85] [0x1A 0xA0 0x03 0x00 0x79 0xE2] -- Write frequency increment 0x0079E2 = 975Hz at MCLK=16.776MHz to registers 0x85 0x86 0x87 
I2C>[0x1A 0xB0 0x88] [0x1A 0xA0 0x02 0x00 0x0A]      -- Write number of increments 0x000A = 10 to registers 0x88 0x89
I2C>[0x1A 0xB0 0x8A] [0x1A 0xA0 0x02 0x00 0x0C]      -- Write number of settling time cycles 0x000C = 12 to registers 0x8A 0x8B (12 cycles at f_max of 12kHz will result into a delay of 12/12kHz = 1ms, which is the conversion time) 
I2C>[0x1A 0x80 0x11]  -- Write to the control register upper byte to initialize start frequency (0x10) and set gain to 1x with an excitation voltage of 2Vpp (0x01)
I2C>[0x1A 0x80 0x21]  -- Write to the control register upper byte to start frequency sweep (0x20) and set gain to 1x with an excitation voltage of 2Vpp (0x01)

Now loop:
I2C>[0x1A 0xB0 0x8F] [0x1B r]  -- Read status register and check 0x02 is high (no? --> read again), check if 0x04 is high (no? --> next frequency, yes --> end of sweep)
I2C>[0x1A 0xB0 0x94] [0x1A 0xA1 0x04 [0x1B r:4] -- Read four bytes starting at 0x94 (2-bytes real, 2 bytes imag)
I2C>[0x1A 0x80 0x31]  -- Write to the control register upper byte for next frequency sweep (0x30) [or do 0x40 for same frequency in case of avaraging] and set gain to 1x with an excitation voltage of 2Vpp (0x01)

To repeat, enter standby mode first:
I2C>[0x1A 0x80 0xB1]  -- Write 0xB0 to the control register upper byte to enter standby mode (0xB0) and set gain to 1x with an excitation voltage of 2Vpp (0x01)
To switch off, enter power down mode:
I2C>[0x1A 0x80 0xA0]  -- Write 0xA0 to the control register upper byte to enter power down mode (0xA0)

I2C>p w m 1           -- to switch off the supplies and switch back to HiZ mode

LabVIEW program

Fig. 3: A program in National Instruments LabVIEW that automates the scripting to the BusPirate

Now you may want to go back to the Impedance Spectroscopy page.

Downloads

Impedance_Spectroscopy_AD5933_LabVIEW_2018.zip LabVIEW 2018 1.0 LabVIEW vi for an impedance sweep (polar or Bode plot) on a AD5933 using a BusPirate for I2C
theory/background/digilent_pmodia.1552980335.txt.gz · Last modified: 2019/03/19 07:25 by glangereis