assign constants to wave patterns and transmit to pc
DataFreedom
Posts: 6
No Laughing!
I got hold of a digital EEG on ebay. I have been concentrating on stupid things for long periods of time. Like concentrating on cookies. I have been up now for 9 days (need new coffee pot) and with the unit connected directly to my PC via serial port I have been able to collect similar wave functions and store them. by thinking cookie (with a bit of VB) I can click the start button. ok. the freq.= 0.5 - 400hz at 12 bits.
can a basic stamp sample the eeg, convert it from digital to analog, assign a value/constant to the wave data, convert it back to digital, and transmit it back to the PC via bluetooth?
I want to make it moble so I can always have it on. If nothing else I'll ware a laptop in a backpack but the eeg its self is like 30 lbs :S
I got hold of a digital EEG on ebay. I have been concentrating on stupid things for long periods of time. Like concentrating on cookies. I have been up now for 9 days (need new coffee pot) and with the unit connected directly to my PC via serial port I have been able to collect similar wave functions and store them. by thinking cookie (with a bit of VB) I can click the start button. ok. the freq.= 0.5 - 400hz at 12 bits.
can a basic stamp sample the eeg, convert it from digital to analog, assign a value/constant to the wave data, convert it back to digital, and transmit it back to the PC via bluetooth?
I want to make it moble so I can always have it on. If nothing else I'll ware a laptop in a backpack but the eeg its self is like 30 lbs :S
Comments
and after having had some sleep I think I can use that algorithm (after some development to act as correctional bias for the command input VB prglet.
Post Edited (DataFreedom) : 3/6/2008 1:27:08 PM GMT
check out whats going on over a SourceForge
sourceforge.net/projects/openeeg
ModularEEG Firmware Readme
==========================
License
All source code is licensed under the GNU General Public License (GPL) v2.
You can obtain your copy of the license from the Free Software Foundation
at www.fsf.org
Compiler information
If you want to modify the sources and recompile the .hex files you need to
use avr-gcc, a version of GCC compiled for AVR microcontroller support.
Documentation, and links to downloads for Windows and Linux are
available from http://www.avrfreaks.net
Firmware selection
There are several flavors to choose from. Obviously you must pick one that
matches your microcontroller (ATmega8 or AT90S4433)
* Data transmission formats
There are two versions currently in use. The older, version 2, is being
obsoleted, but is still around because ElectricGuru does not (yet) support
version 3, which is the recommended format.
This means that for testing and tuning with ElectricGuru, you need to use
v2 before switching to v3 when you are done.
* Basic firmware
The basic firmware is made as short and simple as possibe without any
special features. It supports both protocols, and both microcontrollers.
* Bidirection firmware
Feature rich. Can receive commands from the PC, has support for IrDA
(which needs extra hardware patched in) in development.
Currently it only supports the AT90S4433 microcontroller and packet format
version 2.
General programming notes
First a WARNING: Always disconnect the programming cable before connecting the
EEG to a test subject !!!! This is important because it crosses the opto-
isolator and connects PC-ground to EEG-ground.
The following sections describes how to program the microcontroller on a
ModularEEG with the home-made programming cable and sp12 programmer software
for either Linux or Windows.
However, if you plan on using some other programming software, and intend
to use an ATmega8, note that you must program the low fuses to be all ones
(0xff).
Sp12 Software setup (Linux)
Download and install the SP12 programmer software.
Link: http://www.xs4all.nl/~sbolt/Packages/sp12v1_0_3-Linux.tgz
Installation and usage instructions:
http://www.xs4all.nl/~sbolt/Packages/sp12.txt
Make sure your system is setup properly, and that you (or sp12) have root
privileges.
The sp12 software assumes that it can get access to the hardware ports.
However, if you have a parallel port driver compiled into the kernel, then it
won't let sp12 have access. There is in fact a /dev/parport provided to allow
access from user programs, but sp12 doesn't use it, preferring to hit the
ports directly.
So, the only way to get sp12 to work reliably is to run a kernel with parallel
port access compiled as a module. Then if you try sp12 and it doesn't work,
ou can do a 'lsmod' and look for the modules that are holding onto the ports.
Doing a 'rmmod' on all of the likely candidates (for example, "lp", "parport"
and "parport_pc") should do the trick.
Then after running sp12 to burn your firmware, you can reenable your printer
using 'modprobe lp'. So long as the parport clashes are dealt with like this,
sp12 works fine, and the command lines from the 'readme.txt' that comes in the
ModEEG firmware directory work without problem.
Sp12 Software setup (Windows)
First download and install the SP12 programmer software.
Link: http://www.xs4all.nl/~sbolt/Packages/sp12v103.exe
Installation and usage instructions:
http://www.xs4all.nl/~sbolt/Packages/sp12.txt
Windows NT4, 2000 or XP users should then install Userport. It is an
application that gives usermode applications (i.e regular programs) direct
access to selected hardware ports without a special driver.
Windows 98 users can not use it and do not need it.
Link:
http://www.embeddedtronics.com/public/Electronics/minidaq/userport/UserPort.zip
If it is down or has changed, try Google:
http://www.google.com/search?q=userport+windows.
Installation instructions can be found in its zip-file.
Programming
After the SP12 programmer is installed, simply open a command prompt or shell,
"cd" to the directory where you keep the sp12 software, if it is not in the
path.
The first time you run sp12 after installation, you must write
sp12 -i
This allows the sp12 software to initialize itself and calibrate its main
programming loop for your computer. The calibration value will be stored in a
file in the current directory.
Unless you have already done so, connect the ModularEEG to the PC's parallel
port using the programming cable. Make sure you orient the ribbon cable
correctly to the PCB before turning on the power.
If you want to program an ATmega8, begin by programming the fuses:
(Important: AT90S4433 users should NOT execute this step)
sp12 -wF11111111
This programs the low set of fuses so that the ATmega8 microcontroller works
with the external 7 MHz crystal. The factory default is to use an internal
1MHz oscillator, and that does obviously not work here.
Finally, program the ModularEEG (regardless of microcontroller type) as
follows:
sp12 -wpf firmware.hex
Replace firmware.hex with the path and name of the firmware you wish to use.