-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.. _Firmata: | ||
|
||
*********************************** | ||
Firmata for Cajal Course | ||
*********************************** | ||
|
||
// Copy this text to a new sketch in the Arduino software (clear the default 'void loop etc first) and save as firmata_cajal.ino. Compile and upload to your Teensy. | ||
|
||
.. code-block:: | ||
#include <Firmata.h> | ||
byte analogPin; | ||
byte previousPIN[TOTAL_PORTS]; // PIN means PORT for input | ||
byte previousPORT[TOTAL_PORTS]; | ||
void outputPort(byte portNumber, byte portValue) | ||
{ | ||
// only send the data when it changes, otherwise you get too many messages! | ||
if (previousPIN[portNumber] != portValue) { | ||
Firmata.sendDigitalPort(portNumber, portValue); | ||
previousPIN[portNumber] = portValue; | ||
} | ||
} | ||
void setPinModeCallback(byte pin, int mode) { | ||
if (IS_PIN_DIGITAL(pin)) { | ||
pinMode(PIN_TO_DIGITAL(pin), mode); | ||
} | ||
} | ||
void analogWriteCallback(byte pin, int value) | ||
{ | ||
pinMode(pin, OUTPUT); | ||
analogWrite(pin, value); | ||
} | ||
void digitalWriteCallback(byte port, int value) | ||
{ | ||
byte i; | ||
byte currentPinValue, previousPinValue; | ||
if (port < TOTAL_PORTS && value != previousPORT[port]) { | ||
for (i = 0; i < 8; i++) { | ||
currentPinValue = (byte) value & (1 << i); | ||
previousPinValue = previousPORT[port] & (1 << i); | ||
if (currentPinValue != previousPinValue) { | ||
digitalWrite(i + (port * 8), currentPinValue); | ||
} | ||
} | ||
previousPORT[port] = value; | ||
} | ||
} | ||
void setup() | ||
{ | ||
Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); | ||
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); | ||
Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); | ||
Firmata.attach(SET_PIN_MODE, setPinModeCallback); | ||
Firmata.begin(); | ||
delayMicroseconds(1000); | ||
} | ||
void loop() | ||
{ | ||
while (Firmata.available()) { | ||
Firmata.processInput(); | ||
} | ||
delayMicroseconds(500); | ||
for (analogPin = 0; analogPin < TOTAL_ANALOG_PINS; analogPin++) { | ||
Firmata.sendAnalog(analogPin, analogRead(analogPin)); | ||
} | ||
byte i; | ||
for (i = 0; i < TOTAL_PORTS; i++) { | ||
outputPort(i, readPort(i, 0xff)); | ||
} | ||
while (Firmata.available()) { | ||
Firmata.processInput(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
****************************************** | ||
TA files | ||
****************************************** | ||
|
||
.. toctree:: | ||
:maxdepth: | ||
|
||
exday1TA.rst | ||
exday2TA.rst | ||
exday3TA.rst | ||
exday4TA.rst | ||
|
||
|
||
Exercises for teaching assistants | ||
########################################### | ||
|
||
:ref:`Exercises day 1 TA <refEDay1TA>` | ||
|
||
:ref:`Exercises day 2 TA <refEDay2TA>` | ||
|
||
:ref:`Exercises day 3 TA <refEDay3TA>` | ||
|
||
:ref:`Exercises day 4 TA <refEDay4TA>` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Acknowledgements | ||
################################### | ||
|
||
These materials were written by: | ||
|
||
* Alexandra Leighton | ||
* Joana Neto | ||
* Jakob Voigts | ||
* Aarón Cuevas López | ||
|
||
With material from: | ||
|
||
* Joana Neto, 2018; Materials and neuroscience: validating tools for large-scale, high-density neural recording, 2018. | ||
* Jon Newman and Jakob Voigts, 2017; Intro to Chronic Ephys (presentation at `TENSS <https://www.tenss.ro/>`_) | ||
* Mitra Javadzadeh, 2017; Building an analog ephys recording system (practical exercises developed for `TENSS <https://www.tenss.ro/>`_) | ||
* Circuit Simulator version 2.4.6js. Original by Paul Falstad, JavaScript conversion by Iain Sharp | ||
* Breadboard circuit illustration made in Fritzing | ||
|
||
With thoughtful feedback from: | ||
|
||
* Antonin Blot | ||
* Filipe Carvalho | ||
* Jon Newman | ||
* Cecilia Herbert |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Circuits | ||
|
||
|
||
circuit for electrode only with these values: | ||
https://tinyurl.com/yh7unqml | ||
|
||
- Gold plating does what to impedance? | ||
- 'Gold-plate' your electrode in the equivalent circuit by changing the appropriate component by a factor of 10. What happens to Vin? | ||
- | ||
|
||
|
||
demo with op amp: WIP | ||
|
||
https://tinyurl.com/ye7nc2ny | ||
|
||
|
||
|
||
|
||
with recording pc | ||
https://tinyurl.com/yzf5rjff | ||
|
||
|
||
|
||
electrode, headstage, leakage and shunt | ||
https://tinyurl.com/ygco6nqv | ||
|
||
|
||
|
||
measurement electrode, reference electrode, instrumentation amp | ||
https://tinyurl.com/yfsns7zj | ||
|
||
|
||
|
||
|
||
The equivalent circuit of the acquisition system | ||
################################################### | ||
|
||
circuit for electrode only with these values: | ||
https://tinyurl.com/yh7unqml | ||
|
||
- Gold plating does what to impedance? | ||
- 'Gold-plate' your electrode in the equivalent circuit by changing the appropriate component by a factor of 10. What happens to Vin? | ||
- | ||
|
||
with recording pc | ||
https://tinyurl.com/yzf5rjff | ||
|
||
electrode, headstage, leakage and shunt | ||
https://tinyurl.com/ygco6nqv | ||
|
||
measurement electrode, reference electrode, instrumentation amp | ||
https://tinyurl.com/yfsns7zj |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*********************************** | ||
Terms and Conditions | ||
*********************************** | ||
|
||
Disclaimer | ||
################################### | ||
The authors assume no responsibility or liability for any errors or omissions in the content of this site. The information contained in this site is provided on an "as is" basis with no guarantees of completeness and/or accuracy. | ||
|
||
Use at your own risk | ||
################################### | ||
These materials are provided for educational use. Any action you take upon the documentation on this website is strictly at your own risk. | ||
|
||
Links To Other Sites | ||
################################### | ||
These pages contain links that will redirect you to third party websites that are not operated by us and that we do not take responsibility for. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
Why drawing current distorts signals | ||
***************************************** | ||
A perfect 5V voltage source would always provide exactly 5 Volts, no matter what the rest of the circuit looks like. If we put a lot of high impedance components in the rest of the circuit, less current will flow, and if we put low impedance components we will get a high current. | ||
|
||
A real voltage source has a bit of output impedance, which means it acts as a voltage source in series with an impedance. This is modelled here: | ||
|
||
https://tinyurl.com/yfvzdxbz | ||
|
||
That invisible, small series resistance creates a voltage divider. Though the actual source voltage is the same 5V, the apparent voltage of the source varies depending on the ratio between the output impedance of the source, and the impedance of the rest of the circuit. The lower the impedance of the components used in the rest of the circuit, the higher the relative influence of the source output impedance, and the lower the apparent source voltage. | ||
|
||
In our acquisition system, the voltage source are the potential changes in the extracellular fluid (Vec). The resistive and capacitive properties of the electrode create an output resistance. The relative impedance of the circuit before and after Vin influence the magnitude of the signal at Vin. If we allow a lot of current to flow from our electrode to ground, we have a low impedance circuit, and will distort our signal. We therefore need something that will stop current being drawn from our cells, and provide the necessary current itself from a different source. This is done by amplifiers, in the headstage. |