聴覚実験用にトーンバーストを出力する機器が必要になり、予算がなかったため急遽開発したものであるが、その後、 L6470(ステッピングモーターコントローラ)の制御やSDカードの再生機能も追加した。DACには、比較的入手容易なMicrochipのSPI DAC (MCP4922)を 使用し、後段には多段のLCフィルタをアンチエイリアシングフィルタとして配置し、出力を可変できるようにPGA2311も載せた。 アナログ電源はDCDCコンバータを使用して、USBのみの給電で基本まかなえるようにした。
KiCadで製作した基板、Arduinoプログラム本体、ProcessingによるGUIがある。FatFsは、ソフトウエアモードでのSPIピン指定のため、 オリジナルのバージョンでは動作せず、置き換える必要があるので注意。
ABR、VsEP用のGUIがある。SELECT COM PORTでポートを選び、リレーが鳴ることでGUIと接続されたことが確認出来るようにしてある。 古いマシンでWindowsXPを使う場合は、SP3でJava 7を入れた状態でprocessing-2.1.1でしか動作しないので注意する。
SD カード再生機能やモータドライバコントローラを持つファームウエア(WDOSC 60p1 以降)と、 ABR 波形生成機能のみの初期ファームウエア(WDOSC 22p1)がある。DAC のトリガはいずれもハードウエア機能によるが、 試作機と基板で端子が異なるため、ファームウエアのバージョンにより、ショートするピンの位置が異なる。 試作機に関しては、プログラマブルアッテネータ(PGA2311)の SPI端子及び L/R が異なるため、 別のバージョン (WDOSC 23p0LB) を用意した。半固定抵抗で、LPF 以降のゲインは4Vpp(± 10%;4kHz) になるように調整すると良い。
ArduFgx@SF.NET
最新バージョンのアーカイブはしていないので、gitからどうぞ。
発振モードでは、大きく分けて連続出力(発振)モードと、内部トリガ間欠出力モード、外部トリガ間欠出力モードがある。 始めの状態では、連続出力モードで、stで開始、tpで停止である。トリガモードでも、stで開始させないとトリガされない。 コマンドパラメータは=数字で先に引数を入力してからコマンドを入れる。
$ reset
. reset
<< Programmable Triggered Function Generator >>
Version: 60p1 Build: Aug 12 2017, 20:26:45
setup(): Initializing...
$
<< Programmable Triggered Function Generator >>
Version: 60p1 Build: Aug 12 2017, 20:26:45
setup(): Initializing...
$ mo
. mo
*** -60dB att -> ON. ***
$ mf
. mf
*** -60dB att -> OFF. ***
$
<< Programmable Triggered Function Generator >>
Version: 60p1 Build: Aug 12 2017, 20:26:45
setup(): Initializing...
$ status
. status
[ Current Status ]
Trigger Mode : Continuous
Wave Type : Sine Wave
Polarity : Single Mode
Time Period : 10us
Sampling Rate : 100kHz
Tone Frequency : 1kHz
Flat duration : 10ms
Internal Trigger : 100ms
PGA Gain [dB] : 0, 0
$ =4
. =4
Parameter = 4
$ freq
. freq
Frequency = 4kHz (@Fs=100kHz), Updating table ... [Flat][Rise][Fall] done.
Sampling Rate : 100kHz
Tone Frequency : 4kHz
$ status
. status
[ Current Status ]
Trigger Mode : Continuous
Wave Type : Sine Wave
Polarity : Single Mode
Time Period : 10us
Sampling Rate : 100kHz
Tone Frequency : 4kHz
Flat duration : 10ms
Internal Trigger : 100ms
PGA Gain [dB] : 0, 0
$ st
. st
Trigger : Started.
$
聴覚実験、ABRのために出力毎に位相を反転させるモード。Fs=100kHz。usでサンプリングレートを指定するが、Hzでなくてサンプル毎の間隔[us]*2で指定。 サンプリングレートは他のパラメータより先に指定しないと、テーブルの波形が更新されないので注意。
alt
trigext
=20
us
=8
freq
=3
fl
start
Fs=125kHz。
alt
trigext
=16
us
=25
freq
=3
fl
start
内部トリガはms単位で指定。
<< Programmable Triggered Function Generator >>
Version: 60p1 Build: Aug 12 2017, 20:26:45
setup(): Initializing...
$ =1000
. =1000
Parameter = 1000
$ trig
. trig
Internal Trigger = 1000ms
$ tint
. tint
*** Trigger Mode -> Internal. ***
$ ss
. ss
[ Current Status ]
Trigger Mode : Internal Trigger
Wave Type : Sine Wave
Polarity : Single Mode
Time Period : 10us
Sampling Rate : 100kHz
Tone Frequency : 1kHz
Flat duration : 10ms
Internal Trigger : 1000ms
PGA Gain [dB] : 0, 0
$ st
. st
Trigger : Started.
$
<< Programmable Triggered Function Generator >>
Version: 60p1 Build: Aug 12 2017, 20:26:45
setup(): Initializing...
$ ss
. ss
[ Current Status ]
Trigger Mode : Continuous
Wave Type : Sine Wave
Polarity : Single Mode
Time Period : 10us
Sampling Rate : 100kHz
Tone Frequency : 1kHz
Flat duration : 10ms
Internal Trigger : 100ms
PGA Gain [dB] : 0, 0
$ =-10
. =-10
Parameter = -10
$ g1
. g1
PGA Raw Value : 172, 192
PGA Gain [dB] : -10, 0
$ g2
. g2
PGA Raw Value : 172, 172
PGA Gain [dB] : -10, -10
$ ss
. ss
[ Current Status ]
Trigger Mode : Continuous
Wave Type : Sine Wave
Polarity : Single Mode
Time Period : 10us
Sampling Rate : 100kHz
Tone Frequency : 1kHz
Flat duration : 10ms
Internal Trigger : 100ms
PGA Gain [dB] : -10, -10
$
信号開始のトリガはEXT1に出力しているが、ランプ後の刺激時にEXT2から別のトリガを出すようにしているので、 実際の刺激実験のトリガはEXT2を使う。ランプでは殆ど刺激されないので、EXT1でトリガをとって加算平均をとっても脳波には何も出ない。
I sent them [= the Application Architecture group] a copy of my spec and went
to meet them, in case they had something interesting to say.
"Blah blah!" said one of them. "Blah blah blah, blah blah blah!" said another.
I don't think they quite had anything interesting to say. They were very
enamored of the idea of subclassing and sort of thought that people making
macros in Excel wanted to subclass a lot of things. In any case, one of the
fellows said, "Well, this is all very interesting. What's next? Who has to
approve your spec?"
I laughed. Even though I had only been at Microsoft for a few months, I knew
that there was no such thing as somebody approving my spec. Hell, nobody had
time to read my spec, let alone approve it. The programmers were bugging me
every day to get them more pages so that they could write more code. My boss
(and his boss) made it very clear to me that nobody else understood macros or
had time to work on macros, so whatever I did, it better be right. And here
this PhD working in a strange research group at Microsoft assumed that things
were a bit more formal than that.
-- Joel Spolsky
-- "Two Stories" ( http://www.joelonsoftware.com/articles/TwoStories.html )
Phoebe: Okay, Monica's are the biggest.
Monica: These tiny, little non-breasts?! Please, it's gotta be Rachel.
Rachel: What, no, no, no, mine are deceptively small I mean, I-I-I actually
sometimes, st-stuff my bra.
Monica: All right then, your bra would still be big.
Rachel: No, I stuff outside the bra.
-- David Crane & Marta Kauffman
-- "Friends" (T.V. Show) ( http://en.wikipedia.org/wiki/Friends )