View
244
Download
13
Embed Size (px)
Citation preview
High speed digital systems laboratoryהמעבדה למערכות ספרתיות מהירות
- מכון טכנולוגי טכניוןהלישראל
הנדסת חשמלהפקולטה ל
Technion - Israel institute of technologydepartment of Electrical Engineering
Final presentation:
Optical Stimulation System for Brain Waves Detection & Measurements
Presenters:
Alterman Igal : 306403650Minkin Dmitry: 320576473
Supervised by: Broodney Hen.
Winter Semester 2002 - 2003
SHORT DESCRIPTION
• Our project deals with measuring eye vision of the patient without the necessity of his cooperation.
• A patient is receiving optical stimulation and his brain waves are being collected by Sampling card (Brain wave collector device).
• While stimulation, our system generates a signal to synchronize between stimulation moment and Sampling card.
SYNCHRONIZER
SOLUTION
Softwareprototype.
Hardware prototype
OUR SYSTEM
• Video card with 2 outputs & a screen splitter
• VHDL code for controlling pulse width
• Editing software code
• IntegrationGUI and Software for controlling stimulation.
Pulse synchronizer
Sampling system
Out 1
Video CardOut2
BLOCK DIAGRAM
Operator Display / Sampling card program.
step 1
pic 2
Stimulation
Pulse Sync.Multiplexer
Splitter
•It was decided to use:
•Two-port Video Card: first port to stimulation, and the second to splitter.
•Splitter:
- first output to patient display
- second output to the Pulse Sync.
Remark: why not to use 2 video cards?
Software implementation• Graphical User Interface: using VB
- choose parameters and set pulse length
• Run-time module : drawing and flipping pictures through DirectDraw (with normal priority).
Hardware implementation
• Output signal through hardware, based on [R,G,B,Vsync] signals.
• Hardware consists of analog (comparators etc.) and digital (Altera) circuits.
Integration• Before every set of steps we declare in VBasic:
• “Start program!”
• “Pulse length!”
• “Start flipping!”
• After every set of steps we declare:
• “Stop flipping!”
• During flipping:
•“Picture 1”
• “Picture 2”
“Start program!” :
• A blank screen with 3 lines
- complementary of green (red+blue)
- complementary of red (green+blue)
- white.
Complementary colors were used in order to separate two phases of the process:
• Program start and encoding pulse length
• Flipping pictures
White color was used in order to distinguish two consecutive colors.
“Pulse length!” :
• Retrieving pulse length (integer) from the user (GUI).
• Convert pulse length (in usec) to number of clocks, and then translate into a set of bits.
• Sending each bit – lsb first:
“0” – complementary of red line.
“1” – complementary of blue line.
“Start flipping!” :
• Complementary of green line.
“Stop flipping!” :
• Green line.
All lines are being read by hardware and treated appropriately.
“Flipping!” :
• “Picture 1” + red line
• “Picture 2” + blue line
SCHEME
CLK
Vccinput
Array ofComparators
ALTERAMAX7000s
BUFFER
Picture changed?
Set pulse width…
IBM 3174
Sampling Card
BNC
IBM PS/2
PC
RGBVs
0 – 1.4 V5V
Pulse length
3.3 V
Pulse length
5 V
Altera simplified structure :
ALTERAMAX7000s
Picture changed?
Set pulse width…
To Sampling card
Pulse generator
Trigger
Pulse length [bits]
Shift reg.
(saving pulse length)
Bit
Insert
R
G
B
Vsync
FFXSignalshaper
State Machine
FFX• This unit is designed to solve the metastability
problem
• This problem occurs when introducing an asynchronous signal into a digital (synchronized) system, using Flip-Flops.
• The most common way to tolerate metastability is to add one or more successive synchronizing flip-flops.
Altera simplified structure :
ALTERAMAX7000s
Picture changed?
Set pulse width…
To Sampling card
Pulse generator
Trigger
Pulse length [bits]
Shift reg.
(saving pulse length)
Bit
Insert
R
G
B
Vsync
FFXSignalshaper
State Machine
Signal shaper• The purpose of this unit is to distinguish "pure" (not
mixed) colors.
• Whenever a pure color (only red, green or blue) is given – then the appropriate output
(red, green or blue) is set to "1“
Sig. Sh.Red + Blue (0,0,0)
Sig. Sh.Red (1,0,0)
- Otherwise, all outputs are "0".
This component is implemented by a truth table.
Altera simplified structure :
ALTERAMAX7000s
Picture changed?
Set pulse width…
To Sampling card
Pulse generator
Trigger
Pulse length [bits]
Shift reg.
(saving pulse length)
Bit
Insert
R
G
B
Vsync
FFXSignalshaper
State Machine
State Machine
Idle
Reset
~Green – ~Red –WhiteReady to read pulse length
~RedBit<=0;
Insert = ‘1’; Bit<=0;Bit<=1;
Insert = ‘1’;
~Blue
Bit<=0;Start flipping
~Green
Red
Input: Red – R Green – G Blue – B Vsync ~Red – complimentary of R ~Green – complimentary of G ~Blue – complimentary of B
Output: Insert Trigger Bit
Bit<=0;
Got Blue
Trigger pulse
WhiteWhite
Bit<=0;
Got Red
Trigger pulse
Bit<=0;
Was VsyncBit<=0;
Was Vsync
Bit<=0;Got BlueBit<=0;
Got Red
Blue
Idle Idle
Finished to read pulse length
~Green
Vsync
VsyncRed
Blue
Vsync Blue
Red
Red Blue
GreenGreen
Altera simplified structure :
ALTERAMAX7000s
Picture changed?
Set pulse width…
To Sampling card
Pulse generator
Trigger
Pulse length [bits]
Shift reg.
(saving pulse length)
Bit
Insert
R
G
B
Vsync
FFXSignalshaper
State Machine
Shift register
• This unit stores and forms Pulse length
• Its inputs are given by the state machine
Pulse generator
• This unit outputs Pulse according to Pulse length data.
• Output occurs when triggered by the state machine.
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Pulse Length
Pulse generator
TriggerPulse length
Integration problems
• Metastability, occurs when asynchronous inputs are involved.
• Inputs that arrived exactly when the clock has risen, cause the state machine to be in an undefined state, and therefore to act unpredictably.
• The Altera interface (Max Plus II) declares “success” even though the “burning” process didn’t really take place.
• Vsync has opposite polarity at 2 outputs of the video card.
• The same screen may be redrawn several times – new Vsync edge ≠> new input signals.
• The state machine can’t distinguish 2 identical consecutive lines.
• A malfunction of one of the components causes push-back.
TECHNICAL SPECIFICATIONS
• 21 inch monitor• Matrox Millennium Dual Head 550.• Video splitter.• Brain wave collector device with appropriate
pc-card.• DirectX 8.x SDK installed on the computer.• 5V DC Power Supply.