Top Banner
Control of Integrated Circuits through I2C-Bus using USB interface and GUI in Matlab Guansong Ji Supervised by Prof. Dr.-Ing. Klaus Solbach Institute of Microwave and RF-Technology University of Duisburg-Essen 2014-10-23 1
24

Guansong Ji Supervised by - uni-due.de

Oct 16, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Guansong Ji Supervised by - uni-due.de

Control of Integrated Circuits through I2C-Bus using

USB interface and GUI in Matlab

Guansong Ji

Supervised by

Prof. Dr.-Ing. Klaus Solbach

Institute of Microwave and RF-Technology

University of Duisburg-Essen

2014-10-23 1

Page 2: Guansong Ji Supervised by - uni-due.de

Outline

1. Motivation

2. System Overview

3. I2C Bus Communication Protocol

4. Arduino Platform

5. PCB Design

6. Matlab GUI

7. Test of Matlab GUI and ICs

8. Conclusion

2

Page 3: Guansong Ji Supervised by - uni-due.de

1. Motivation

• Power Amplifier Project for 7T MRI.

• ICs require digital data input for the control

• Functions of the ICs need to be tested on a demonstrator PCB.

• Matlab GUI needs to be designed and tested.

3

Page 4: Guansong Ji Supervised by - uni-due.de

2. System Overview

4

PC (MATLAB GUI) MP Arduino PCBUSB I2C Bus

Integrated Circuits

• PCA9543A (Switch)

• P82B96 (Bus Buffer)

• MAX5115 (DAC)

• PCA9554A (Register)

• PCF8591T (ADC)

Page 5: Guansong Ji Supervised by - uni-due.de

3. I2C Bus Communication ProtocolI2C Bus

• Inter-Integrated Circuit (I2C, Trademark)

• Two-Wire Interface (TWI, simpler than SPI)

• Two Signal Wires: Serial Data (SDA) and Serial Clock (SCL)

• Serial Communication (slower, cheaper and easier)

• Byte-oriented Transfer (8 bits)

5

Page 6: Guansong Ji Supervised by - uni-due.de

3. I2C Communication ProtocolAn Example of communication protocol

6

Start Repeated

start

Acknowledge

bit

StopSCL Low

SDA Change

MSB

Page 7: Guansong Ji Supervised by - uni-due.de

3. I2C Communication ProtocolAn example of Write Operation (MAX5115)

7

• 7-bit slave address followed by one Read/Write bit.• High is Read, Low is Write.

• The Acknowledge bit is sent by the slave device.

• How are the command and data defined?

Page 8: Guansong Ji Supervised by - uni-due.de

3. I2C Communication ProtocolAn example of Write Operation (MAX5115)

8

Page 9: Guansong Ji Supervised by - uni-due.de

3. I2C Communication ProtocolAn example of Write Operation (MAX5115)

9

• For Write Operation,C7 and C6 should be 0.

• C5 and C4 are set toselect NV or V.

• C3-C0 are set to selectthe respective DACregister.

Page 10: Guansong Ji Supervised by - uni-due.de

3. I2C Communication ProtocolAn example of Write Operation (MAX5115)

10

Unipolar Code Output Voltage

Page 11: Guansong Ji Supervised by - uni-due.de

4. Arduino Platform

11

• Arduino Mega 2560

• Arduino IDE

(Integrated Development Environment)

• Support Package (by MathWorks)

Page 12: Guansong Ji Supervised by - uni-due.de

4. Arduino PlatformMATLAB Support Package for Arduino

• adiosrv.pde

(Firmware uploaded to the Arduino Board)

• aduino.m

(Matlab class definition file, object-oriented)

• They have to be modified for the I2C Bus

(adiosrvDAC.pde and aduinoDAC.m)

12

Page 13: Guansong Ji Supervised by - uni-due.de

4. Arduino PlatformFirmware uploaded to Arduino Board

• Wire Library

• Function setup()• Serial.begin(115200);

• Function Loop()• If statement (Input)

• Switch statement

• Initial state s is set to be -1

• Cases (Process and Output)

• State Machine

13

Initialization

Input

Process

Output

Initialization

Infinite

Loop

Page 14: Guansong Ji Supervised by - uni-due.de

4. Arduino PlatformMatlab class definition file

• Object-oriented Programming Approach

• Classdef arduinoDAC < handle

• Class Properties and Class Methods

• The class defines an Arduino Object

• Functions used in the I2C Communications• checkI2Caddress (a, addr);

• i2cWriteCommand (a, address, command);

• i2cWriteData (a, address, command, data);

• i2cReadCommand (a, address, command);

• i2cReadData (a,address)

14

Page 15: Guansong Ji Supervised by - uni-due.de

5. PCB Design

15

Finished Board Design of Software Eagle

Page 16: Guansong Ji Supervised by - uni-due.de

5. PCB Design

16

The assembly of PCB

PCA9543A

MAX5115 PCA9554APCF8591T

P82B

Page 17: Guansong Ji Supervised by - uni-due.de

6. Matlab GUIMultiWindow GUI

17

global ComPort

contents = cellstr(get(hObject,'String'));

ComPort = contents{get(hObject,'Value')};

clear a; % Clear the variable a

global a ComPort;

clc; % Clear Command Window

a = arduinoDAC(ComPort); %connect Matlab with the board and create an arduino object

Page 18: Guansong Ji Supervised by - uni-due.de

6. Matlab GUIMultiWindow GUI

18

PCA9543A MAX5115

Page 19: Guansong Ji Supervised by - uni-due.de

6. Matlab GUIMultiWindow GUI

19

PCA9554A

PCF8591T

Page 20: Guansong Ji Supervised by - uni-due.de

6. Matlab GUI16 cassettes GUI

20

Main Panel

Page 21: Guansong Ji Supervised by - uni-due.de

6. Matlab GUI

16 cassetes GUI

21

Control Panel

Page 22: Guansong Ji Supervised by - uni-due.de

7. Test of Matlab GUI and ICs

22

SDA

SCL

5V

GND

Page 23: Guansong Ji Supervised by - uni-due.de

8. Conclusion

• PCB has been designed and soldered

• Two versions of Matlab GUI has been designed

• The Matlab GUI and ICs have been tested

• New version of Support Package for Arduino

• GUI could be more convenient

23

Page 24: Guansong Ji Supervised by - uni-due.de

Thank you for yourattention!

24